[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [abakus] src/mobile/harmattan/qml: show clear button only, if there is text entered
From:       Mathias Kraus <k.hias () gmx ! de>
Date:       2013-12-08 16:46:39
Message-ID: E1VphV9-0007Zf-P7 () scm ! kde ! org
[Download RAW message or body]

Git commit e673bcc7ce67f19cdbafb469f30dec4236e51c17 by Mathias Kraus.
Committed on 08/12/2013 at 16:45.
Pushed by mkraus into branch 'master'.

show clear button only, if there is text entered

M  +5    -4    src/mobile/harmattan/qml/Editor.qml

http://commits.kde.org/abakus/e673bcc7ce67f19cdbafb469f30dec4236e51c17

diff --git a/src/mobile/harmattan/qml/Editor.qml b/src/mobile/harmattan/qml/Editor.qml
index f6a2773..abc567a 100644
--- a/src/mobile/harmattan/qml/Editor.qml
+++ b/src/mobile/harmattan/qml/Editor.qml
@@ -85,7 +85,7 @@ Rectangle {
     }
 
     Text {
-        id: dummy
+        id: clearButtonText
         visible: false
         font.pointSize: root.fontPointSize
         text: "⌫"
@@ -93,8 +93,8 @@ Rectangle {
 
     Button {
         id: clearButton
-        width: dummy.width
-        height: dummy.height
+        width: clearButtonText.width
+        height: clearButtonText.height
         anchors.right: parent.right
         anchors.rightMargin: 10
         anchors.verticalCenter: parent.verticalCenter
@@ -102,7 +102,8 @@ Rectangle {
         textColorHighlight: "white"
         buttonColorHighlight: buttonColor
         fontPointSize: root.fontPointSize
-        text: "⌫"
+        text: clearButtonText.text
+        visible: editor.text.length != 0
 
         onPressed: removeText()
         onPressAndHold: editor.text = ""
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic