on xenial help sign in
tweaks

- fix cerntering of count emblem text - clip progress bar contents to be able to show values <10

commit4883e4110cffa86da826e795864410fe2c516367 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 20 Aug 2013, 12:52 (13 years ago) parenta5f6938
1 file changed+22−21
Launcher/LauncherDelegate.qml+22−21
Launcher/LauncherDelegate.qml+22−21
@@ -79,7 +79,7 @@ Item {
7979 left: parent.left
8080 top: parent.top
8181 }
82− width: Math.min(units.gu(7.5), Math.max(units.gu(3), countLabel.implicitWidth + units.gu(2)))
82+ width: Math.min(units.gu(7.5), Math.max(units.gu(3), countLabel.implicitWidth + units.gu(2.5)))
8383 height: units.gu(3)
8484 source: "graphics/notification.sci"
8585 visible: root.count > 0
@@ -87,12 +87,8 @@ Item {
8787 Label {
8888 id: countLabel
8989 text: root.count
90− anchors{
91− left: parent.left
92− right: parent.right
93− margins: units.gu(0.5)
94− verticalCenter: parent.verticalCenter
95− }
90+ anchors.centerIn: parent
91+ width: units.gu(6)
9692 horizontalAlignment: Text.AlignHCenter
9793 elide: Text.ElideRight
9894 color: "white"
@@ -101,32 +97,37 @@ Item {
10197 }
10298
10399 BorderImage {
100+ id: progressOverlay
104101 objectName: "progressOverlay"
105102 anchors {
106− left: parent.left
107− right: parent.right
108− bottom: parent.bottom
103+ left: iconItem.left
104+ right: iconItem.right
105+ bottom: iconItem.bottom
109106 leftMargin: units.gu(0.5)
110107 rightMargin: units.gu(0.5)
111108 bottomMargin: units.gu(1)
112109 }
113− height: units.gu(2)
110+ height: units.gu(1.5)
114111 visible: root.progress > -1
115112 source: "graphics/progressbar-trough.sci"
116113
117− // For fill calculation we need to remove the 3 units of border defined in .sci file
118− property int adjustedWidth: width - units.gu(3)
114+ // For fill calculation we need to remove the 2 units of border defined in .sci file
115+ property int adjustedWidth: width - units.gu(2)
119116
120− BorderImage {
117+ Item {
121118 anchors {
122− fill: parent
123− rightMargin: parent.adjustedWidth - (Math.min(100, root.progress) * parent.adjustedWidth / 100)
119+ fill: progressOverlay
120+ rightMargin: parent.adjustedWidth - (Math.min(100, root.progress) * parent.adjustedWidth / 100) + units.gu(1)
121+ }
122+ clip: true
123+
124+ BorderImage {
125+ anchors {
126+ fill: parent
127+ rightMargin: -parent.anchors.rightMargin
128+ }
129+ source: "graphics/progressbar-fill.sci"
124130 }
125− source: "graphics/progressbar-fill.sci"
126−
127− // Because of the borders in the borderimage we can't make it smaller than 10%
128− // Let's just fade in from 0 to 10% instead and then fill the bar.
129− opacity: root.progress / 10
130131 }
131132 }
132133 }