Skip to content

Commit 0ba7cf7

Browse files
committed
Allow the edit panel to open/close
1 parent 54d5ce9 commit 0ba7cf7

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/QmlControls/PlanViewRightPanel.qml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)