on xenial help sign in
Changed design of side stage handle (#374)
e1ebb5cKugi Eusebio
qml/Stage/SideStage.qml+10−6
@@ -26,25 +26,29 @@ Showable {
26 property int panelWidth: units.gu(40)
26 property int panelWidth: units.gu(40)
27 readonly property alias dragging: hideSideStageDragArea.dragging
27 readonly property alias dragging: hideSideStageDragArea.dragging
28 readonly property real progress: width / panelWidth
28 readonly property real progress: width / panelWidth
29+ readonly property real handleWidth: units.gu(2)
29
30
30 width: 0
31 width: 0
31 shown: false
32 shown: false
32
33
33− Item {
34+ Handle {
34 id: sideStageDragHandle
35 id: sideStageDragHandle
36+
37+ opacity: root.shown ? 1 : 0
38+ Behavior on opacity { UbuntuNumberAnimation {} }
39+
35 anchors {
40 anchors {
36 right: root.left
41 right: root.left
37 top: root.top
42 top: root.top
38 bottom: root.bottom
43 bottom: root.bottom
39 }
44 }
40− width: units.gu(2)
45+ width: root.handleWidth
41−
46+ active: hideSideStageDragArea.pressed
42− opacity: root.shown ? 1 : 0
43− Behavior on opacity { UbuntuNumberAnimation {} }
44
47
45 Image {
48 Image {
49+ z: -1
46 anchors.centerIn: parent
50 anchors.centerIn: parent
47− width: hideSideStageDragArea.pressed ? parent.width * 2 : parent.width
51+ width: hideSideStageDragArea.pressed ? parent.width * 3 : parent.width * 2
48 height: parent.height
52 height: parent.height
49 source: "graphics/sidestage_handle@20.png"
53 source: "graphics/sidestage_handle@20.png"
50 Behavior on width { UbuntuNumberAnimation {} }
54 Behavior on width { UbuntuNumberAnimation {} }
qml/Stage/Stage.qml+1
@@ -1295,6 +1295,7 @@ FocusScope {
1295 mainStageDelegate: priv.mainStageDelegate
1295 mainStageDelegate: priv.mainStageDelegate
1296 sideStageDelegate: priv.sideStageDelegate
1296 sideStageDelegate: priv.sideStageDelegate
1297 sideStageWidth: sideStage.panelWidth
1297 sideStageWidth: sideStage.panelWidth
1298+ sideStageHandleWidth: sideStage.handleWidth
1298 sideStageX: sideStage.x
1299 sideStageX: sideStage.x
1299 itemIndex: appDelegate.itemIndex
1300 itemIndex: appDelegate.itemIndex
1300 nextInStack: priv.nextInStack
1301 nextInStack: priv.nextInStack
qml/Stage/StageMaths.qml+2−1
@@ -26,6 +26,7 @@ QtObject {
26 property int nextInStack: 0
26 property int nextInStack: 0
27 property int sceneWidth: 0
27 property int sceneWidth: 0
28 property int sideStageWidth: 0
28 property int sideStageWidth: 0
29+ property int sideStageHandleWidth: 0
29 property int sideStageX: sceneWidth
30 property int sideStageX: sceneWidth
30 property bool animateX: false
31 property bool animateX: false
31
32
@@ -87,6 +88,6 @@ QtObject {
87 Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {duration: animationDuration} }
88 Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {duration: animationDuration} }
88
89
89 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
90 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
90− sideStageDelegate != null ? sideStageX : sceneWidth :
91+ sideStageDelegate != null ? sideStageX - sideStageHandleWidth : sceneWidth :
91 stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
92 stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
92}
93}