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
color: "#EEEEFF"
color: Theme.backgroundPaneColor
Layout.fillWidth: true
Layout.fillHeight: true

View File

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

View File

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

View File

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

View File

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