@@ -19,12 +19,13 @@
1919
2020import QtQuick 2.0
2121import Ubuntu.Components 0.1
22+import Ubuntu.Settings.Components 0.1
2223import Unity.Indicators 0.1 as Indicators
2324
2425Indicators.IndicatorBase {
2526 id: indicatorWidget
2627
27− property int iconSize: height
28+ property int iconSize: units.gu(2)
2829 property alias leftLabel: itemLeftLabel.text
2930 property alias rightLabel: itemRightLabel.text
3031 property var icons: undefined
@@ -34,7 +35,6 @@ Indicators.IndicatorBase {
3435
3536 Row {
3637 id: itemRow
37− width: childrenRect.width
3838 objectName: "itemRow"
3939 anchors {
4040 top: parent.top
@@ -44,7 +44,7 @@ Indicators.IndicatorBase {
4444
4545 Label {
4646 id: itemLeftLabel
47− width: guRoundUp(implicitWidth)
47+ width: contentWidth + units.gu(1)
4848 objectName: "leftLabel"
4949 color: Theme.palette.selected.backgroundText
5050 opacity: 0.8
@@ -52,10 +52,10 @@ Indicators.IndicatorBase {
5252 fontSize: "medium"
5353 anchors.verticalCenter: parent.verticalCenter
5454 visible: text != ""
55+ horizontalAlignment: Text.AlignHCenter
5556 }
5657
5758 Row {
58− width: childrenRect.width
5959 anchors {
6060 top: parent.top
6161 bottom: parent.bottom
@@ -65,22 +65,16 @@ Indicators.IndicatorBase {
6565 model: indicatorWidget.icons
6666
6767 Item {
68− width: guRoundUp(itemImage.width)
69− height: indicatorWidget.iconSize
68+ width: itemImage.width + units.gu(1)
69+ anchors { top: parent.top; bottom: parent.bottom }
7070
71− Image {
71+ StatusIcon {
7272 id: itemImage
73− objectName: "itemImage"
74− visible: source != ""
73+ height: indicatorWidget.iconSize
74+ anchors.centerIn: parent
7575 source: modelData
76− height: parent.height
77− anchors.horizontalCenter: parent.horizontalCenter
78− fillMode: Image.PreserveAspectFit
79−
80− sourceSize {
81− width: indicatorWidget.iconSize
82− height: indicatorWidget.iconSize
83− }
76+ sets: ["status", "actions"]
77+ color: "#CCCCCC"
8478 }
8579 }
8680 }
@@ -88,7 +82,7 @@ Indicators.IndicatorBase {
8882
8983 Label {
9084 id: itemRightLabel
91− width: guRoundUp(implicitWidth)
85+ width: contentWidth + units.gu(1)
9286 objectName: "rightLabel"
9387 color: Theme.palette.selected.backgroundText
9488 opacity: 0.8
@@ -96,20 +90,10 @@ Indicators.IndicatorBase {
9690 fontSize: "medium"
9791 anchors.verticalCenter: parent.verticalCenter
9892 visible: text != ""
93+ horizontalAlignment: Text.AlignHCenter
9994 }
10095 }
10196
102− // TODO: Use toolkit function https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1242575
103− function guRoundUp(width) {
104− if (width == 0) {
105− return 0;
106− }
107− var gu1 = units.gu(1.0);
108− var mod = (width % gu1);
109−
110− return mod == 0 ? width : width + (gu1 - mod);
111− }
112−
11397 onRootActionStateChanged: {
11498 if (rootActionState == undefined) {
11599 leftLabel = "";