Merge pull request 'More layout fixes + HLine' (#281) from sarah-ui into master
the build was successful
Details
the build was successful
Details
This commit is contained in:
commit
1b82054e76
|
@ -10,7 +10,7 @@ import "../widgets" as Widgets
|
||||||
import "../styles"
|
import "../styles"
|
||||||
import "../theme"
|
import "../theme"
|
||||||
|
|
||||||
ColumnLayout { // peerSettingsPane
|
Column { // peerSettingsPane
|
||||||
id: root
|
id: root
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property bool blocked
|
property bool blocked
|
||||||
|
@ -37,72 +37,108 @@ ColumnLayout { // peerSettingsPane
|
||||||
Column {
|
Column {
|
||||||
id: tehcol
|
id: tehcol
|
||||||
width: root.width
|
width: root.width
|
||||||
leftPadding: 10
|
padding:20
|
||||||
padding:10
|
spacing: 10
|
||||||
spacing: 5
|
GridLayout {
|
||||||
|
columns: 1
|
||||||
Widgets.EllipsisLabel {
|
width:parent.width * 0.95
|
||||||
color: Theme.mainTextColor
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: qsTr("address-label")
|
Widgets.EllipsisLabel {
|
||||||
font.styleName: "ExtraBold"
|
anchors.left:parent.left
|
||||||
font.pointSize: 15 * gcd.themeScale
|
color: Theme.mainTextColor
|
||||||
}
|
text: qsTr("address-label")
|
||||||
|
font.styleName: "ExtraBold"
|
||||||
Widgets.ButtonTextField {
|
font.pointSize: 15 * gcd.themeScale
|
||||||
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()
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
Widgets.ButtonTextField {
|
||||||
Widgets.EllipsisLabel {
|
id: txtOnion
|
||||||
color: Theme.mainTextColor
|
anchors.left:parent.left
|
||||||
text: qsTr("display-name-label")
|
anchors.right:parent.right
|
||||||
font.styleName: "ExtraBold"
|
readOnly: true
|
||||||
font.pointSize: 15 * gcd.themeScale
|
button_text: qsTr("copy-btn")
|
||||||
}
|
onClicked: {
|
||||||
|
//: notification: copied to clipboard
|
||||||
|
gcd.popup(qsTr("copied-to-clipboard-notification"))
|
||||||
Widgets.ButtonTextField {
|
txtOnion.selectAll()
|
||||||
id: txtDisplayName
|
txtOnion.copy()
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
root.blocked = !root.blocked
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widgets.Button {
|
Widgets.HLine{}
|
||||||
icon: "regular/trash-alt"
|
|
||||||
text: qsTr("delete-btn")
|
|
||||||
|
|
||||||
onClicked: {
|
GridLayout {
|
||||||
gcd.deleteContact(txtOnion.text)
|
columns: 1
|
||||||
theStack.pane = theStack.emptyPane
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue