on xenial help sign in
Add 1GU margins, 1GU spacing in indicators and use Icon to colourize them.
commit433558b020556229f8cb75ad4a72df440b95930d authorMichał Sawicz <michal.sawicz@canonical.com> dateMon 24 Feb 2014, 18:49 (13 years ago) parent7eecbc6
2 files changed+14−17
qml/Panel/Indicators/DefaultIndicatorWidget.qml+12−16 qml/Panel/Panel.qml+2−1
qml/Panel/Indicators/DefaultIndicatorWidget.qml+12−16
@@ -24,7 +24,7 @@ import Unity.Indicators 0.1 as Indicators
2424Indicators.IndicatorBase {
2525 id: indicatorWidget
2626
27− property int iconSize: height
27+ property int iconSize: units.gu(2)
2828 property alias leftLabel: itemLeftLabel.text
2929 property alias rightLabel: itemRightLabel.text
3030 property var icons: undefined
@@ -34,7 +34,6 @@ Indicators.IndicatorBase {
3434
3535 Row {
3636 id: itemRow
37− width: childrenRect.width
3837 objectName: "itemRow"
3938 anchors {
4039 top: parent.top
@@ -55,7 +54,6 @@ Indicators.IndicatorBase {
5554 }
5655
5756 Row {
58− width: childrenRect.width
5957 anchors {
6058 top: parent.top
6159 bottom: parent.bottom
@@ -65,22 +63,20 @@ Indicators.IndicatorBase {
6563 model: indicatorWidget.icons
6664
6765 Item {
68− width: guRoundUp(itemImage.width)
69− height: indicatorWidget.iconSize
66+ width: guRoundUp(itemImage.width) + units.gu(1)
67+ anchors { top: parent.top; bottom: parent.bottom }
7068
71− Image {
69+ Icon {
7270 id: itemImage
7371 objectName: "itemImage"
74− visible: source != ""
75− 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− }
72+ // FIXME: Should be dynamic width, see http://pad.lv/1284235
73+ width: indicatorWidget.iconSize
74+ height: indicatorWidget.iconSize
75+ anchors.centerIn: parent
76+
77+ // FIXME: Icon needs to accept source, see http://pad.lv/1284233
78+ name: modelData.replace("image://theme/", "")
79+ color: "#CCCCCC"
8480 }
8581 }
8682 }
qml/Panel/Panel.qml+2−1
@@ -21,7 +21,7 @@ import "../Components"
2121Item {
2222 id: root
2323 readonly property real panelHeight: units.gu(3) + units.dp(2)
24− property real indicatorsMenuWidth: (shell.width > units.gu(60)) ? units.gu(40) : shell.width
24+ property real indicatorsMenuWidth: (shell.width > units.gu(60)) ? units.gu(38) : shell.width - units.gu(2)
2525 property alias indicators: indicatorsMenu
2626 property bool fullscreenMode: false
2727 property bool searchVisible: true
@@ -98,6 +98,7 @@ Item {
9898 objectName: "indicators"
9999
100100 anchors.right: parent.right
101+ anchors.rightMargin: units.gu(1)
101102 y: panelBackground.y
102103 width: root.indicatorsMenuWidth
103104 shown: false