on xenial help sign in
added pointer menu activation in staged mode
commit620290b86230f676c7965dafc41363e9b3a86e68 authorNick Dedekind <nick.dedekind@canonical.com> dateMon 19 Dec 2016, 16:34 (10 years ago) parent8922f30
3 files changed+46−48
qml/ApplicationMenus/MenuBar.qml+1−2 qml/Panel/Panel.qml+45−45 qml/Panel/PanelMenu.qml−1
qml/ApplicationMenus/MenuBar.qml+1−2
@@ -32,7 +32,7 @@ Item {
3232
3333 readonly property bool showRequested: d.longAltPressed || d.currentItem != null
3434
35− implicitWidth: row.width + units.gu(1)
35+ implicitWidth: row.width
3636 height: parent.height
3737
3838 function select(index) {
@@ -66,7 +66,6 @@ Item {
6666
6767 Row {
6868 id: row
69− anchors.left: parent.left
7069 height: parent.height
7170 spacing: units.gu(2)
7271
qml/Panel/Panel.qml+45−45
@@ -153,52 +153,52 @@ Item {
153153 }
154154 }
155155
156− property bool showWindowControls: (PanelState.decorationsVisible && (containsMouse || menuBarLoader.menusRequested)) || PanelState.decorationsAlwaysVisible
157−
158− // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
159− // cf. https://bugreports.qt.io/browse/QTBUG-32909
160− WindowControlButtons {
161− id: windowControlButtons
162− objectName: "panelWindowControlButtons"
163− anchors {
164− left: parent.left
165− top: parent.top
156+ property bool showWindowControls: containsMouse || menuBarLoader.menusRequested
157+
158+ Row {
159+ anchors.fill: parent
160+ spacing: units.gu(2)
161+
162+ // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
163+ // cf. https://bugreports.qt.io/browse/QTBUG-32909
164+ WindowControlButtons {
165+ id: windowControlButtons
166+ objectName: "panelWindowControlButtons"
167+ height: indicators.minimizedPanelHeight
168+ opacity: (PanelState.decorationsVisible && decorationMouseArea.showWindowControls) || PanelState.decorationsAlwaysVisible ? 1 : 0
169+ visible: opacity != 0
170+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
171+
172+ active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible
173+ windowIsMaximized: true
174+ onCloseClicked: PanelState.closeClicked()
175+ onMinimizeClicked: PanelState.minimizeClicked()
176+ onMaximizeClicked: PanelState.restoreClicked()
177+ closeButtonShown: PanelState.closeButtonShown
166178 }
167− height: indicators.minimizedPanelHeight
168− opacity: decorationMouseArea.showWindowControls ? 1 : 0
169− visible: opacity != 0
170− Behavior on opacity { UbuntuNumberAnimation {} }
171−
172− active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible
173− windowIsMaximized: true
174− onCloseClicked: PanelState.closeClicked()
175− onMinimizeClicked: PanelState.minimizeClicked()
176− onMaximizeClicked: PanelState.restoreClicked()
177− closeButtonShown: PanelState.closeButtonShown
178− }
179−
180− Loader {
181− id: menuBarLoader
182− anchors {
183− left: windowControlButtons.right
184− leftMargin: units.gu(3)
185− }
186− height: parent.height
187− opacity: windowControlButtons.opacity
188− visible: opacity != 0
189− active: __applicationMenus.model
190179
191− property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false
192−
193− sourceComponent: MenuBar {
194− id: bar
195− height: menuBarLoader.height
196− enableKeyFilter: valid && PanelState.decorationsVisible
197− unityMenuModel: registeredMenuModel.model
198−
199− Connections {
200− target: __applicationMenus
201− onHide: bar.dismiss();
180+ Loader {
181+ id: menuBarLoader
182+ height: parent.height
183+ opacity: decorationMouseArea.showWindowControls || PanelState.decorationsAlwaysVisible ? 1 : 0
184+ visible: opacity != 0
185+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
186+ active: __applicationMenus.model
187+
188+ property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false
189+
190+ sourceComponent: MenuBar {
191+ id: bar
192+ anchors.left: parent.left
193+ anchors.margins: units.gu(1)
194+ height: menuBarLoader.height
195+ enableKeyFilter: valid && PanelState.decorationsVisible
196+ unityMenuModel: __applicationMenus.model
197+
198+ Connections {
199+ target: __applicationMenus
200+ onHide: bar.dismiss();
201+ }
202202 }
203203 }
204204 }
@@ -267,7 +267,7 @@ Item {
267267 }
268268
269269 enabled: !root.locked && model
270− opacity: !decorationMouseArea.showWindowControls && !indicators.expanded ? 1 : 0
270+ opacity: decorationMouseArea.showWindowControls || PanelState.decorationsAlwaysVisible ? 0 : 1
271271 visible: opacity != 0
272272 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
273273
qml/Panel/PanelMenu.qml−1
@@ -84,7 +84,6 @@ Showable {
8484 // eater
8585 MouseArea {
8686 anchors.fill: content
87− hoverEnabled: true
8887 acceptedButtons: Qt.AllButtons
8988 onWheel: wheel.accepted = true;
9089 enabled: root.state != "initial"