on xenial help sign in
touch/pointer usage tweaks
9641560Nick Dedekind
qml/Panel/Panel.qml+33−10
@@ -46,7 +46,6 @@ Item {
46 property alias indicators: __indicators
46 property alias indicators: __indicators
47 property bool fullscreenMode: false
47 property bool fullscreenMode: false
48 property real panelAreaShowProgress: 1.0
48 property real panelAreaShowProgress: 1.0
49− property bool locked: false
50 property bool greeterShown: false
49 property bool greeterShown: false
51
50
52 property string mode: "staged"
51 property string mode: "staged"
@@ -76,6 +75,26 @@ Item {
76 persistentSurfaceId: PanelState.focusedPersistentSurfaceId
75 persistentSurfaceId: PanelState.focusedPersistentSurfaceId
77 }
76 }
78
77
78+ QtObject {
79+ id: d
80+
81+ property bool __revealControls: (decorationMouseArea.containsMouse || menuBarLoader.menusRequested) &&
82+ !applicationMenus.shown &&
83+ !indicators.shown
84+
85+ property bool showWindowDecorationControls: (__revealControls && PanelState.decorationsVisible) ||
86+ PanelState.decorationsAlwaysVisible
87+
88+ property bool enablePointerMenu: __revealControls &&
89+ (PanelState.decorationsVisible || mode == "staged") &&
90+ applicationMenus.available &&
91+ applicationMenus.model
92+
93+ property bool enableTouchMenus: !enablePointerMenu &&
94+ applicationMenus.available &&
95+ applicationMenus.model
96+ }
97+
79 Item {
98 Item {
80 id: panelArea
99 id: panelArea
81 objectName: "panelArea"
100 objectName: "panelArea"
@@ -153,8 +172,6 @@ Item {
153 }
172 }
154 }
173 }
155
174
156− property bool showWindowControls: containsMouse || menuBarLoader.menusRequested
157−
158 Row {
175 Row {
159 anchors.fill: parent
176 anchors.fill: parent
160 spacing: units.gu(2)
177 spacing: units.gu(2)
@@ -165,7 +182,7 @@ Item {
165 id: windowControlButtons
182 id: windowControlButtons
166 objectName: "panelWindowControlButtons"
183 objectName: "panelWindowControlButtons"
167 height: indicators.minimizedPanelHeight
184 height: indicators.minimizedPanelHeight
168− opacity: (PanelState.decorationsVisible && decorationMouseArea.showWindowControls) || PanelState.decorationsAlwaysVisible ? 1 : 0
185+ opacity: d.showWindowDecorationControls ? 1 : 0
169 visible: opacity != 0
186 visible: opacity != 0
170 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
187 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
171
188
@@ -180,7 +197,8 @@ Item {
180 Loader {
197 Loader {
181 id: menuBarLoader
198 id: menuBarLoader
182 height: parent.height
199 height: parent.height
183− opacity: decorationMouseArea.showWindowControls || PanelState.decorationsAlwaysVisible ? 1 : 0
200+ enabled: d.enablePointerMenu
201+ opacity: d.enablePointerMenu ? 1 : 0
184 visible: opacity != 0
202 visible: opacity != 0
185 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
203 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
186 active: __applicationMenus.model
204 active: __applicationMenus.model
@@ -197,7 +215,12 @@ Item {
197
215
198 Connections {
216 Connections {
199 target: __applicationMenus
217 target: __applicationMenus
218+ onShownChanged: bar.dismiss();
219+ }
220+
221+ Connections {
222+ target: __indicators
200− onHide: bar.dismiss();
223+ onShownChanged: bar.dismiss();
201 }
224 }
202 }
225 }
203 }
226 }
@@ -210,7 +233,7 @@ Item {
210 anchors.centerIn: parent
233 anchors.centerIn: parent
211 height: minimizedPanelHeight
234 height: minimizedPanelHeight
212
235
213− visible: active && indicators.state == "initial"
236+ visible: active && indicators.state == "initial" && __applicationMenus.state == "initial"
214 greeterShown: root.greeterShown
237 greeterShown: root.greeterShown
215 }
238 }
216 }
239 }
@@ -225,7 +248,7 @@ Item {
225 openedHeight: root.height
248 openedHeight: root.height
226 alignment: Qt.AlignLeft
249 alignment: Qt.AlignLeft
227 enableHint: !callHint.active && !fullscreenMode
250 enableHint: !callHint.active && !fullscreenMode
228− showOnClick: !callHint.visible
251+ showOnClick: false
229 panelColor: panelAreaBackground.color
252 panelColor: panelAreaBackground.color
230
253
231 onShowTapped: {
254 onShowTapped: {
@@ -266,8 +289,8 @@ Item {
266 }
289 }
267 }
290 }
268
291
269− enabled: !root.locked && model
292+ enabled: d.enableTouchMenus
270− opacity: decorationMouseArea.showWindowControls || PanelState.decorationsAlwaysVisible ? 0 : 1
293+ opacity: d.enableTouchMenus ? 1 : 0
271 visible: opacity != 0
294 visible: opacity != 0
272 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
295 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
273
296
qml/Panel/PanelMenu.qml+1
@@ -84,6 +84,7 @@ Showable {
84 // eater
84 // eater
85 MouseArea {
85 MouseArea {
86 anchors.fill: content
86 anchors.fill: content
87+ hoverEnabled: true
87 acceptedButtons: Qt.AllButtons
88 acceptedButtons: Qt.AllButtons
88 onWheel: wheel.accepted = true;
89 onWheel: wheel.accepted = true;
89 enabled: root.state != "initial"
90 enabled: root.state != "initial"
qml/Shell.qml+2−1
@@ -473,6 +473,8 @@ StyledItem {
473
473
474 applicationMenus {
474 applicationMenus {
475 hides: [launcher]
475 hides: [launcher]
476+ available: (!greeter || !greeter.shown)
477+ && !shell.waitingOnGreeter
476 }
478 }
477
479
478 readonly property bool focusedSurfaceIsFullscreen: MirFocusController.focusedSurface
480 readonly property bool focusedSurfaceIsFullscreen: MirFocusController.focusedSurface
@@ -480,7 +482,6 @@ StyledItem {
480 : false
482 : false
481 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)
483 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)
482 || greeter.hasLockedApp
484 || greeter.hasLockedApp
483− locked: greeter && greeter.active
484 greeterShown: greeter && greeter.shown
485 greeterShown: greeter && greeter.shown
485 }
486 }
486
487