From 2aa2eabf48f99155039d9d14d2ca617ab85ff988 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 28 Apr 2020 11:47:40 -0700 Subject: [PATCH] More layout fixes + HLine --- qml/panes/PeerSettingsPane.qml | 156 ++++++++++++++++++++------------- qml/widgets/HLine.qml | 28 ++++++ 2 files changed, 124 insertions(+), 60 deletions(-) create mode 100644 qml/widgets/HLine.qml diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index 594f511c..2ad18f39 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -10,7 +10,7 @@ import "../widgets" as Widgets import "../styles" import "../theme" -ColumnLayout { // peerSettingsPane +Column { // peerSettingsPane id: root anchors.fill: parent property bool blocked @@ -37,72 +37,108 @@ ColumnLayout { // peerSettingsPane Column { id: tehcol width: root.width - leftPadding: 10 - padding:10 - spacing: 5 - - Widgets.EllipsisLabel { - color: Theme.mainTextColor - text: qsTr("address-label") - font.styleName: "ExtraBold" - font.pointSize: 15 * gcd.themeScale - } - - Widgets.ButtonTextField { - id: txtOnion - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - readOnly: true - button_text: qsTr("copy-btn") - onClicked: { - //: notification: copied to clipboard - gcd.popup(qsTr("copied-to-clipboard-notification")) - txtOnion.selectAll() - txtOnion.copy() + padding:20 + spacing: 10 + GridLayout { + columns: 1 + width:parent.width * 0.95 + anchors.horizontalCenter: parent.horizontalCenter + Widgets.EllipsisLabel { + anchors.left:parent.left + color: Theme.mainTextColor + text: qsTr("address-label") + font.styleName: "ExtraBold" + font.pointSize: 15 * gcd.themeScale } - } - - Widgets.EllipsisLabel { - color: Theme.mainTextColor - text: qsTr("display-name-label") - font.styleName: "ExtraBold" - font.pointSize: 15 * gcd.themeScale - } - - - Widgets.ButtonTextField { - id: txtDisplayName - button_text: qsTr("save-btn") - onClicked: { - gcd.savePeerSettings(txtOnion.text, txtDisplayName.text) - theStack.title = txtDisplayName.text - theStack.pane = theStack.messagePane - } - } - - - - Widgets.Button { - icon: "solid/hand-paper" - text: root.blocked ? qsTr("unblock-btn") : qsTr("block-btn") - - onClicked: { - if (root.blocked) { - gcd.unblockPeer(txtOnion.text) - } else { - gcd.blockPeer(txtOnion.text) + Widgets.ButtonTextField { + id: txtOnion + anchors.left:parent.left + anchors.right:parent.right + readOnly: true + button_text: qsTr("copy-btn") + onClicked: { + //: notification: copied to clipboard + gcd.popup(qsTr("copied-to-clipboard-notification")) + txtOnion.selectAll() + txtOnion.copy() } - root.blocked = !root.blocked } } - Widgets.Button { - icon: "regular/trash-alt" - text: qsTr("delete-btn") + Widgets.HLine{} - onClicked: { - gcd.deleteContact(txtOnion.text) - theStack.pane = theStack.emptyPane + GridLayout { + columns: 1 + width:parent.width * 0.95 + anchors.horizontalCenter: parent.horizontalCenter + Widgets.EllipsisLabel { + anchors.left:parent.left + color: Theme.mainTextColor + text: qsTr("display-name-label") + font.styleName: "ExtraBold" + font.pointSize: 15 * gcd.themeScale + } + + + Widgets.ButtonTextField { + id: txtDisplayName + anchors.left:parent.left + anchors.right:parent.right + button_text: qsTr("save-btn") + onClicked: { + gcd.savePeerSettings(txtOnion.text, txtDisplayName.text) + theStack.title = txtDisplayName.text + theStack.pane = theStack.messagePane + } + } + } + + + Widgets.HLine{} + + + GridLayout { + columns: 2 + width:parent.width * 0.95 + anchors.horizontalCenter: parent.horizontalCenter + Widgets.EllipsisLabel { + color: Theme.mainTextColor + text: qsTr("block-btn") + font.styleName: "ExtraBold" + font.pointSize: 15 * gcd.themeScale + } + + Widgets.Button { + icon: "solid/hand-paper" + text: root.blocked ? qsTr("unblock-btn") : qsTr("block-btn") + anchors.right: parent.right + onClicked: { + if (root.blocked) { + gcd.unblockPeer(txtOnion.text) + } else { + gcd.blockPeer(txtOnion.text) + } + root.blocked = !root.blocked + } + + } + } + + Widgets.HLine{} + Column { + width:parent.width * 0.95 + anchors.horizontalCenter: parent.horizontalCenter + Widgets.Button { + icon: "regular/trash-alt" + text: qsTr("delete-btn") + anchors.right: parent.right + + + onClicked: { + gcd.deleteContact(txtOnion.text) + theStack.pane = theStack.emptyPane + } } } diff --git a/qml/widgets/HLine.qml b/qml/widgets/HLine.qml new file mode 100644 index 00000000..33c342a9 --- /dev/null +++ b/qml/widgets/HLine.qml @@ -0,0 +1,28 @@ +import QtQuick 2.12 +import "../theme" + +Column { + width: parent.width + anchors.horizontalCenter: parent.horizontalCenter + + Rectangle { + height: 10 + color:"transparent" + width: parent.width + } + + + Rectangle { + anchors.horizontalCenter: parent.horizontalCenter + height: 1 + width: parent.width * 0.95 + color: Theme.dropShadowColor + } + + + Rectangle { + height: 10 + color:"transparent" + width: parent.width + } +}