2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Nick Dedekind <nick.dedekind@canonical.com>
21
import Ubuntu.Components 0.1
22
import Ubuntu.Settings.Components 0.1
27
property int iconSize: units.gu(2)
28
property alias leftLabel: itemLeftLabel.text
29
property alias rightLabel: itemRightLabel.text
30
property var icons: undefined
35
// FIXME: For now we will enable led indicator support only for messaging indicator
36
// in the future we should export a led API insted of doing that,
39
// only load source Component if the icons contains the new message icon
40
source: (indicatorWidget.icons && (String(indicatorWidget.icons).indexOf("indicator-messages-new") != -1)) ? Qt.resolvedUrl("IndicatorsLight.qml") : ""
49
horizontalCenter: parent.horizontalCenter
54
width: contentWidth + units.gu(1)
55
objectName: "leftLabel"
56
color: Theme.palette.selected.backgroundText
60
anchors.verticalCenter: parent.verticalCenter
62
horizontalAlignment: Text.AlignHCenter
73
model: indicatorWidget.icons
76
width: itemImage.width + units.gu(1)
77
height: iconRow.height
81
height: indicatorWidget.iconSize
82
anchors.centerIn: parent
84
sets: ["status", "actions"]
93
width: contentWidth + units.gu(1)
94
objectName: "rightLabel"
95
color: Theme.palette.selected.backgroundText
99
anchors.verticalCenter: parent.verticalCenter
101
horizontalAlignment: Text.AlignHCenter
105
onRootActionStateChanged: {
106
if (rootActionState == undefined) {
114
leftLabel = rootActionState.leftLabel ? rootActionState.leftLabel : "";
115
rightLabel = rootActionState.rightLabel ? rootActionState.rightLabel : "";
116
if (icons !== rootActionState.icons) // don't reset visual unless we need to
117
icons = rootActionState.icons;
118
enabled = rootActionState.visible;