on xenial help sign in
Hide the close button for dash Fixes: #1550056, #1564347
ea8906fLukáš Tinkl
qml/Components/PanelState/PanelState.qml+1
@@ -22,6 +22,7 @@ QtObject {
22
22
23 property string title: ""
23 property string title: ""
24 property bool buttonsVisible: false
24 property bool buttonsVisible: false
25+ property bool closeButtonShown: true
25 property bool dropShadow: false
26 property bool dropShadow: false
26 property int panelHeight: units.gu(3)
27 property int panelHeight: units.gu(3)
27
28
qml/Components/WindowControlButtons.qml+2
@@ -23,6 +23,7 @@ Row {
23
23
24 // to be set from outside
24 // to be set from outside
25 property bool active: false
25 property bool active: false
26+ property bool closeButtonShown: true
26
27
27 signal close()
28 signal close()
28 signal minimize()
29 signal minimize()
@@ -35,6 +36,7 @@ Row {
35 height: parent.height
36 height: parent.height
36 width: height
37 width: height
37 onClicked: root.close()
38 onClicked: root.close()
39+ visible: root.closeButtonShown
38
40
39 Rectangle {
41 Rectangle {
40 anchors.centerIn: parent
42 anchors.centerIn: parent
qml/Panel/Panel.qml+1
@@ -126,6 +126,7 @@ Item {
126 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
126 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
127 visible: PanelState.buttonsVisible && parent.containsMouse && !root.locked && !callHint.visible
127 visible: PanelState.buttonsVisible && parent.containsMouse && !root.locked && !callHint.visible
128 active: PanelState.buttonsVisible
128 active: PanelState.buttonsVisible
129+ closeButtonShown: PanelState.closeButtonShown
129 onClose: PanelState.close()
130 onClose: PanelState.close()
130 onMinimize: PanelState.minimize()
131 onMinimize: PanelState.minimize()
131 onMaximize: PanelState.maximize()
132 onMaximize: PanelState.maximize()
qml/Stages/DesktopStage.qml+6
@@ -190,6 +190,12 @@ AbstractStage {
190 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null
190 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null
191 }
191 }
192
192
193+ Binding {
194+ target: PanelState
195+ property: "closeButtonShown"
196+ value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && priv.focusedAppDelegate.application.appId !== "unity8-dash"
197+ }
198+
193 Component.onDestruction: {
199 Component.onDestruction: {
194 PanelState.title = "";
200 PanelState.title = "";
195 PanelState.buttonsVisible = false;
201 PanelState.buttonsVisible = false;
qml/Stages/WindowDecoration.qml+1
@@ -84,6 +84,7 @@ MouseArea {
84 id: buttons
84 id: buttons
85 height: parent.height
85 height: parent.height
86 active: root.active
86 active: root.active
87+ closeButtonShown: root.target.application.appId !== "unity8-dash"
87 onClose: root.close();
88 onClose: root.close();
88 onMinimize: root.minimize();
89 onMinimize: root.minimize();
89 onMaximize: root.maximize();
90 onMaximize: root.maximize();
tests/qmltests/Stages/tst_DesktopStage.qml+7
@@ -616,5 +616,12 @@ Item {
616 // verify the drop shadow is gone
616 // verify the drop shadow is gone
617 tryCompare(PanelState, "dropShadow", false);
617 tryCompare(PanelState, "dropShadow", false);
618 }
618 }
619+
620+ function test_dashHasNoCloseButton() {
621+ var dashAppDelegate = startApplication("unity8-dash");
622+ verify(dashAppDelegate);
623+ var closeButton = findChild(dashAppDelegate, "closeWindowButton");
624+ tryCompare(closeButton, "visible", false);
625+ }
619 }
626 }
620}
627}