on xenial help sign in
name changes
4d6bd0bNick Dedekind
qml/Panel/IndicatorItem.qml → qml/Panel/Indicators/IndicatorItem.qmlrenamed−1
@@ -18,7 +18,6 @@ import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Ubuntu.Settings.Components 0.1
19import Ubuntu.Settings.Components 0.1
20import QMenuModel 0.1
20import QMenuModel 0.1
21−import "Indicators"
22
21
23IndicatorDelegate {
22IndicatorDelegate {
24 id: root
23 id: root
qml/Panel/Panel.qml+2−2
@@ -197,7 +197,7 @@ Item {
197 }
197 }
198 }
198 }
199
199
200− pageDelegate: IndicatorPage {
200+ pageDelegate: PanelMenuPage {
201 id: page
201 id: page
202 context: "application-menu"
202 context: "application-menu"
203 menuModel: __applicationMenus.model
203 menuModel: __applicationMenus.model
@@ -442,7 +442,7 @@ Item {
442 Behavior on width { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
442 Behavior on width { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
443 }
443 }
444
444
445− pageDelegate: IndicatorPage {
445+ pageDelegate: PanelMenuPage {
446 id: page
446 id: page
447 objectName: context + "-page"
447 objectName: context + "-page"
448 context: modelData.identifier
448 context: modelData.identifier
qml/Panel/PanelBar.qml+1−1
@@ -32,7 +32,7 @@ Item {
32
32
33 property alias showRowTitle: row.showRowTitle
33 property alias showRowTitle: row.showRowTitle
34 property alias rowTitle: row.rowTitle
34 property alias rowTitle: row.rowTitle
35− property alias rowItemDelegate: row.itemDelegate
35+ property alias rowItemDelegate: row.delegate
36
36
37 implicitWidth: flickable.contentWidth
37 implicitWidth: flickable.contentWidth
38
38
qml/Panel/PanelItemRow.qml+1−1
@@ -36,7 +36,7 @@ Item {
36 property bool enableLateralChanges: false
36 property bool enableLateralChanges: false
37 property color hightlightColor: "#ffffff"
37 property color hightlightColor: "#ffffff"
38
38
39− property alias itemDelegate: row.delegate
39+ property alias delegate: row.delegate
40
40
41 property real lateralPosition: -1
41 property real lateralPosition: -1
42 onLateralPositionChanged: {
42 onLateralPositionChanged: {
qml/Panel/IndicatorPage.qml → qml/Panel/PanelMenuPage.qmlrenamed

The content is the same.

tests/qmltests/CMakeLists.txt+5−5
@@ -78,13 +78,13 @@ add_unity8_qmltest(Notifications VisualSnapDecisionsQueue)
78add_unity8_qmltest(Notifications OptionToggle)
78add_unity8_qmltest(Notifications OptionToggle)
79add_unity8_qmltest(Notifications SwipeToAct)
79add_unity8_qmltest(Notifications SwipeToAct)
80add_unity8_qmltest(Panel ActiveCallHint)
80add_unity8_qmltest(Panel ActiveCallHint)
81−add_unity8_qmltest(Panel IndicatorItem)
81+add_unity8_qmltest(Panel PanelItemRow)
82−add_unity8_qmltest(Panel IndicatorItemRow)
83−add_unity8_qmltest(Panel IndicatorPage)
82+add_unity8_qmltest(Panel PanelMenuPage)
84−add_unity8_qmltest(Panel IndicatorsBar)
83+add_unity8_qmltest(Panel PanelBar)
85−add_unity8_qmltest(Panel IndicatorsMenu)
84+add_unity8_qmltest(Panel PanelMenu)
86add_unity8_qmltest(Panel MenuContent)
85add_unity8_qmltest(Panel MenuContent)
87add_unity8_qmltest(Panel Panel)
86add_unity8_qmltest(Panel Panel)
87+add_unity8_qmltest(Panel/Indicators IndicatorItem)
88add_unity8_qmltest(Panel/Indicators IndicatorsLight)
88add_unity8_qmltest(Panel/Indicators IndicatorsLight)
89add_unity8_qmltest(Panel/Indicators MenuItemFactory)
89add_unity8_qmltest(Panel/Indicators MenuItemFactory)
90add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
90add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
tests/qmltests/Panel/tst_IndicatorItem.qml → tests/qmltests/Panel/Indicators/tst_IndicatorItem.qmlrenamed+1−1
@@ -19,7 +19,7 @@ import QtQuick.Layouts 1.1
19import QtTest 1.0
19import QtTest 1.0
20import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
21import Unity.Test 0.1 as UT
21import Unity.Test 0.1 as UT
22−import "../../../qml/Panel"
22+import "../../../../qml/Panel/Indicators"
23
23
24Rectangle {
24Rectangle {
25 width: units.gu(80)
25 width: units.gu(80)
tests/qmltests/Panel/IndicatorTest.qml → tests/qmltests/Panel/PanelTest.qmlrenamed

The content is the same.

tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -20,7 +20,7 @@ import Unity.Test 0.1 as UT
20import "../../../qml/Panel"
20import "../../../qml/Panel"
21import Unity.Indicators 0.1 as Indicators
21import Unity.Indicators 0.1 as Indicators
22
22
23−IndicatorTest {
23+PanelTest {
24 id: root
24 id: root
25 width: units.gu(40)
25 width: units.gu(40)
26 height: units.gu(70)
26 height: units.gu(70)
tests/qmltests/Panel/tst_Panel.qml+24−1
@@ -28,7 +28,7 @@ import "../../../qml/Panel"
28import "../../../qml/Components/PanelState"
28import "../../../qml/Components/PanelState"
29import "../Stages"
29import "../Stages"
30
30
31−IndicatorTest {
31+PanelTest {
32 id: root
32 id: root
33 width: units.gu(120)
33 width: units.gu(120)
34 height: units.gu(71)
34 height: units.gu(71)
@@ -568,5 +568,28 @@ IndicatorTest {
568 compare(windowControlButtonsSpy.count, 1);
568 compare(windowControlButtonsSpy.count, 1);
569 PanelState.buttonsVisible = buttonsVisible;
569 PanelState.buttonsVisible = buttonsVisible;
570 }
570 }
571+
572+ function test_hidingKeyboardIndicator_data() {
573+ return [
574+ { tag: "No keyboard, no keymap", keyboard: false, keymaps: [], hidden: true },
575+ { tag: "No keyboard, one keymap", keyboard: false, keymaps: ["us"], hidden: true },
576+ { tag: "No keyboard, 2 keymaps", keyboard: false, keymaps: ["us", "cs"], hidden: true },
577+ { tag: "Keyboard, no keymap", keyboard: true, keymaps: [], hidden: true },
578+ { tag: "Keyboard, one keymap", keyboard: true, keymaps: ["us"], hidden: true },
579+ { tag: "Keyboard, 2 keymaps", keyboard: true, keymaps: ["us", "cs"], hidden: false }
580+ ];
581+ }
582+
583+ function test_hidingKeyboardIndicator(data) {
584+ var item = findChild(indicatorsRow, "indicator-keyboard-panelItem");
585+ AccountsService.keymaps = data.keymaps;
586+ if (data.keyboard) {
587+ MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
588+ } else {
589+ MockInputDeviceBackend.removeDevice("/indicator_kbd0");
590+ }
591+
592+ compare(item.hidden, data.hidden);
593+ }
571 }
594 }
572}
595}
tests/qmltests/Panel/tst_IndicatorsBar.qml → tests/qmltests/Panel/tst_PanelBar.qmlrenamed

The content is the same.

tests/qmltests/Panel/tst_IndicatorItemRow.qml → tests/qmltests/Panel/tst_PanelItemRow.qmlrenamed+20−28
@@ -17,14 +17,14 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
18import QtQuick.Layouts 1.1
19import QtTest 1.0
19import QtTest 1.0
20−import "../../../qml/Panel"
21import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
22import Unity.Test 0.1 as UT
21import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
24import AccountsService 0.1
22import AccountsService 0.1
25import Unity.InputInfo 0.1
23import Unity.InputInfo 0.1
24+import "../../../qml/Panel"
25+import "../../../qml/Panel/Indicators"
26
26
27−IndicatorTest {
27+PanelTest {
28 id: root
28 id: root
29 width: units.gu(120)
29 width: units.gu(120)
30 height: units.gu(40)
30 height: units.gu(40)
@@ -45,7 +45,7 @@ IndicatorTest {
45 anchors.fill: indicatorsRow
45 anchors.fill: indicatorsRow
46 }
46 }
47
47
48− IndicatorItemRow {
48+ PanelItemRow {
49 id: indicatorsRow
49 id: indicatorsRow
50 height: expanded ? units.gu(7) : units.gu(3)
50 height: expanded ? units.gu(7) : units.gu(3)
51 anchors.centerIn: parent
51 anchors.centerIn: parent
@@ -59,6 +59,16 @@ IndicatorTest {
59 }
59 }
60 }
60 }
61
61
62+ delegate: IndicatorItem {
63+ property int ownIndex: index
64+ property string identifier: model.identifier
65+
66+ objectName: identifier + "-panelItem"
67+ width: units.gu(3)
68+ height: units.gu(3)
69+ icons: [ "image://theme/settings" ]
70+ }
71+
62 MouseArea {
72 MouseArea {
63 id: ma
73 id: ma
64 anchors.fill: parent
74 anchors.fill: parent
@@ -165,8 +175,13 @@ IndicatorTest {
165 // test removals
175 // test removals
166 for (i = 0; i < root.originalModelData.length; i++) {
176 for (i = 0; i < root.originalModelData.length; i++) {
167 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
177 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
178+ console.log(item, i, root.originalModelData[i]["identifier"])
168
179
169− verify(data.remove.indexOf(i) !== -1 ? (item === null) : (item !== null));
180+ if (data.remove.indexOf(i) !== -1) {
181+ verify(item === null, "removed item should not be present");
182+ } else {
183+ verify(item === null, "items not removed item should still be present");
184+ }
170 }
185 }
171
186
172 // test insertion
187 // test insertion
@@ -287,28 +302,5 @@ IndicatorTest {
287 // should go back to 0
302 // should go back to 0
288 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
303 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
289 }
304 }
290−
291− function test_hidingKeyboardIndicator_data() {
292− return [
293− { tag: "No keyboard, no keymap", keyboard: false, keymaps: [], hidden: true },
294− { tag: "No keyboard, one keymap", keyboard: false, keymaps: ["us"], hidden: true },
295− { tag: "No keyboard, 2 keymaps", keyboard: false, keymaps: ["us", "cs"], hidden: true },
296− { tag: "Keyboard, no keymap", keyboard: true, keymaps: [], hidden: true },
297− { tag: "Keyboard, one keymap", keyboard: true, keymaps: ["us"], hidden: true },
298− { tag: "Keyboard, 2 keymaps", keyboard: true, keymaps: ["us", "cs"], hidden: false }
299− ];
300− }
301−
302− function test_hidingKeyboardIndicator(data) {
303− var item = findChild(indicatorsRow, "indicator-keyboard-panelItem");
304− AccountsService.keymaps = data.keymaps;
305− if (data.keyboard) {
306− MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
307− } else {
308− MockInputDeviceBackend.removeDevice("/indicator_kbd0");
309− }
310−
311− compare(item.hidden, data.hidden);
312− }
313 }
305 }
314}
306}
tests/qmltests/Panel/tst_IndicatorsMenu.qml → tests/qmltests/Panel/tst_PanelMenu.qmlrenamed+2−3
@@ -20,9 +20,8 @@ import QtTest 1.0
20import "../../../qml/Panel"
20import "../../../qml/Panel"
21import Ubuntu.Components 1.3
21import Ubuntu.Components 1.3
22import Unity.Test 0.1 as UT
22import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
24
23
25−IndicatorTest {
24+PanelTest {
26 id: root
25 id: root
27 width: units.gu(80)
26 width: units.gu(80)
28 height: units.gu(71)
27 height: units.gu(71)
@@ -48,7 +47,7 @@ IndicatorTest {
48 id: itemArea
47 id: itemArea
49 color: "blue"
48 color: "blue"
50
49
51− IndicatorsMenu {
50+ PanelMenu {
52 id: indicatorsMenu
51 id: indicatorsMenu
53 width: units.gu(40)
52 width: units.gu(40)
54 anchors {
53 anchors {
tests/qmltests/Panel/tst_IndicatorPage.qml → tests/qmltests/Panel/tst_PanelMenuPage.qmlrenamed

The content is the same.