aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorSander Ferdinand <sa.ferdinand@gmail.com>2017-11-23 19:29:25 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-29 23:04:01 +0100
commit36ac2ee86dd159ce5c78381104cef1401377dcfe (patch)
treecc17c5662604109636f9723e57d28bdbb9e691df /components
parent63132dc1db02b099de32ea494696aee5f61e0d1d (diff)
downloadmonzero-gui-36ac2ee86dd159ce5c78381104cef1401377dcfe.tar.gz
monzero-gui-36ac2ee86dd159ce5c78381104cef1401377dcfe.tar.xz
monzero-gui-36ac2ee86dd159ce5c78381104cef1401377dcfe.zip
Inline button/icon for input boxes
Diffstat (limited to 'components')
-rw-r--r--components/InlineButton.qml4
-rw-r--r--components/Input.qml3
-rw-r--r--components/LineEdit.qml24
3 files changed, 26 insertions, 5 deletions
diff --git a/components/InlineButton.qml b/components/InlineButton.qml
index 9ba7f716..da8120c3 100644
--- a/components/InlineButton.qml
+++ b/components/InlineButton.qml
@@ -47,7 +47,9 @@ Item {
anchors.rightMargin: 8
anchors.topMargin: 8
- function onClicked(){}
+ function onClicked(){
+ console.log("debug click");
+ }
function doClick() {
// Android workaround
diff --git a/components/Input.qml b/components/Input.qml
index a660ca84..b7e39eb2 100644
--- a/components/Input.qml
+++ b/components/Input.qml
@@ -39,8 +39,5 @@ TextField {
background: Rectangle {
color: "transparent"
- border.width: 1
- border.color: Qt.rgba(1, 1, 1, 0.25)
- radius: 4
}
}
diff --git a/components/LineEdit.qml b/components/LineEdit.qml
index 8e9e353e..964af52f 100644
--- a/components/LineEdit.qml
+++ b/components/LineEdit.qml
@@ -38,6 +38,7 @@ Item {
property alias cursorPosition: input.cursorPosition
property alias echoMode: input.echoMode
property alias inlineButtonText: inlineButtonId.text
+ property alias inlineIcon: inlineIcon.visible
property int fontSize: 18 * scaleRatio
property bool showBorder: true
property bool error: false
@@ -78,7 +79,7 @@ Item {
id: placeholderLabel
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
- anchors.leftMargin: 10
+ anchors.leftMargin: inlineIcon.visible ? 50 : 10
opacity: 0.25
font.family: Style.fontRegular.name
font.pixelSize: 20 * scaleRatio
@@ -95,9 +96,30 @@ Item {
//radius: 4
}
+ Rectangle {
+ color: "transparent"
+ border.width: 1
+ border.color: Qt.rgba(1, 1, 1, 0.25)
+ radius: 4
+ anchors.fill: parent
+ }
+
+ Image {
+ id: inlineIcon
+ width: 28 * scaleRatio
+ height: 28 * scaleRatio
+ anchors.top: parent.top
+ anchors.topMargin: 10 * scaleRatio
+ anchors.left: parent.left
+ anchors.leftMargin: 12 * scaleRatio
+ source: "../images/moneroIcon-28x28.png"
+ visible: false
+ }
+
Input {
id: input
anchors.fill: parent
+ anchors.leftMargin: inlineIcon.visible ? 38 : 0
font.pixelSize: parent.fontSize
onEditingFinished: item.editingFinished()
onAccepted: item.accepted();