on xenial help sign in
name changes
commit4d6bd0b145453b9acec453c46f8836c715a0c5f0 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 30 Sep 2016, 12:08 (10 years ago) parent720fb76
14 files changed+57−44
qml/Panel/IndicatorItem.qml → qml/Panel/Indicators/IndicatorItem.qml−1 qml/Panel/Panel.qml+2−2 qml/Panel/PanelBar.qml+1−1 qml/Panel/PanelItemRow.qml+1−1 qml/Panel/IndicatorPage.qml → qml/Panel/PanelMenuPage.qml tests/qmltests/CMakeLists.txt+5−5 tests/qmltests/Panel/tst_IndicatorItem.qml → tests/qmltests/Panel/Indicators/tst_IndicatorItem.qml+1−1 tests/qmltests/Panel/IndicatorTest.qml → tests/qmltests/Panel/PanelTest.qml tests/qmltests/Panel/tst_MenuContent.qml+1−1 tests/qmltests/Panel/tst_Panel.qml+24−1 tests/qmltests/Panel/tst_IndicatorsBar.qml → tests/qmltests/Panel/tst_PanelBar.qml tests/qmltests/Panel/tst_IndicatorItemRow.qml → tests/qmltests/Panel/tst_PanelItemRow.qml+20−28 tests/qmltests/Panel/tst_IndicatorsMenu.qml → tests/qmltests/Panel/tst_PanelMenu.qml+2−3 tests/qmltests/Panel/tst_IndicatorPage.qml → tests/qmltests/Panel/tst_PanelMenuPage.qml
qml/Panel/IndicatorItem.qml → qml/Panel/Indicators/IndicatorItem.qmlrenamed−1
@@ -18,7 +18,6 @@ import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import Ubuntu.Settings.Components 0.1
2020import QMenuModel 0.1
21−import "Indicators"
2221
2322IndicatorDelegate {
2423 id: root
qml/Panel/Panel.qml+2−2
@@ -197,7 +197,7 @@ Item {
197197 }
198198 }
199199
200− pageDelegate: IndicatorPage {
200+ pageDelegate: PanelMenuPage {
201201 id: page
202202 context: "application-menu"
203203 menuModel: __applicationMenus.model
@@ -442,7 +442,7 @@ Item {
442442 Behavior on width { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
443443 }
444444
445− pageDelegate: IndicatorPage {
445+ pageDelegate: PanelMenuPage {
446446 id: page
447447 objectName: context + "-page"
448448 context: modelData.identifier
qml/Panel/PanelBar.qml+1−1
@@ -32,7 +32,7 @@ Item {
3232
3333 property alias showRowTitle: row.showRowTitle
3434 property alias rowTitle: row.rowTitle
35− property alias rowItemDelegate: row.itemDelegate
35+ property alias rowItemDelegate: row.delegate
3636
3737 implicitWidth: flickable.contentWidth
3838
qml/Panel/PanelItemRow.qml+1−1
@@ -36,7 +36,7 @@ Item {
3636 property bool enableLateralChanges: false
3737 property color hightlightColor: "#ffffff"
3838
39− property alias itemDelegate: row.delegate
39+ property alias delegate: row.delegate
4040
4141 property real lateralPosition: -1
4242 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)
7878add_unity8_qmltest(Notifications OptionToggle)
7979add_unity8_qmltest(Notifications SwipeToAct)
8080add_unity8_qmltest(Panel ActiveCallHint)
81−add_unity8_qmltest(Panel IndicatorItem)
82−add_unity8_qmltest(Panel IndicatorItemRow)
83−add_unity8_qmltest(Panel IndicatorPage)
84−add_unity8_qmltest(Panel IndicatorsBar)
85−add_unity8_qmltest(Panel IndicatorsMenu)
81+add_unity8_qmltest(Panel PanelItemRow)
82+add_unity8_qmltest(Panel PanelMenuPage)
83+add_unity8_qmltest(Panel PanelBar)
84+add_unity8_qmltest(Panel PanelMenu)
8685add_unity8_qmltest(Panel MenuContent)
8786add_unity8_qmltest(Panel Panel)
87+add_unity8_qmltest(Panel/Indicators IndicatorItem)
8888add_unity8_qmltest(Panel/Indicators IndicatorsLight)
8989add_unity8_qmltest(Panel/Indicators MenuItemFactory)
9090add_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
1919import QtTest 1.0
2020import Ubuntu.Components 1.3
2121import Unity.Test 0.1 as UT
22−import "../../../qml/Panel"
22+import "../../../../qml/Panel/Indicators"
2323
2424Rectangle {
2525 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
2020import "../../../qml/Panel"
2121import Unity.Indicators 0.1 as Indicators
2222
23−IndicatorTest {
23+PanelTest {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(70)
tests/qmltests/Panel/tst_Panel.qml+24−1
@@ -28,7 +28,7 @@ import "../../../qml/Panel"
2828import "../../../qml/Components/PanelState"
2929import "../Stages"
3030
31−IndicatorTest {
31+PanelTest {
3232 id: root
3333 width: units.gu(120)
3434 height: units.gu(71)
@@ -568,5 +568,28 @@ IndicatorTest {
568568 compare(windowControlButtonsSpy.count, 1);
569569 PanelState.buttonsVisible = buttonsVisible;
570570 }
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+ }
571594 }
572595}
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 @@
1717import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
20−import "../../../qml/Panel"
2120import Ubuntu.Components 1.3
2221import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
2422import AccountsService 0.1
2523import Unity.InputInfo 0.1
24+import "../../../qml/Panel"
25+import "../../../qml/Panel/Indicators"
2626
27−IndicatorTest {
27+PanelTest {
2828 id: root
2929 width: units.gu(120)
3030 height: units.gu(40)
@@ -45,7 +45,7 @@ IndicatorTest {
4545 anchors.fill: indicatorsRow
4646 }
4747
48− IndicatorItemRow {
48+ PanelItemRow {
4949 id: indicatorsRow
5050 height: expanded ? units.gu(7) : units.gu(3)
5151 anchors.centerIn: parent
@@ -59,6 +59,16 @@ IndicatorTest {
5959 }
6060 }
6161
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+
6272 MouseArea {
6373 id: ma
6474 anchors.fill: parent
@@ -165,8 +175,13 @@ IndicatorTest {
165175 // test removals
166176 for (i = 0; i < root.originalModelData.length; i++) {
167177 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
178+ console.log(item, i, root.originalModelData[i]["identifier"])
168179
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+ }
170185 }
171186
172187 // test insertion
@@ -287,28 +302,5 @@ IndicatorTest {
287302 // should go back to 0
288303 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
289304 }
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− }
313305 }
314306}
tests/qmltests/Panel/tst_IndicatorsMenu.qml → tests/qmltests/Panel/tst_PanelMenu.qmlrenamed+2−3
@@ -20,9 +20,8 @@ import QtTest 1.0
2020import "../../../qml/Panel"
2121import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
2423
25−IndicatorTest {
24+PanelTest {
2625 id: root
2726 width: units.gu(80)
2827 height: units.gu(71)
@@ -48,7 +47,7 @@ IndicatorTest {
4847 id: itemArea
4948 color: "blue"
5049
51− IndicatorsMenu {
50+ PanelMenu {
5251 id: indicatorsMenu
5352 width: units.gu(40)
5453 anchors {
tests/qmltests/Panel/tst_IndicatorPage.qml → tests/qmltests/Panel/tst_PanelMenuPage.qmlrenamed

The content is the same.