@@ -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