ButtonTextField, Some Theme Updates and Bug Fixes
the build was successful Details

This commit is contained in:
Sarah Jamie Lewis 2020-04-27 11:31:53 -07:00
parent 0a9b2ed6f5
commit ce8e46a4dd
6 changed files with 78 additions and 41 deletions

View File

@ -144,7 +144,7 @@ ApplicationWindow {
} }
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
color: "#EEEEFF" color: Theme.backgroundPaneColor
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true

View File

@ -8,12 +8,14 @@ import QtQuick.Controls 1.4
import "../widgets" as Widgets import "../widgets" as Widgets
import "../styles" import "../styles"
import "../theme"
ColumnLayout { // peerSettingsPane ColumnLayout { // peerSettingsPane
id: root id: root
anchors.fill: parent anchors.fill: parent
property bool blocked property bool blocked
Widgets.StackToolbar { Widgets.StackToolbar {
id: toolbar id: toolbar
aux.visible: false aux.visible: false
@ -38,40 +40,34 @@ ColumnLayout { // peerSettingsPane
leftPadding: 10 leftPadding: 10
spacing: 5 spacing: 5
Widgets.ScalingLabel { Widgets.EllipsisLabel {
color: Theme.mainTextColor
text: qsTr("address-label") text: qsTr("address-label")
} }
TextField { Widgets.ButtonTextField {
id: txtOnion id: txtOnion
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
readOnly: true readOnly: true
button_text: qsTr("copy-btn")
onClicked: {
//: notification: copied to clipboard
gcd.popup(qsTr("copied-to-clipboard-notification"))
txtOnion.selectAll()
txtOnion.copy()
}
} }
Widgets.Button {
icon: "regular/clipboard"
text: qsTr("copy-btn")
onClicked: { Widgets.EllipsisLabel {
//: notification: copied to clipboard color: Theme.mainTextColor
gcd.popup(qsTr("copied-to-clipboard-notification"))
txtOnion.selectAll()
txtOnion.copy()
}
}
Widgets.ScalingLabel{
text: qsTr("display-name-label") text: qsTr("display-name-label")
} }
TextField {
Widgets.ButtonTextField {
id: txtDisplayName id: txtDisplayName
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } button_text: qsTr("save-btn")
}
Widgets.Button {
text: qsTr("save-btn")
onClicked: { onClicked: {
gcd.savePeerSettings(txtOnion.text, txtDisplayName.text) gcd.savePeerSettings(txtOnion.text, txtDisplayName.text)
theStack.title = txtDisplayName.text theStack.title = txtDisplayName.text
@ -80,19 +76,20 @@ ColumnLayout { // peerSettingsPane
} }
Widgets.Button {
icon: "solid/hand-paper"
text: root.blocked ? qsTr("unblock-btn") : qsTr("block-btn")
onClicked: { Widgets.Button {
if (root.blocked) { icon: "solid/hand-paper"
gcd.unblockPeer(txtOnion.text) text: root.blocked ? qsTr("unblock-btn") : qsTr("block-btn")
} else {
gcd.blockPeer(txtOnion.text) onClicked: {
} if (root.blocked) {
root.blocked = !root.blocked gcd.unblockPeer(txtOnion.text)
} } else {
} gcd.blockPeer(txtOnion.text)
}
root.blocked = !root.blocked
}
}
Widgets.Button { Widgets.Button {
icon: "regular/trash-alt" icon: "regular/trash-alt"
@ -118,4 +115,6 @@ ColumnLayout { // peerSettingsPane
root.blocked = blocked root.blocked = blocked
} }
} }
} }

View File

@ -10,10 +10,10 @@ ThemeType {
readonly property color hotPink: "#D01972" readonly property color hotPink: "#D01972"
backgroundMainColor: darkGrayPurple backgroundMainColor: darkGrayPurple
backgroundPaneColor: mauvePurple backgroundPaneColor: deepPurple
mainTextColor: whitePurple mainTextColor: whitePurple
defaultButtonColor: hotPink defaultButtonColor: mauvePurple
defaultButtonActiveColor: pink defaultButtonActiveColor: pink
defaultButtonTextColor: whitePurple defaultButtonTextColor: whitePurple

View File

@ -36,5 +36,5 @@ Item {
readonly property int sidePaneMinSize: 700 readonly property int sidePaneMinSize: 700
readonly property int doublePaneMinSize: 1000 readonly property int doublePaneMinSize: 1000
property ThemeType theme: CwtchLight { } property ThemeType theme: CwtchDark{ }
} }

View File

@ -16,12 +16,13 @@ Rectangle {
Layout.minimumHeight: height Layout.minimumHeight: height
Layout.maximumHeight: height Layout.maximumHeight: height
color: mousedown ? Theme.defaultButtonActiveColor : Theme.defaultButtonColor color: mousedown ? Theme.defaultButtonActiveColor : Theme.defaultButtonColor
border.color: Theme.defaultButtonColor border.color: mousedown ? Theme.defaultButtonActiveColor : Theme.defaultButtonColor
border.width: 1 border.width: 1
radius: (height / 2.0) radius: override_radius
antialiasing: true antialiasing: true
property bool checked: false property bool checked: false
property double override_radius: (height / 2.0)
property alias text: buttonText.text property alias text: buttonText.text
property alias font: buttonText.font.family property alias font: buttonText.font.family
property string icon property string icon
@ -36,7 +37,7 @@ Rectangle {
Image { Image {
anchors.left: parent.left anchors.left: parent.left
id: ico id: ico
source: gcd.assetPath + "fontawesome/"+(icon!=""?icon:"regular/window-maximize")+".svg" source: icon!="" ? gcd.assetPath + "fontawesome/"+icon+".svg" : "";
height: button.height / 2 height: button.height / 2
sourceSize.height: button.height / 2 sourceSize.height: button.height / 2
} }

View File

@ -0,0 +1,37 @@
import QtQuick 2.7
import QtQuick.Controls 2.13
import QtQuick.Controls.Styles 1.4
import "." as Widgets
import "../theme"
// ButtonTextField integrates a text field and a button
TextField {
color: Theme.mainTextColor
font.pointSize: 10 * gcd.themeScale
width: parent.width - 20
property string icon
property string button_text
signal clicked
smooth: true
background: Rectangle {
radius: 10
color: Theme.backgroundMainColor
border.color: Theme.backgroundMainColor
}
Widgets.Button {
icon: ""
text: button_text
anchors { top: parent.top; right: parent.right }
override_radius: 10
height: parent.height; width: parent.height * 4
onClicked: {
parent.focus = true;
parent.clicked();
}
}
}