on xenial help sign in
Properly remove DefaultIndicatorWidget.qml
commitd9862a90816c4630da4213148259216ad95d3e43 authorLars Uebernickel <lars.uebernickel@canonical.com> dateMon 17 Nov 2014, 14:30 (12 years ago) parent690f408
1 file changed−117
qml/Panel/Indicators/DefaultIndicatorWidget.qml.THIS−117
qml/Panel/Indicators/DefaultIndicatorWidget.qml.THISdeleted−117
@@ -1,117 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
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.
7− *
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.
12− *
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/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−
23−IndicatorBase {
24− id: indicatorWidget
25−
26− property int iconSize: units.gu(2)
27− property alias leftLabel: itemLeftLabel.text
28− property alias rightLabel: itemRightLabel.text
29− property var icons: undefined
30−
31− width: itemRow.width
32− enabled: false
33−
34− // FIXME: For now we will enable led indicator support only for messaging indicator
35− // in the future we should export a led API insted of doing that,
36− Loader {
37− id: indicatorLed
38− // only load source Component if the icons contains the new message icon
39− source: (indicatorWidget.icons && (String(indicatorWidget.icons).indexOf("indicator-messages-new") != -1)) ? Qt.resolvedUrl("IndicatorsLight.qml") : ""
40− }
41−
42− Row {
43− id: itemRow
44− objectName: "itemRow"
45− anchors {
46− top: parent.top
47− bottom: parent.bottom
48− horizontalCenter: parent.horizontalCenter
49− }
50−
51− Label {
52− id: itemLeftLabel
53− width: contentWidth + units.gu(1)
54− objectName: "leftLabel"
55− color: Theme.palette.selected.backgroundText
56− opacity: 0.8
57− font.family: "Ubuntu"
58− fontSize: "medium"
59− anchors.verticalCenter: parent.verticalCenter
60− visible: text != ""
61− horizontalAlignment: Text.AlignHCenter
62− }
63−
64− Row {
65− id: iconRow
66− anchors {
67− top: parent.top
68− bottom: parent.bottom
69− }
70−
71− Repeater {
72− model: indicatorWidget.icons
73−
74− Item {
75− width: itemImage.width + units.gu(1)
76− height: iconRow.height
77−
78− Icon {
79− id: itemImage
80− height: indicatorWidget.iconSize
81− anchors.centerIn: parent
82− source: modelData
83− color: "#CCCCCC"
84− }
85− }
86− }
87− }
88−
89− Label {
90− id: itemRightLabel
91− width: contentWidth + units.gu(1)
92− objectName: "rightLabel"
93− color: Theme.palette.selected.backgroundText
94− opacity: 0.8
95− font.family: "Ubuntu"
96− fontSize: "medium"
97− anchors.verticalCenter: parent.verticalCenter
98− visible: text != ""
99− horizontalAlignment: Text.AlignHCenter
100− }
101− }
102−
103− onRootActionStateChanged: {
104− if (rootActionState == undefined) {
105− leftLabel = "";
106− rightLabel = "";
107− icons = undefined;
108− enabled = false;
109− return;
110− }
111−
112− leftLabel = rootActionState.leftLabel ? rootActionState.leftLabel : "";
113− rightLabel = rootActionState.rightLabel ? rootActionState.rightLabel : "";
114− icons = rootActionState.icons;
115− enabled = rootActionState.visible;
116− }
117−}