QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PlanEditToolbar.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7
8/// Toolbar used for things like Polygon editing tools
9Item {
10 width: Math.min(toolsRowLayout.width + (_margins * 2), availableWidth)
11 height: toolsFlickable.y + toolsFlickable.height + _margins
12 z: QGroundControl.zOrderMapItems + 2
13
14 property real availableWidth
15
16 property real _radius: ScreenTools.defaultFontPixelWidth / 2
17 property real _margins: ScreenTools.defaultFontPixelWidth / 2
18
19 Component.onCompleted: {
20 // Move the child controls from consumer into the layout control
21 var moveList = []
22 var i
23 for (i = 2; i < children.length; i++) {
24 moveList.push(children[i])
25 }
26 for (i = 0; i < moveList.length; i++) {
27 moveList[i].parent = toolsRowLayout
28 }
29 instructionComponent.createObject(toolsRowLayout)
30 }
31
32 Rectangle {
33 anchors.fill: parent
34 radius: _radius
35 color: QGroundControl.globalPalette.toolbarBackground
36 }
37
38 QGCFlickable {
39 id: toolsFlickable
40 anchors.margins: _margins
41 anchors.top: parent.top
42 anchors.left: parent.left
43 anchors.right: parent.right
44 height: toolsRowLayout.height
45 clip: true
46 flickableDirection: Flickable.HorizontalFlick
47 contentWidth: toolsRowLayout.width
48
49 RowLayout {
50 id: toolsRowLayout
51 spacing: _margins
52 }
53 }
54
55 Component {
56 id: instructionComponent
57
58 QGCLabel {
59 id: instructionLabel
60 text: _instructionText
61 }
62 }
63}