on xenial help sign in
shell dialog improvements
commitd9a9d4c8894ffbd29dda978d037b02707e324177 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 31 Oct 2016, 17:23 (10 years ago) parentf64475a
4 files changed+17−3
qml/Components/Dialogs.qml+4 qml/Components/ShellDialog.qml−2 qml/OrientedShell.qml+2−1 qml/Shell.qml+11
qml/Components/Dialogs.qml+4
@@ -42,6 +42,7 @@ Item {
4242 }
4343 property string usageScenario
4444 property size screenSize: Qt.size(Screen.width, Screen.height)
45+ property bool hasKeyboard: false
4546
4647 signal powerOffClicked();
4748
@@ -167,6 +168,7 @@ Item {
167168 onClicked: {
168169 logoutDialog.hide();
169170 }
171+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
170172 }
171173 }
172174 }
@@ -182,6 +184,7 @@ Item {
182184 onClicked: {
183185 rebootDialog.hide();
184186 }
187+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
185188 }
186189 Button {
187190 text: i18n.tr("Yes")
@@ -223,6 +226,7 @@ Item {
223226 onClicked: {
224227 powerDialog.hide();
225228 }
229+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
226230 }
227231 }
228232 }
qml/Components/ShellDialog.qml−2
@@ -34,8 +34,6 @@ Dialog {
3434
3535 onVisibleChanged: { if (!visible && dialogLoader) { dialogLoader.active = false; } }
3636
37− Keys.onEscapePressed: hide()
38−
3937 focus: true
4038
4139 // FIXME: this is a hack because Dialog subtheming seems broken atm
qml/OrientedShell.qml+2−1
@@ -260,7 +260,8 @@ Item {
260260 nativeWidth: root.width
261261 nativeHeight: root.height
262262 mode: applicationArguments.mode
263− hasMouse: miceModel.count + touchPadModel.count > 0
263+ hasMouse: pointerInputDevices > 0
264+ hasKeyboard: keyboardsModel.count > 0
264265 // TODO: Factor in if the current screen is a touch screen and if the user wants to
265266 // have multiple keyboards around. For now we only enable one keyboard at a time
266267 // thus hiding it here if there is a physical one around or if we have a second
qml/Shell.qml+11
@@ -68,6 +68,7 @@ StyledItem {
6868 stage.updateFocusedAppOrientationAnimated();
6969 }
7070 property bool hasMouse: false
71+ property bool hasKeyboard: false
7172
7273 // to be read from outside
7374 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
@@ -666,6 +667,7 @@ StyledItem {
666667 anchors.fill: parent
667668 z: overlay.z + 10
668669 usageScenario: shell.usageScenario
670+ hasKeyboard: shell.hasKeyboard
669671 onPowerOffClicked: {
670672 shutdownFadeOutRectangle.enabled = true;
671673 shutdownFadeOutRectangle.visible = true;
@@ -673,6 +675,15 @@ StyledItem {
673675 }
674676 }
675677
678+ MouseArea { // shell dialog prevents interacting with other contents
679+ anchors.fill: parent
680+ visible: dialogs.hasActiveDialog
681+ enabled: visible
682+ acceptedButtons: Qt.AllButtons
683+ hoverEnabled: true
684+ onWheel: wheel.accepted = true
685+ }
686+
676687 Connections {
677688 target: SessionBroadcast
678689 onShowHome: if (shell.mode !== "greeter") showHome()