From e03100d41c3283b190fab370c1fce483b798d9a4 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 7 Jul 2020 13:57:38 -0700 Subject: [PATCH] Fixes on List Overlay. Connection Error Sketch. --- assets/core/negative_heart_24px.svg | 13 +++ i18n/translation_de.qm | Bin 3612 -> 3327 bytes i18n/translation_de.ts | 25 +++-- i18n/translation_en.qm | Bin 7019 -> 7065 bytes i18n/translation_en.ts | 22 ++-- i18n/translation_fr.qm | Bin 3566 -> 3263 bytes i18n/translation_fr.ts | 25 +++-- i18n/translation_pt.qm | Bin 3386 -> 3113 bytes i18n/translation_pt.ts | 25 +++-- qml/overlays/ListOverlay.qml | 150 +++++++++++++--------------- 10 files changed, 150 insertions(+), 110 deletions(-) create mode 100644 assets/core/negative_heart_24px.svg diff --git a/assets/core/negative_heart_24px.svg b/assets/core/negative_heart_24px.svg new file mode 100644 index 00000000..05f00c83 --- /dev/null +++ b/assets/core/negative_heart_24px.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/i18n/translation_de.qm b/i18n/translation_de.qm index c442202fe493f0294ce6eb77dab3b47b50cb7630..c40eed580cb94cdd9f046a194d9407b5ce96c27d 100644 GIT binary patch delta 264 zcmbOu^Ivj;h@}LB*zFt!1{OAkg*J5z49v$E*-rdnU|{cM)Y-j;fq^lCaqVRtpm-hQ zR^}K61`Z|Wm0xNY7&x0J`pVU_yk@;veuja8yPK`Xo{xcnX&Z#*a$@_w7s%&4%syQ- z52$NCM>n?+0|VQ3juUovK-+R5G`BDpPx@2_1_paBvzb8Kxb|>usp|vU{)lUv*E*nn zKJJum2O!^^yZA#6P=7g($n`fs^<7|k;x9pSu6mw>e?U$M;!W%Z8qMj3zbcz69 nj37{)k&7>J{X3u*2EKNCpghODOrYXpo4pv{v23H@YbM^6lj3gSIrsZlLj8 z9=umQ?*grPJ(-tLj-B&yCQ$D5W+TRTEIbSf3_c8*48;s345^djnZ@ckfYvgw0Woi4 zN{VhyW^svbW=U!;J5Yq%2gvg;OD)PttYl;c3Rp4tF{Cn-0&y|2IShF~ksKh-1>!uQ z$qEb^Ks)jnsu=z-q%ov}MB&!(fUL<&Er;5YfW;ampw@hbWS}7mKqE?lWGX`u*n$+G gv8cugl;o%6>lWlBCZ}fP=cJ?-p*wuD4BKNi0K#2(Z~y=R diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 5e0ea234..f02c4128 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -114,22 +114,35 @@ ListOverlay - add-list-item Add a New List Item - Liste hinzufügen + Liste hinzufügen - add-new-item Add a new item to the list - Neues Listenelement hinzüfgen + Neues Listenelement hinzüfgen - todo-placeholder Todo... placeholder text - noch zu erledigen + noch zu erledigen + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 295db41bb087d625d60951b6ace442ed548469fa..979ff02e2831b8ddef493765a0da83ec9e744374 100644 GIT binary patch delta 856 zcmZuuUr1AN7(I7$+ugl)ZgV;<11%~7-70YUl9o{qsihE<4T1rp-IBnZjUGxV z3K0=OSP*I0A25TEg2+lmB~vOeh)76KN};g8hmH<>ijR8_-}%1p{Lc6LE#>y)-Ev0k z!C}DQfOFmtBp47o)C%aw1>@K{Af^i0BZGi&Mz~U80GuhpVAdR9aSIP-v)LCBhV>Qf zYZt~Ar-7tOT}~3~4yUgC*jXTTNZ0v^^Y%1-*15Yt+Km3Hv6wp7^aHot zhV*m~V4E`ZmGuGAe#1=jB%4keTMj1zx>s?OJ{#AbGnbl7=WAJ4_L#a;0u-^EhKn?c zyG^e>y*zx;w0!R}kaAtzz9X5Y9*O1lQRjCu;erRHC#^SmTc@O_MKoe=lP07=M4-Ht)}GOcy+W?(I6`Oha(Km0 z%#!<8biBp`@u;3gkINKpkE7nBID@-rXs2?gi^96Uag^=K@JbqBolst`PqJQX zv4&sp*~Tp=yN}cOoWgRjnti}F+fY>ZAt7QzA!-`!Q2*=BiPMzw(p@!WGEqXo WFtjZZMGmXpP<8$0qC+`ip5q^lZ_iHv delta 788 zcmY*WYe*Df6g@NJ&dz)@v+J(wDp_e#LinH`uJt4BVFf;l2q`HEmS)YZ)fIPPe`Ibh z`KP5QL`*D0qlcmXF~f=iu|UIwvKK^zkI+g&sIWw#YZF3z-0#eA?>+aN`?YNTnsd<^ zcE0xkF($NctpkK%P8?bU%%8c8hg|@7kgG2<0rAsZSNbbJ1J^y4L3LrSPbdSVGHz&Q z6tHjNv+b0(&+w(Y4gm=beB(RnkNqN~pSS@eUKh@aMS%0L(D|blkOzcWv4;42FI`Ot z51NvaTvU9`)V9A3V4UeiXoQNB#oBEafFCrF^@#J2=%3}APnJ_&nKw7bSCNQGb6;VQ zhQR#P)e6KtFwfpPO`?xTt5!QmRJ~McdqRBYr3yz6U>ldBik(d6OLxYnfN3Sro?*h1YB5p7WP=yp=ptpw(L zfViaGp5tkqyfS4c2e!+qfR;v}pS@t;iy3V;||A)e`M>!3WyJ%f?(jIW5&P92_Md z9hT>32(>*{b#f ListOverlay - - add-list-item - Add a New List Item - Add a New List Item + + search-list + ex: "... paste an address here to add a contact ..." + Search List - - add-new-item - Add a new item to the list - Add a new item to the list + + peer-not-online + Peer is Offline. Applications cannot be used right now. - - todo-placeholder - Todo... placeholder text - Todo... + + add-list-item-btn + Add Item diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm index 3026fc599c3daacbcf66653e6860b66e9e8a702e..3b814608bc1ff67a5fe2561ac073ec5988d8cab3 100644 GIT binary patch delta 264 zcmaDSy&X)Y-j;fq^lKaqVRtpm-hQ zR^}L>_ygvZUuqZ_I3p+e%GI;HWxZH_hJk_Go2|y4kAZ<{8-(T(Vf(%p$mg8NK3z1A zfq^5RqnlfZfq`u{#|b+-plz8Dn(HhVPx@2_1_o;`vzb8KxVpHu)b#;vS-`c;YaLME zGwzgb2Oyu9yZA#6P=73s$n`fs^*vyE;x9pSE?=I5e?U$U;7#lX8qF!qXA>3zbcz69 nj37{)k%cdD{X3u*2EKNCpghOAOrYYn&0dTjST+Z;&t(Gu8Aw9| delta 529 zcmaKnPbdUo7{;G5Yi4%-NU{pG?Lj%%mG+=SiyI<$xePNHjoEE?5NY=2vL%w_;IK!9 z=^L_98d%la>*ZSq^wieVpn1Dw{y2An3 z48vuLfH2Pl&$a<(h}pRdlI}1^>@evCcI#~c5MwI?{v_uqzn#4SoAl zS2(9y+~e1M7T{eJQc@Mb?+ckoglNWBmY%(*r%yonr6`ZD0caOnH;5{w#Y1O_XeZ)v z-!Ao+#CNAe@A@Sz)kS)Pl*pT4!P_fYf1RYsS4G!GqoSs0yckyQd$WXjSydQ6@4YtY zZu20_ ListOverlay - add-list-item Add a New List Item - Ajouter un nouvel élément + Ajouter un nouvel élément - add-new-item Add a new item to the list - Ajouter un nouvel élément à la liste + Ajouter un nouvel élément à la liste - todo-placeholder Todo... placeholder text - A faire... + A faire... + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm index 39f9c4bdb09fd3d13dd067a7ca57e7d71184fe5d..b6c2805f8590eb340d01e82b038ec2d113e87bc7 100644 GIT binary patch delta 264 zcmdlbwNhe&h@}LB*zFt!2Idb83vKFv^ae(@6Mq;O*f|+>cCTSzU`$|Kdszo4p2N76 zIR+@+z`XKH4Fdzm&56Ep^(-e@FP5KSVBp%wR%6e{z`(QwLUZP^ecub@b4s&M7tI6e z`pMDFEyTdU7RYhJ&W?eB#TP)^f3{Es|E6{J5O9`~!-UbIhr;bF?j*)^_7=B@4+N z<%W>*Bay-twHxG0E4g#Gq?9O+)Nahh)AK&x=Y77P?^fGs`(kr%7g`@JK&W7&FGqc! ziPxWiT*m@uI{+JJyY~UoEp{Y~lAaN^-m-vlSB!b{t}EB=Yza`e#q2->P`CNpd0c!y zr;8VAKK9$y9_8fZ8F0;WcYFmvn1|Mg%FFyPw?KDcemuNK zv@!mX`=Wmxs$Li*p9?iru^>Q_i)C*+Uw2=A{=`Ulv;x^H%btfwnJ_m?9_E#lPLp;o z2i>expGN>g&|zYN%7G0HN%#;!8U_;ddZLQbE=7taQznR19!=MSmYGTi&9sq_NKvCS zjm#KHOUp2UgiuXmn;3+nD_y(LjhvN<2qdlRkenU1QqOo#3>k UO&C*-r5njw0U4+313~nQ-yg?z#Q*>R diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 0f7938bc..77dcfe2d 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -114,22 +114,35 @@ ListOverlay - add-list-item Add a New List Item - Adicionar Item à Lista + Adicionar Item à Lista - add-new-item Add a new item to the list - Adicionar novo item à lista + Adicionar novo item à lista - todo-placeholder Todo... placeholder text - Afazer… + Afazer… + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + diff --git a/qml/overlays/ListOverlay.qml b/qml/overlays/ListOverlay.qml index 0ed706ce..444f9696 100644 --- a/qml/overlays/ListOverlay.qml +++ b/qml/overlays/ListOverlay.qml @@ -10,38 +10,65 @@ import "../opaque/controls" as Awesome import "../opaque/fonts/Twemoji.js" as T import "../utils.js" as Utils import "../opaque/styles" +import "../opaque/theme" ColumnLayout { Layout.fillWidth: true width:parent.width + id: listpanel + property bool online: false Text { Layout.fillWidth: true } - TextField { + Opaque.IconTextField { id: filter - - placeholderText: "Search.." - - style: CwtchTextFieldStyle{} - + visible:listpanel.online anchors.left: parent.left anchors.right: parent.right - anchors.margins: 10 + //: ex: "... paste an address here to add a contact ..." + placeholderText: qsTr("search-list") + horizontalAlignment: TextInput.AlignHCenter + icon: gcd.assetPath + "core/search-24px.svg" + + onTextChanged: { - bulletinView.filter = text - if (bulletinView.model.get(bulletinView.currentIndex).title.indexOf(text) == -1) { - bulletinView.currentIndex = -1 + listView.filter = text + if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) { + listView.currentIndex = -1 } } } + + + Opaque.Icon { + visible:!listpanel.online + source: gcd.assetPath + "core/negative_heart_24px.svg" + iconColor: Theme.mainTextColor + backgroundColor: Theme.backgroundPaneColor + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + height: 150 + width: 150 + } + Opaque.EllipsisLabel { + visible:!listpanel.online + color: Theme.mainTextColor + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + size: 18 * gcd.themeScale + text: qsTr("peer-not-online") + } + + + + Flickable { // THE MESSAGE LIST ITSELF id: sv clip: true + visible:listpanel.online Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.fillHeight: true Layout.fillWidth: true @@ -87,25 +114,22 @@ ColumnLayout { }) } - /*if(msg.c != undefined) { - jsonModel4.get(msg.c).complete = true + if(msg.c != undefined) { + jsonModel4.get(msg.c).complete = true } - - if (sv.contentY + sv.height >= sv.contentHeight - colMessages.height && sv.contentHeight > sv.height) { - sv.contentY = sv.contentHeight - sv.height - }*/ } onUpdateContactStatus: function(_handle, _status, _loading) { if (gcd.selectedConversation == _handle) { - if (_loading == true) { - newposttitle.enabled = false - btnSend.enabled = false - } else { - newposttitle.enabled = true - btnSend.enabled = true - } + // Group is Synced OR p2p is Authenticated + if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) { + newlistitem.readOnly = false + listpanel.online = true + } else { + newlistitem.readOnly = true + listpanel.online= false + } } } } @@ -115,7 +139,7 @@ ColumnLayout { } ListView { - id: bulletinView + id: listView anchors.left: parent.left anchors.leftMargin: 10 anchors.topMargin: 10 @@ -130,8 +154,8 @@ ColumnLayout { Item { width: parent.width - height: title.indexOf(bulletinView.filter) >= 0 ? texttitle.height : 0 - visible: title.indexOf(bulletinView.filter) >= 0 + height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0 + visible: title.indexOf(listView.filter) >= 0 Column { width: parent.width @@ -141,31 +165,24 @@ ColumnLayout { checked: complete onClicked: { var msg = JSON.stringify({"o":4, "c":index}) - gcd.sendMessage(msg, btnSend.nextMessageID++) + gcd.sendMessage(msg, newlistitem.nextMessageID++) } } RowLayout { Text { id: texttitle - text: '' + Utils.htmlEscaped(title) + ' by ' + from + "
" + timestamp + text: '' + Utils.htmlEscaped(title) + ' by ' + displayName + "
" + timestamp leftPadding: 10 topPadding: 5 bottomPadding:5 - color: windowItem.cwtch_dark_color + color: Theme.mainTextColor } } } - Rectangle { - height: 1 - color: windowItem.cwtch_color - anchors { - left: parent.left - right: parent.right - } - } + Opaque.HLine{} } @@ -179,55 +196,28 @@ ColumnLayout { } } - GroupBox { - //: Add a New List Item - title: qsTr("add-list-item") - Layout.fillWidth: true + Opaque.ButtonTextField { + id: newlistitem + visible:listpanel.online + readOnly: false + button_text: qsTr("add-list-item-btn") + dropShadowColor: Theme.dropShadowPaneColor + property int nextMessageID: 1 + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 10 - RowLayout { - Layout.fillWidth: true - width: parent.width - ColumnLayout { - Layout.fillWidth: true - - - Text { - //: Add a new item to the list - text: qsTr("add-new-item") - } - - TextField { - id: newposttitle - //: Todo... placeholder text - placeholderText: qsTr("todo-placeholder") - Layout.fillWidth: true - style: CwtchTextFieldStyle{} - } - - Opaque.Button { // SEND MESSAGE BUTTON - id: btnSend - icon: "regular/paper-plane" - text: "add" - anchors.right: parent.right - anchors.rightMargin: 2 - - property int nextMessageID: 1 - - onClicked: { - if (newposttitle.text != "") { - var msg = JSON.stringify({"o":4, "t":newposttitle.text}) - gcd.sendMessage(msg, nextMessageID++) - } - newposttitle.text = "" - } + onClicked: { + if (newlistitem.text != "") { + var msg = JSON.stringify({"o":4, "t":newlistitem.text}) + gcd.sendMessage(msg, nextMessageID++) } + newlistitem.text = "" } - } } - - + Opaque.HLine{}