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

List:       kde-commits
Subject:    [kde-workspace/KDE/4.8] plasma/generic/applets/devicenotifier/package/contents/ui: Reserve space
From:       Jacopo De Simoi <wilderkde () gmail ! com>
Date:       2012-08-26 11:33:03
Message-ID: 20120826113303.6DE83A6094 () git ! kde ! org
[Download RAW message or body]

Git commit 1707b49a320fa5837fafde1524ce5485e58bc56f by Jacopo De Simoi.
Committed on 26/08/2012 at 13:22.
Pushed by jacopods into branch 'KDE/4.8'.

Reserve space for text and free space bar

Reserve the height for the text and the
free space bar while invisible, to avoid jumpyness

BUG:291676
FIXED-IN:4.9.1

M  +31   -19   plasma/generic/applets/devicenotifier/package/contents/ui/DeviceItem.qml


http://commits.kde.org/kde-workspace/1707b49a320fa5837fafde1524ce5485e58bc56f

diff --git a/plasma/generic/applets/devicenotifier/package/contents/ui/DeviceItem.qml \
b/plasma/generic/applets/devicenotifier/package/contents/ui/DeviceItem.qml index \
                17d4d12..aea1cd0 100644
--- a/plasma/generic/applets/devicenotifier/package/contents/ui/DeviceItem.qml
+++ b/plasma/generic/applets/devicenotifier/package/contents/ui/DeviceItem.qml
@@ -122,32 +122,44 @@ Item {
                 height: paintedHeight
             }
 
-            PlasmaComponents.Label {
-                id: deviceStatus
+            Item {
+                width:deviceStatus.width
+                height:deviceStatus.height
+                PlasmaComponents.Label {
+                    id: deviceStatus
 
-                height: paintedHeight
-                // FIXME: state changes do not reach the plasmoid if the
-                // device was already attached when the plasmoid was
-                // initialized
-                text: deviceItem.state ==0 ? container.idleStatus() : \
(deviceItem.state==1 ? i18nc("Accessing is a less technical word for Mounting; \
translation should be short and mean \'Currently mounting this device\'", \
"Accessing...") : i18nc("Removing is a less technical word for Unmounting; \
translation shoud be short and mean \'Currently unmounting this device\'", \
                "Removing..."))
-                font.pointSize: theme.smallestFont.pointSize
-                color: "#99"+(theme.textColor.toString().substr(1))
-                opacity: container.containsMouse || expanded ? 1 : 0;
+                    height: paintedHeight
+                    // FIXME: state changes do not reach the plasmoid if the
+                    // device was already attached when the plasmoid was
+                    // initialized
+                    text: deviceItem.state ==0 ? container.idleStatus() : \
(deviceItem.state==1 ? i18nc("Accessing is a less technical word for Mounting; \
translation should be short and mean \'Currently mounting this device\'", \
"Accessing...") : i18nc("Removing is a less technical word for Unmounting; \
translation shoud be short and mean \'Currently unmounting this device\'", \
"Removing...")) +                    font.pointSize: theme.smallestFont.pointSize
+                    color: "#99"+(theme.textColor.toString().substr(1))
+                    opacity: container.containsMouse || expanded ? 1 : 0;
 
-                Behavior on opacity { NumberAnimation { duration: 150 } }
-            }
+                    Behavior on opacity { NumberAnimation { duration: 150 } }
+                    }
+               }
 
-            PlasmaComponents.ProgressBar {
-                id: freeSpaceBar
-                height: deviceStatus.height
+            Item {
+                height:freeSpaceBar.height
                 anchors {
                     left: parent.left
                     right: parent.right
                 }
-                opacity: mounted ? deviceStatus.opacity : 0
-                minimumValue: 0
-                maximumValue: 100
-                orientation: Qt.Horizontal
+                opacity: mounted ? 1 : 0
+                PlasmaComponents.ProgressBar {
+                    id: freeSpaceBar
+                    height: deviceStatus.height
+                    anchors {
+                        left: parent.left
+                        right: parent.right
+                    }
+                    opacity: mounted ? deviceStatus.opacity : 0
+                    minimumValue: 0
+                    maximumValue: 100
+                    orientation: Qt.Horizontal
+               }
             }
         }
 


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

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