File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,53 @@ Item {
3636 opacity: 0.85
3737 }
3838
39+
40+ // Open/Close panel
41+ Item {
42+ id: panelOpenCloseButton
43+ anchors .right : parent .left
44+ anchors .verticalCenter : parent .verticalCenter
45+ width: toggleButtonRect .width - toggleButtonRect .radius
46+ height: toggleButtonRect .height
47+ clip: true
48+
49+ property bool expanded: root .anchors .right == root .parent .right
50+
51+ Rectangle {
52+ id: toggleButtonRect
53+ width: ScreenTools .defaultFontPixelWidth * 2.25
54+ height: width * 3
55+ radius: ScreenTools .defaultBorderRadius
56+ color: rightPanelBackground .color
57+ opacity: rightPanelBackground .opacity
58+
59+ QGCLabel {
60+ id: toggleButtonLabel
61+ anchors .centerIn : parent
62+ text: panelOpenCloseButton .expanded ? " >" : " <"
63+ color: qgcPal .buttonText
64+ opacity: parent .opacity
65+ }
66+
67+ }
68+
69+ QGCMouseArea {
70+ anchors .fill : parent
71+
72+ onClicked: {
73+ if (panelOpenCloseButton .expanded ) {
74+ // Close panel
75+ root .anchors .right = undefined
76+ root .anchors .left = root .parent .right
77+ } else {
78+ // Open panel
79+ root .anchors .left = undefined
80+ root .anchors .right = root .parent .right
81+ }
82+ }
83+ }
84+ }
85+
3986 // -------------------------------------------------------
4087 // Right Panel Controls
4188 Item {
You can’t perform that action at this time.
0 commit comments