on xenial help sign in
Changed design of side stage handle (#374)

* Used the same handle as the app drawer and indicator panel * Handle no longer overlaps the main stage

commite1ebb5c624df406571299e665c16e64ba8fd008b authorKugi Eusebio <kugi_eusebio@protonmail.com> dateThu 13 May 2021, 09:02 (5 years ago) parent9ec9925
3 files changed+13−7
qml/Stage/SideStage.qml+10−6 qml/Stage/Stage.qml+1 qml/Stage/StageMaths.qml+2−1
qml/Stage/SideStage.qml+10−6
@@ -26,25 +26,29 @@ Showable {
2626 property int panelWidth: units.gu(40)
2727 readonly property alias dragging: hideSideStageDragArea.dragging
2828 readonly property real progress: width / panelWidth
29+ readonly property real handleWidth: units.gu(2)
2930
3031 width: 0
3132 shown: false
3233
33− Item {
34+ Handle {
3435 id: sideStageDragHandle
36+
37+ opacity: root.shown ? 1 : 0
38+ Behavior on opacity { UbuntuNumberAnimation {} }
39+
3540 anchors {
3641 right: root.left
3742 top: root.top
3843 bottom: root.bottom
3944 }
40− width: units.gu(2)
41−
42− opacity: root.shown ? 1 : 0
43− Behavior on opacity { UbuntuNumberAnimation {} }
45+ width: root.handleWidth
46+ active: hideSideStageDragArea.pressed
4447
4548 Image {
49+ z: -1
4650 anchors.centerIn: parent
47− width: hideSideStageDragArea.pressed ? parent.width * 2 : parent.width
51+ width: hideSideStageDragArea.pressed ? parent.width * 3 : parent.width * 2
4852 height: parent.height
4953 source: "graphics/sidestage_handle@20.png"
5054 Behavior on width { UbuntuNumberAnimation {} }
qml/Stage/Stage.qml+1
@@ -1295,6 +1295,7 @@ FocusScope {
12951295 mainStageDelegate: priv.mainStageDelegate
12961296 sideStageDelegate: priv.sideStageDelegate
12971297 sideStageWidth: sideStage.panelWidth
1298+ sideStageHandleWidth: sideStage.handleWidth
12981299 sideStageX: sideStage.x
12991300 itemIndex: appDelegate.itemIndex
13001301 nextInStack: priv.nextInStack
qml/Stage/StageMaths.qml+2−1
@@ -26,6 +26,7 @@ QtObject {
2626 property int nextInStack: 0
2727 property int sceneWidth: 0
2828 property int sideStageWidth: 0
29+ property int sideStageHandleWidth: 0
2930 property int sideStageX: sceneWidth
3031 property bool animateX: false
3132
@@ -87,6 +88,6 @@ QtObject {
8788 Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {duration: animationDuration} }
8889
8990 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
90− sideStageDelegate != null ? sideStageX : sceneWidth :
91+ sideStageDelegate != null ? sideStageX - sideStageHandleWidth : sceneWidth :
9192 stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
9293}