From 5694dfe23edccdeac0a3fb2fa192cc0d5f0a059d Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 23 Jun 2020 16:42:51 -0700 Subject: [PATCH] Migrate to new peer authorization levels, add new peer approval workflow, add blocked peers to contact list in seperate section --- qml/widgets/ContactList.qml | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/qml/widgets/ContactList.qml b/qml/widgets/ContactList.qml index 157f9b56..6e5acbca 100644 --- a/qml/widgets/ContactList.qml +++ b/qml/widgets/ContactList.qml @@ -102,11 +102,13 @@ ColumnLayout { target: gcd onAddContact: function(handle, displayName, image, badge, status, authorization, loading, lastMsgTs) { + var model = contactsModel if (authorization == Const.auth_blocked) { model = blockedContactsModel } + for (var i = 0; i < model.count; i++) { if (model.get(i)["_handle"] == handle) { return @@ -184,7 +186,10 @@ ColumnLayout { authorization: _authorization loading: _loading rowColor: (_authorization == Const.auth_unknown) ? Theme.backgroundHilightElementColor : Theme.backgroundMainColor +<<<<<<< HEAD Layout.fillWidth: true +======= +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -203,6 +208,7 @@ ColumnLayout { onClicked: { blockedToggle.showing = !blockedToggle.showing +<<<<<<< HEAD blockedContacts.visible = blockedToggle.showing if (blockedToggle.showing) { gcd.storeSetting(Const.show_blocked, "true") @@ -269,6 +275,65 @@ ColumnLayout { blockedToggle.showing = (_showBlocked == "true") blockedContacts.visible = (_showBlocked == "true") } +======= + if (blockedToggle.showing) { + hideBlocked.stop() + openBlocked.start() + } else { + openBlocked.stop() + hideBlocked.start() + } + } + + SequentialAnimation { id: openBlocked + PropertyAnimation {target: blockedContacts; property: "implicitHeight"; to: blockedContacts.childrenRect.height; duration: 100 } + PropertyAnimation {target: sv; property: "contentY"; to: sv.contentY + (40 * logscale); duration: 200} + } + + PropertyAnimation { id: hideBlocked; target: blockedContacts; property: "implicitHeight"; to: 0; duration: 200 } + + onEntered: { + blockedBG.color = Theme.backgroundPaneColor + } + + onExited: { + blockedBG.color = Theme.backgroundMainColor + } + } + + Rectangle { + id: blockedBG + property bool isHover: false + + anchors.fill: blockItem + color: Theme.backgroundMainColor + } + + Row { + id: blockedToggle + property bool showing: true + + leftPadding: 32 * logscale + topPadding: 16 * logscale + bottomPadding: 8 * logscale + spacing: 5 * logscale + + Opaque.ScalingLabel { + id: blockLbl + + text: qsTr("blocked") + size: Theme.chatMetaTextSize + color: Theme.portraitBlockedTextColor + } + + Opaque.ScalingLabel { + id: blockBtn + + text: blockedToggle.showing ? "▲" : "▼" + size: Theme.chatMetaTextSize + color: Theme.portraitBlockedTextColor + } +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -277,10 +342,22 @@ ColumnLayout { id: blockedContactsModel } +<<<<<<< HEAD ColumnLayout { id: blockedContacts Layout.fillWidth: true spacing: 0 +======= + Item { + id: blockedContacts + + anchors.left: parent.left + anchors.right: parent.right + height: childrenRect.height + implicitHeight: childrenRect.height + + property real logscale: 4 * Math.log10(gcd.themeScale + 1) +>>>>>>> Migrate to new peer authorization levels, add new peer approval Repeater { id: blockedContactsRepeater @@ -293,7 +370,11 @@ ColumnLayout { status: _status authorization: _authorization loading: _loading +<<<<<<< HEAD Layout.fillWidth: true +======= + rowColor: Theme.backgroundHilightElementColor +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } }