Characters left count fixes
authorSami Rämö <sami.ramo@ixonos.com>
Mon, 22 Nov 2010 15:11:46 +0000 (17:11 +0200)
committerSami Rämö <sami.ramo@ixonos.com>
Mon, 22 Nov 2010 15:11:46 +0000 (17:11 +0200)
src/qmlui/DetailEditorRow.qml

index 4d09241..640f997 100644 (file)
@@ -11,29 +11,38 @@ Item {
     anchors.right: parent.right
     width: parent.width
 //    height: messageEditor.height > image.height ? messageEditor.height : image.height
-    height: messageEditor.height
-
-    Image {
-        id: image
-        anchors { left: parent.left; top: parent.top }
-    }
+    height: charactersLeftRect.height + textEditRow.height
 
     Rectangle {
         id: charactersLeftRect
-        height: childrenRect.height
-        width: childrenRect.width
+        height: charactersLeft.height
+        width: charactersLeft.width
         anchors.top: parent.top
         anchors.horizontalCenter: messageEditorRect.horizontalCenter
+        border { color: "black"; width: 1 }
         color: "white"
+        radius: 5
         opacity: 0
+        Behavior on opacity { NumberAnimation { duration: animationDuration } }
+    }
 
+    Text {
+        id: charactersLeft
+        anchors.centerIn: charactersLeftRect
+        font.pixelSize: 14
+        opacity: 0
         Behavior on opacity { NumberAnimation { duration: animationDuration } }
+    }
 
-        Text {
-            id: charactersLeft
-            anchors.centerIn: parent
-            font.pixelSize: 14
-        }
+    Item {
+        id:textEditRow
+        anchors { left: parent.left; top: charactersLeftRect.bottom; topMargin: 2; right: parent.right }
+        height: messageEditor.height
+    }
+
+    Image {
+        id: image
+        anchors { left: parent.left; top: textEditRow.top }
     }
 
     Rectangle {
@@ -49,7 +58,7 @@ Item {
 
     ExtendedTextEdit {
         id: messageEditor
-        anchors { leftMargin: 5; left: image.right; right: buttonsArea.left; rightMargin: 5; top: parent.top }
+        anchors { leftMargin: 5; left: image.right; right: buttonsArea.left; rightMargin: 5; top: textEditRow.top }
         height: paintedHeight > buttonsArea.height ? paintedHeight : buttonsArea.height
         onActiveFocusChanged: {
             if (activeFocus)
@@ -91,10 +100,10 @@ Item {
     Item {
         id: buttonsArea
         anchors {
-            top: parent.top
+            top: textEditRow.top
             right: cancelButton.right
             left: cancelButton.right
-            bottom: parent.top
+            bottom: textEditRow.top
         }
     }
 
@@ -118,7 +127,10 @@ Item {
                 target: charactersLeftRect
                 opacity: 0.3
             }
-
+            PropertyChanges {
+                target: charactersLeft
+                opacity: 0.8
+            }
             PropertyChanges {
                 target: cancelButton
                 scale: 1
@@ -126,11 +138,7 @@ Item {
             AnchorChanges {
                 target: buttonsArea
                 anchors.left: cancelButton.left
-                anchors.bottom: cancelButton.bottom
-            }
-            AnchorChanges {
-                target: messageEditor
-                anchors.top: charactersLeftRect.bottom
+                anchors.bottom: textEditRow.bottom
             }
         }
     ]
@@ -145,7 +153,6 @@ Item {
                 ParallelAnimation {
                     NumberAnimation { target: cancelButton; properties: "scale"; duration: animationDuration }
                     AnchorAnimation { targets: buttonsArea; duration: animationDuration }
-                    AnchorAnimation { targets: charactersLeft; duration: animationDuration }
                     NumberAnimation { target: messageEditor; properties: "height"; duration: animationDuration }
                 }
             }