aboutsummaryrefslogtreecommitdiff
path: root/components/LineEdit.qml
diff options
context:
space:
mode:
authorSander Ferdinand <sa.ferdinand@gmail.com>2017-12-08 01:51:22 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-29 23:04:02 +0100
commit328eb32a24eef9a59da7bd2e2f1bf22959783f45 (patch)
tree6dbafe8c82d9c1f2578fba4f565aa75d53dcb84a /components/LineEdit.qml
parentf48cd1b82b758c7b4e396e523172f66b9b371c5b (diff)
downloadmonzero-gui-328eb32a24eef9a59da7bd2e2f1bf22959783f45.tar.gz
monzero-gui-328eb32a24eef9a59da7bd2e2f1bf22959783f45.tar.xz
monzero-gui-328eb32a24eef9a59da7bd2e2f1bf22959783f45.zip
Various QML development
Diffstat (limited to 'components/LineEdit.qml')
-rw-r--r--components/LineEdit.qml43
1 files changed, 20 insertions, 23 deletions
diff --git a/components/LineEdit.qml b/components/LineEdit.qml
index b1ef6ee6..f1299519 100644
--- a/components/LineEdit.qml
+++ b/components/LineEdit.qml
@@ -40,7 +40,7 @@ Item {
property alias inlineButton: inlineButtonId
property alias inlineButtonText: inlineButtonId.text
property alias inlineIcon: inlineIcon.visible
- property alias copyButton: copyButton.visible
+ property bool copyButton: false
property int fontSize: 18 * scaleRatio
property bool showBorder: true
property bool error: false
@@ -78,14 +78,6 @@ Item {
}
}
- function getColor(error) {
- // @TODO: replace/remove this (implement as ternary?)
- if (error)
- return "transparent"
- else
- return "transparent"
- }
-
Text {
id: inputLabel
anchors.top: parent.top
@@ -106,13 +98,13 @@ Item {
}
Rectangle{
- id: copyButton
+ id: copyButtonRect
color: "#808080"
radius: 3
height: 20
width: 44
anchors.right: parent.right
- visible: false
+ visible: copyButton && input.text !== "" ? true : false
Text {
id: copyButtonText
@@ -137,19 +129,19 @@ Item {
}
}
onEntered: {
- copyButton.color = "#707070";
+ copyButtonRect.color = "#707070";
copyButtonText.opacity = 0.8;
}
onExited: {
+ copyButtonRect.color = "#808080";
copyButtonText.opacity = 1.0;
- copyButton.color = "#808080";
}
}
}
Item{
id: inputItem
- height: 48 * scaleRatio
+ height: 40 * scaleRatio
anchors.top: inputLabel.bottom
anchors.topMargin: 6
width: parent.width
@@ -161,9 +153,9 @@ Item {
anchors.left: parent.left
anchors.leftMargin: inlineIcon.visible ? 50 : 10
opacity: 0.25
- color: "#FFFFFF"
+ color: Style.defaultFontColor
font.family: Style.fontRegular.name
- font.pixelSize: 20 * scaleRatio
+ font.pixelSize: 18 * scaleRatio
text: ""
z: 3
}
@@ -171,24 +163,29 @@ Item {
Rectangle {
anchors.fill: parent
anchors.topMargin: 1 * scaleRatio
- color: getColor(error)
- //radius: 4
+ color: "transparent"
}
Rectangle {
color: "transparent"
border.width: 1
- border.color: Qt.rgba(1, 1, 1, 0.25)
+ border.color: {
+ if(input.activeFocus){
+ return Qt.rgba(255, 255, 255, 0.35);
+ } else {
+ return Qt.rgba(255, 255, 255, 0.25);
+ }
+ }
radius: 4
anchors.fill: parent
}
Image {
id: inlineIcon
- width: 28 * scaleRatio
- height: 28 * scaleRatio
+ width: 26 * scaleRatio
+ height: 26 * scaleRatio
anchors.top: parent.top
- anchors.topMargin: 10 * scaleRatio
+ anchors.topMargin: 8 * scaleRatio
anchors.left: parent.left
anchors.leftMargin: 12 * scaleRatio
source: "../images/moneroIcon-28x28.png"
@@ -212,7 +209,7 @@ Item {
anchors.right: parent.right
anchors.rightMargin: 8
anchors.top: parent.top
- anchors.topMargin: 8
+ anchors.topMargin: 6
}
}
}