on xenial help sign in
also show the buttons in the panel

when the overlay is shown and the window is maximized

commitebd41156739cff00fbd536f78bed110b4024e986 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 26 Apr 2016, 16:39 (10 years ago) parentad927eb
4 files changed+15−4
qml/Components/TouchControlsState/TouchControlsState.qml+1 qml/Components/WindowControlButtons.qml+1−1 qml/Panel/Panel.qml+6−3 qml/Stages/DesktopStage.qml+7
qml/Components/TouchControlsState/TouchControlsState.qml+1
@@ -21,4 +21,5 @@ QtObject {
2121 id: root
2222
2323 property bool overlayShown: false
24+ property bool buttonsShownInPanel: false
2425}
qml/Components/WindowControlButtons.qml+1−1
@@ -20,7 +20,7 @@ import "../Components/TouchControlsState"
2020
2121Row {
2222 id: root
23− spacing: TouchControlsState.overlayShown && !windowIsMaximized ? units.gu(2) : units.gu(1)
23+ spacing: TouchControlsState.overlayShown ? units.gu(2) : units.gu(1)
2424 Behavior on spacing {
2525 UbuntuNumberAnimation {}
2626 }
qml/Panel/Panel.qml+6−3
@@ -19,6 +19,7 @@ import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020import "../Components"
2121import "../Components/PanelState"
22+import "../Components/TouchControlsState"
2223import ".."
2324
2425Item {
@@ -109,7 +110,7 @@ Item {
109110 height: indicators.minimizedPanelHeight
110111 hoverEnabled: true
111112 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
112− onDoubleClicked: PanelState.maximize()
113+ onDoubleClicked: PanelState.restore()
113114
114115 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
115116 // cf. https://bugreports.qt.io/browse/QTBUG-32909
@@ -124,8 +125,10 @@ Item {
124125 bottomMargin: units.gu(0.5)
125126 }
126127 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
127− visible: PanelState.buttonsVisible && parent.containsMouse && !root.locked && !callHint.visible
128− active: PanelState.buttonsVisible
128+ visible: ((PanelState.buttonsVisible && parent.containsMouse) ||
129+ (TouchControlsState.overlayShown && TouchControlsState.buttonsShownInPanel))
130+ && !root.locked && !callHint.visible
131+ active: PanelState.buttonsVisible || TouchControlsState.overlayShown
129132 windowIsMaximized: true
130133 onClose: PanelState.close()
131134 onMinimize: PanelState.minimize()
qml/Stages/DesktopStage.qml+7
@@ -18,6 +18,7 @@ import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020import "../Components/PanelState"
21+import "../Components/TouchControlsState"
2122import "../Components"
2223import Utils 0.1
2324import Ubuntu.Gestures 0.1
@@ -191,6 +192,12 @@ AbstractStage {
191192 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null
192193 }
193194
195+ Binding {
196+ target: TouchControlsState
197+ property: "buttonsShownInPanel"
198+ value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized
199+ }
200+
194201 Component.onDestruction: {
195202 PanelState.title = "";
196203 PanelState.buttonsVisible = false;