on xenial help sign in
reuse PanelState component for buttonsAlwaysVisible

instead of a separate TouchControlsState

commit148ae8f9fcfccb58a2c9d6694d542798c71b96f3 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 30 May 2016, 21:52 (10 years ago) parentd6e534e
5 files changed+5−31
qml/Components/PanelState/PanelState.qml+1 qml/Components/TouchControlsState/TouchControlsState.qml−24 qml/Components/TouchControlsState/qmldir−1 qml/Panel/Panel.qml+2−3 qml/Stages/DesktopStage.qml+2−3
qml/Components/PanelState/PanelState.qml+1
@@ -22,6 +22,7 @@ QtObject {
2222
2323 property string title: ""
2424 property bool buttonsVisible: false
25+ property bool buttonsAlwaysVisible: false
2526 property bool closeButtonShown: true
2627 property bool dropShadow: false
2728 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
1919import Unity.Application 0.1
2020import "../Components"
2121import "../Components/PanelState"
22−import "../Components/TouchControlsState"
2322import ".."
2423
2524Item {
@@ -126,9 +125,9 @@ Item {
126125 }
127126 height: indicators.minimizedPanelHeight - anchors.topMargin - anchors.bottomMargin
128127
129− visible: ((PanelState.buttonsVisible && parent.containsMouse) || TouchControlsState.buttonsShownInPanel)
128+ visible: ((PanelState.buttonsVisible && parent.containsMouse) || PanelState.buttonsAlwaysVisible)
130129 && !root.locked && !callHint.visible
131− active: PanelState.buttonsVisible || TouchControlsState.buttonsShownInPanel
130+ active: PanelState.buttonsVisible || PanelState.buttonsAlwaysVisible
132131 windowIsMaximized: true
133132 onCloseClicked: PanelState.closeClicked()
134133 onMinimizeClicked: PanelState.minimizeClicked()
qml/Stages/DesktopStage.qml+2−3
@@ -18,7 +18,6 @@ import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020import "../Components/PanelState"
21−import "../Components/TouchControlsState"
2221import "../Components"
2322import Utils 0.1
2423import Ubuntu.Gestures 0.1
@@ -576,8 +575,8 @@ AbstractStage {
576575 }
577576
578577 Binding {
579− target: TouchControlsState
580− property: "buttonsShownInPanel"
578+ target: PanelState
579+ property: "buttonsAlwaysVisible"
581580 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
582581 }
583582