on xenial help sign in
shell dialog improvements
d9a9d4cLukáš Tinkl
qml/Components/Dialogs.qml+4
@@ -42,6 +42,7 @@ Item {
42 }
42 }
43 property string usageScenario
43 property string usageScenario
44 property size screenSize: Qt.size(Screen.width, Screen.height)
44 property size screenSize: Qt.size(Screen.width, Screen.height)
45+ property bool hasKeyboard: false
45
46
46 signal powerOffClicked();
47 signal powerOffClicked();
47
48
@@ -167,6 +168,7 @@ Item {
167 onClicked: {
168 onClicked: {
168 logoutDialog.hide();
169 logoutDialog.hide();
169 }
170 }
171+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
170 }
172 }
171 }
173 }
172 }
174 }
@@ -182,6 +184,7 @@ Item {
182 onClicked: {
184 onClicked: {
183 rebootDialog.hide();
185 rebootDialog.hide();
184 }
186 }
187+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
185 }
188 }
186 Button {
189 Button {
187 text: i18n.tr("Yes")
190 text: i18n.tr("Yes")
@@ -223,6 +226,7 @@ Item {
223 onClicked: {
226 onClicked: {
224 powerDialog.hide();
227 powerDialog.hide();
225 }
228 }
229+ Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
226 }
230 }
227 }
231 }
228 }
232 }
qml/Components/ShellDialog.qml−2
@@ -34,8 +34,6 @@ Dialog {
34
34
35 onVisibleChanged: { if (!visible && dialogLoader) { dialogLoader.active = false; } }
35 onVisibleChanged: { if (!visible && dialogLoader) { dialogLoader.active = false; } }
36
36
37− Keys.onEscapePressed: hide()
38−
39 focus: true
37 focus: true
40
38
41 // FIXME: this is a hack because Dialog subtheming seems broken atm
39 // FIXME: this is a hack because Dialog subtheming seems broken atm
qml/OrientedShell.qml+2−1
@@ -260,7 +260,8 @@ Item {
260 nativeWidth: root.width
260 nativeWidth: root.width
261 nativeHeight: root.height
261 nativeHeight: root.height
262 mode: applicationArguments.mode
262 mode: applicationArguments.mode
263− hasMouse: miceModel.count + touchPadModel.count > 0
263+ hasMouse: pointerInputDevices > 0
264+ hasKeyboard: keyboardsModel.count > 0
264 // TODO: Factor in if the current screen is a touch screen and if the user wants to
265 // TODO: Factor in if the current screen is a touch screen and if the user wants to
265 // have multiple keyboards around. For now we only enable one keyboard at a time
266 // have multiple keyboards around. For now we only enable one keyboard at a time
266 // thus hiding it here if there is a physical one around or if we have a second
267 // 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 {
68 stage.updateFocusedAppOrientationAnimated();
68 stage.updateFocusedAppOrientationAnimated();
69 }
69 }
70 property bool hasMouse: false
70 property bool hasMouse: false
71+ property bool hasKeyboard: false
71
72
72 // to be read from outside
73 // to be read from outside
73 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
74 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
@@ -666,6 +667,7 @@ StyledItem {
666 anchors.fill: parent
667 anchors.fill: parent
667 z: overlay.z + 10
668 z: overlay.z + 10
668 usageScenario: shell.usageScenario
669 usageScenario: shell.usageScenario
670+ hasKeyboard: shell.hasKeyboard
669 onPowerOffClicked: {
671 onPowerOffClicked: {
670 shutdownFadeOutRectangle.enabled = true;
672 shutdownFadeOutRectangle.enabled = true;
671 shutdownFadeOutRectangle.visible = true;
673 shutdownFadeOutRectangle.visible = true;
@@ -673,6 +675,15 @@ StyledItem {
673 }
675 }
674 }
676 }
675
677
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+
676 Connections {
687 Connections {
677 target: SessionBroadcast
688 target: SessionBroadcast
678 onShowHome: if (shell.mode !== "greeter") showHome()
689 onShowHome: if (shell.mode !== "greeter") showHome()