on xenial help sign in
prevent the mode switch warning dialog from displaying on e.g. tablets
commit826ea86e57887ac204d9c3b64760c09911cc148c authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 15 Jul 2016, 11:58 (10 years ago) parent65b1efb
1 file changed+6−2
qml/Components/Dialogs.qml+6−2
qml/Components/Dialogs.qml+6−2
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.4
18−
18+import QtQuick.Window 2.2
1919import Unity.Application 0.1
2020import Unity.Session 0.1
2121import GlobalShortcut 1.0
@@ -49,7 +49,11 @@ Item {
4949 }
5050
5151 onUsageScenarioChanged: {
52− if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup) {
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+
56+ if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup && !isTabletSize) {
5357 var comp = Qt.createComponent(Qt.resolvedUrl("ModeSwitchWarningDialog.qml"))
5458 d.modeSwitchWarningPopup = comp.createObject(root, {model: legacyAppsModel});
5559 d.modeSwitchWarningPopup.forceClose.connect(function() {