on xenial help sign in
fix showing hiding the indicator icon and some failing tests
commitd7a2d01aa2f70d3cd42eb5e878a615b58e923792 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 17 Feb 2017, 18:08 (10 years ago) parentbd7cff3
3 files changed+7−9
qml/Panel/Panel.qml+3−5 tests/qmltests/Panel/tst_Panel.qml+4−2 tests/qmltests/tst_OrientedShell.qml−2
qml/Panel/Panel.qml+3−5
@@ -23,8 +23,6 @@ import Utils 0.1
2323import Unity.ApplicationMenu 0.1
2424
2525import QtQuick.Window 2.2
26−// for indicator-keyboard
27−import AccountsService 0.1
2826
2927import "../ApplicationMenus"
3028import "../Components"
@@ -335,12 +333,12 @@ Item {
335333 objectName: identifier+"-panelItem"
336334
337335 property int ownIndex: index
338− property bool overflow: parent.width - x > __indicators.overFlowWidth
339− property bool hidden: !expanded && (overflow || !indicatorVisible || hideSessionIndicator || hideKeyboardIndicator)
336+ readonly property bool overflow: parent.width - x > __indicators.overFlowWidth
337+ readonly property bool hidden: !expanded && (overflow || !indicatorVisible || hideSessionIndicator || hideKeyboardIndicator)
340338 // HACK for indicator-session
341339 readonly property bool hideSessionIndicator: identifier == "indicator-session" && Math.min(Screen.width, Screen.height) <= units.gu(60)
342340 // HACK for indicator-keyboard
343− readonly property bool hideKeyboardIndicator: identifier == "indicator-keyboard" && AccountsService.keymaps.length < 2 && !hasKeyboard
341+ readonly property bool hideKeyboardIndicator: identifier == "indicator-keyboard" && !hasKeyboard
344342
345343 height: parent.height
346344 expanded: indicators.expanded
tests/qmltests/Panel/tst_Panel.qml+4−2
@@ -272,6 +272,7 @@ PanelTest {
272272 }
273273
274274 function cleanup() {
275+ panel.hasKeyboard = false;
275276 panel.indicators.hide();
276277 panel.applicationMenus.hide();
277278 waitForAllAnimationToComplete("initial");
@@ -713,8 +714,8 @@ PanelTest {
713714 { tag: "No keyboard, no keymap", keyboard: false, keymaps: [], hidden: true },
714715 { tag: "No keyboard, one keymap", keyboard: false, keymaps: ["us"], hidden: true },
715716 { tag: "No keyboard, 2 keymaps", keyboard: false, keymaps: ["us", "cs"], hidden: true },
716− { tag: "Keyboard, no keymap", keyboard: true, keymaps: [], hidden: true },
717− { tag: "Keyboard, one keymap", keyboard: true, keymaps: ["us"], hidden: true },
717+ { tag: "Keyboard, no keymap", keyboard: true, keymaps: [], hidden: false },
718+ { tag: "Keyboard, one keymap", keyboard: true, keymaps: ["us"], hidden: false },
718719 { tag: "Keyboard, 2 keymaps", keyboard: true, keymaps: ["us", "cs"], hidden: false }
719720 ];
720721 }
@@ -722,6 +723,7 @@ PanelTest {
722723 function test_hidingKeyboardIndicator(data) {
723724 var item = findChild(panel, "indicator-keyboard-panelItem");
724725 AccountsService.keymaps = data.keymaps;
726+ panel.hasKeyboard = data.keyboard;
725727 if (data.keyboard) {
726728 MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
727729 } else {
tests/qmltests/tst_OrientedShell.qml−2
@@ -1045,7 +1045,6 @@ Rectangle {
10451045
10461046 tryCompare(shell, "usageScenario", "phone");
10471047 tryCompare(inputMethod, "enabled", true);
1048− tryCompare(oskSettings, "disableHeight", false);
10491048
10501049 if (data.kbd) {
10511050 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
@@ -1056,7 +1055,6 @@ Rectangle {
10561055
10571056 tryCompare(shell, "usageScenario", data.expectedMode);
10581057 tryCompare(inputMethod, "enabled", data.oskExpected);
1059− tryCompare(oskSettings, "disableHeight", data.expectedMode == "desktop" || data.kbd);
10601058
10611059 // Restore width
10621060 orientedShellLoader.width = oldWidth;