on xenial help sign in
prevent the mode switch warning dialog from displaying on e.g. tablets
826ea86Lukáš Tinkl
qml/Components/Dialogs.qml+6−2
@@ -15,7 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18−
18+import QtQuick.Window 2.2
19import Unity.Application 0.1
19import Unity.Application 0.1
20import Unity.Session 0.1
20import Unity.Session 0.1
21import GlobalShortcut 1.0
21import GlobalShortcut 1.0
@@ -49,7 +49,11 @@ Item {
49 }
49 }
50
50
51 onUsageScenarioChanged: {
51 onUsageScenarioChanged: {
52+ // if we let the user switch manually to desktop mode, don't display the warning dialog
53+ // see MenuItemFactory.qml, for the Desktop Mode switch logic
54+ var isTabletSize = Math.min(Screen.width, Screen.height) > units.gu(60);
55+
52− if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup) {
56+ if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup && !isTabletSize) {
53 var comp = Qt.createComponent(Qt.resolvedUrl("ModeSwitchWarningDialog.qml"))
57 var comp = Qt.createComponent(Qt.resolvedUrl("ModeSwitchWarningDialog.qml"))
54 d.modeSwitchWarningPopup = comp.createObject(root, {model: legacyAppsModel});
58 d.modeSwitchWarningPopup = comp.createObject(root, {model: legacyAppsModel});
55 d.modeSwitchWarningPopup.forceClose.connect(function() {
59 d.modeSwitchWarningPopup.forceClose.connect(function() {