6import QGroundControl.Controls
7import QGroundControl.AppSettings
12 z: QGroundControl.zOrderTopMost
14 readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
15 readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
16 readonly property real _horizontalMargin: _defaultTextWidth / 2
17 readonly property real _verticalMargin: _defaultTextHeight / 2
19 property bool _first: true
21 property bool _commingFromRIDSettings: false
23 function showSettingsPage(settingsPage) {
24 for (var i=0; i<buttonRepeater.count; i++) {
25 var loader = buttonRepeater.itemAt(i)
26 if (loader && loader.item && loader.item.text === settingsPage) {
33 // This need to block click event leakage to underlying map.
38 QGCPalette { id: qgcPal }
40 Component.onCompleted: {
42 if (globals.commingFromRIDIndicator) {
43 rightPanel.source = "qrc:/qml/QGroundControl/AppSettings/RemoteIDSettings.qml"
44 globals.commingFromRIDIndicator = false
46 rightPanel.source = "qrc:/qml/QGroundControl/AppSettings/GeneralSettings.qml"
50 SettingsPagesModel { id: settingsPagesModel }
52 ButtonGroup { id: buttonGroup }
56 width: buttonColumn.width
57 anchors.topMargin: _verticalMargin
58 anchors.top: parent.top
59 anchors.bottom: parent.bottom
60 anchors.leftMargin: _horizontalMargin
61 anchors.left: parent.left
62 contentHeight: buttonColumn.height + _verticalMargin
63 flickableDirection: Flickable.VerticalFlick
70 property real _maxButtonWidth: 0
75 Item { height: ScreenTools.defaultFontPixelHeight / 2 }
83 icon.source: modelIconUrl
84 visible: modelPageVisible()
85 ButtonGroup.group: buttonGroup
88 if (mainWindow.allowViewSwitch()) {
89 if (rightPanel.source !== modelUrl) {
90 rightPanel.source = modelUrl
96 Component.onCompleted: {
97 if (globals.commingFromRIDIndicator) {
98 _commingFromRIDSettings = true
104 if (_commingFromRIDSettings) {
106 _commingFromRIDSettings = false
107 if (modelUrl == "qrc:/qml/QGroundControl/AppSettings/RemoteIDSettings.qml") {
117 model: settingsPagesModel
120 Layout.fillWidth: true
121 sourceComponent: _sourceComponent()
123 property var modelName: name
124 property var modelIconUrl: iconUrl
125 property var modelUrl: url
126 property var modelPageVisible: pageVisible
128 function _sourceComponent() {
129 if (name === "Divider") {
130 return dividerComponent
131 } else if (pageVisible()) {
132 return buttonComponent
144 anchors.topMargin: _verticalMargin
145 anchors.bottomMargin: _verticalMargin
146 anchors.leftMargin: _horizontalMargin
147 anchors.left: buttonList.right
148 anchors.top: parent.top
149 anchors.bottom: parent.bottom
151 color: qgcPal.windowShade
157 anchors.leftMargin: _horizontalMargin
158 anchors.rightMargin: _horizontalMargin
159 anchors.topMargin: _verticalMargin
160 anchors.bottomMargin: _verticalMargin
161 anchors.left: divider.right
162 anchors.right: parent.right
163 anchors.top: parent.top
164 anchors.bottom: parent.bottom