on xenial help sign in
reuse PanelState component for buttonsAlwaysVisible
148ae8fLukáš 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 buttonsAlwaysVisible: false
25 property bool closeButtonShown: true
26 property bool closeButtonShown: true
26 property bool dropShadow: false
27 property bool dropShadow: false
27 property int panelHeight: 0
28 property int panelHeight: 0
qml/Components/TouchControlsState/TouchControlsState.qmldeleted−24
@@ -1,24 +0,0 @@
1−/*
2− * Copyright (C) 2016 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−pragma Singleton
18−import QtQuick 2.4
19−
20−QtObject {
21− id: root
22−
23− property bool buttonsShownInPanel: false
24−}
qml/Components/TouchControlsState/qmldirdeleted−1
@@ -1 +0,0 @@
1−singleton TouchControlsState 1.0 TouchControlsState.qml
qml/Panel/Panel.qml+2−3
@@ -19,7 +19,6 @@ import Ubuntu.Components 1.3
19import Unity.Application 0.1
19import Unity.Application 0.1
20import "../Components"
20import "../Components"
21import "../Components/PanelState"
21import "../Components/PanelState"
22−import "../Components/TouchControlsState"
23import ".."
22import ".."
24
23
25Item {
24Item {
@@ -126,9 +125,9 @@ Item {
126 }
125 }
127 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
126 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
128
127
129− visible: ((PanelState.buttonsVisible && parent.containsMouse) || TouchControlsState.buttonsShownInPanel)
128+ visible: ((PanelState.buttonsVisible && parent.containsMouse) || PanelState.buttonsAlwaysVisible)
130 && !root.locked && !callHint.visible
129 && !root.locked && !callHint.visible
131− active: PanelState.buttonsVisible || TouchControlsState.buttonsShownInPanel
130+ active: PanelState.buttonsVisible || PanelState.buttonsAlwaysVisible
132 windowIsMaximized: true
131 windowIsMaximized: true
133 onCloseClicked: PanelState.closeClicked()
132 onCloseClicked: PanelState.closeClicked()
134 onMinimizeClicked: PanelState.minimizeClicked()
133 onMinimizeClicked: PanelState.minimizeClicked()
qml/Stages/DesktopStage.qml+2−3
@@ -18,7 +18,6 @@ import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
19import Unity.Application 0.1
20import "../Components/PanelState"
20import "../Components/PanelState"
21−import "../Components/TouchControlsState"
22import "../Components"
21import "../Components"
23import Utils 0.1
22import Utils 0.1
24import Ubuntu.Gestures 0.1
23import Ubuntu.Gestures 0.1
@@ -576,8 +575,8 @@ AbstractStage {
576 }
575 }
577
576
578 Binding {
577 Binding {
579− target: TouchControlsState
578+ target: PanelState
580− property: "buttonsShownInPanel"
579+ property: "buttonsAlwaysVisible"
581 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
580 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
582 }
581 }
583
582