diff --git a/src/QmlControls/QGCLabel.qml b/src/QmlControls/QGCLabel.qml index 070e7c7baebdd823c63300772c15933714e75708..2e266d81deed0db0352b4e18faef319d069bfc8f 100644 --- a/src/QmlControls/QGCLabel.qml +++ b/src/QmlControls/QGCLabel.qml @@ -11,6 +11,7 @@ Text { property bool enabled: true font.pixelSize: ScreenTools.defaultFontPixelSize + fontSizeMode: Text.HorizontalFit color: __qgcPal.text antialiasing: true } diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index 68a56908a9b2f51f1aa5ecbb04b2e91d5f7d7914..36d7562660d3e3c0a362224675f5f2869576ecdc 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -156,6 +156,7 @@ Rectangle { errorDialog.visible = false } } + Rectangle { id: _offlineMapTopRect width: parent.width @@ -180,25 +181,29 @@ Rectangle { } } } + QGCFlickable { id: _tileSetList clip: true anchors.top: _offlineMapTopRect.bottom - width: parent.width - height: parent.height - _offlineMapTopRect.height + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: _optionsButton.top contentHeight: _cacheList.height - contentWidth: parent.width flickableDirection: Flickable.VerticalFlick + Column { id: _cacheList - width: _offlineMapRoot.width + width: Math.min(parent.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0)) anchors.margins: ScreenTools.defaultFontPixelWidth spacing: (ScreenTools.defaultFontPixelHeight * 0.5).toFixed(0) + anchors.horizontalCenter: parent.horizontalCenter + OfflineMapButton { - text: "Add new set" - width: (ScreenTools.defaultFontPixelWidth * 50).toFixed(0) - height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) - anchors.horizontalCenter: parent.horizontalCenter + text: "Add new set" + anchors.left: parent.left + anchors.right: parent.right + height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) onClicked: { _offlineMapRoot._currentSelection = null showMap() @@ -207,12 +212,12 @@ Rectangle { Repeater { model: QGroundControl.mapEngineManager.tileSets delegate: OfflineMapButton { - text: object.name - size: object.downloadStatus - complete: object.complete - width: (ScreenTools.defaultFontPixelWidth * 50).toFixed(0) - height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) - anchors.horizontalCenter: parent.horizontalCenter + text: object.name + size: object.downloadStatus + complete: object.complete + anchors.left: parent.left + anchors.right: parent.right + height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) onClicked: { _offlineMapRoot._currentSelection = object showInfo() @@ -221,16 +226,17 @@ Rectangle { } } } + QGCButton { id: _optionsButton text: "Options" - width: ScreenTools.defaultFontPixelWidth * 10 visible: _tileSetList.visible anchors.bottom: parent.bottom anchors.right: parent.right anchors.margins: ScreenTools.defaultFontPixelWidth onClicked: showOptions() } + //-- Offline Map Definition Rectangle { id: _mapView diff --git a/src/ui/MainWindowLeftPanel.qml b/src/ui/MainWindowLeftPanel.qml index d83f724fc34db85ea8493862b413dbb2498e351e..997368eca6034ae7b361115d72a62e5574f18dc9 100644 --- a/src/ui/MainWindowLeftPanel.qml +++ b/src/ui/MainWindowLeftPanel.qml @@ -42,6 +42,7 @@ Item { readonly property int __animationDuration: 100 readonly property real __closeButtonSize: ScreenTools.defaultFontPixelHeight * 2 + readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2 onVisibleChanged: { //-- Unselect any selected button @@ -129,103 +130,113 @@ Item { // This is the menu dialog panel which is anchored to the left edge Rectangle { id: __leftMenu - width: (tbButtonWidth * 2) + (tbSpacing * 4) + 1 + width: ScreenTools.defaultFontPixelWidth * 12 anchors.left: parent.left anchors.top: __topSeparator.bottom anchors.bottom: parent.bottom color: __qgcPal.windowShadeDark - ExclusiveGroup { id: panelActionGroup } + QGCFlickable { + anchors.fill: parent + contentHeight: buttonColumn.height + _margins + flickableDirection: Flickable.VerticalFlick + clip: true - Column { - width: parent.width - spacing: ScreenTools.defaultFontPixelHeight - Item { - width: 1 - height: ScreenTools.defaultFontPixelHeight * 0.5 - } - QGCLabel { - text: "Preferences" - anchors.horizontalCenter: parent.horizontalCenter - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "General" - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "GeneralSettings.qml") { - __rightPanel.source = "GeneralSettings.qml" + ExclusiveGroup { id: panelActionGroup } + + Column { + id: buttonColumn + anchors.leftMargin: _margins + anchors.rightMargin: _margins + anchors.left: parent.left + anchors.right: parent.right + anchors.topMargin: _margins + anchors.top: parent.top + spacing: ScreenTools.defaultFontPixelHeight + + QGCLabel { + text: "Preferences" + anchors.horizontalCenter: parent.horizontalCenter + } + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "General" + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "GeneralSettings.qml") { + __rightPanel.source = "GeneralSettings.qml" + } + checked = true } - checked = true } - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "Comm Links" - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "LinkSettings.qml") { - __rightPanel.source = "LinkSettings.qml" + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "Comm Links" + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "LinkSettings.qml") { + __rightPanel.source = "LinkSettings.qml" + } + checked = true } - checked = true } - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "Offline Maps" - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "OfflineMap.qml") { - __rightPanel.source = "OfflineMap.qml" + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "Offline Maps" + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "OfflineMap.qml") { + __rightPanel.source = "OfflineMap.qml" + } + checked = true } - checked = true } - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "MavLink" - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "MavlinkSettings.qml") { - __rightPanel.source = "MavlinkSettings.qml" + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "MavLink" + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "MavlinkSettings.qml") { + __rightPanel.source = "MavlinkSettings.qml" + } + checked = true } - checked = true } - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "Mock Link" - visible: ScreenTools.isDebug - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "MockLink.qml") { - __rightPanel.source = "MockLink.qml" + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "Mock Link" + visible: ScreenTools.isDebug + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "MockLink.qml") { + __rightPanel.source = "MockLink.qml" + } + checked = true } - checked = true } - } - QGCButton { - width: parent.width * 0.85 - height: ScreenTools.defaultFontPixelHeight * 2.5 - text: "Debug" - visible: ScreenTools.isDebug - exclusiveGroup: panelActionGroup - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - if(__rightPanel.source != "DebugWindow.qml") { - __rightPanel.source = "DebugWindow.qml" + + QGCButton { + anchors.left: parent.left + anchors.right: parent.right + text: "Debug" + visible: ScreenTools.isDebug + exclusiveGroup: panelActionGroup + onClicked: { + if(__rightPanel.source != "DebugWindow.qml") { + __rightPanel.source = "DebugWindow.qml" + } + checked = true } - checked = true } } } diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index b51908d115d1142f0e02d24eb61303f60fc9ced4..a4c8e27a9c7df78ab7aebb4a7e869e3bb85896b8 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -49,14 +49,13 @@ Rectangle { clip: true anchors.fill: parent contentHeight: settingsColumn.height - contentWidth: _generalRoot.width - flickableDirection: Flickable.VerticalFlick + contentWidth: settingsColumn.width Column { id: settingsColumn - width: _generalRoot.width anchors.margins: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelHeight / 2 + QGCLabel { text: "General Settings" font.pixelSize: ScreenTools.mediumFontPixelSize diff --git a/src/ui/preferences/LinkSettings.qml b/src/ui/preferences/LinkSettings.qml index dea6c1120c65cf2528c9bd6e62fe0f10891ac4cf..ae92e3073465278f728399b1dd0315b3cbe24e13 100644 --- a/src/ui/preferences/LinkSettings.qml +++ b/src/ui/preferences/LinkSettings.qml @@ -134,7 +134,6 @@ Rectangle { } } QGCButton { - width: ScreenTools.defaultFontPixelWidth * 10 text: "Edit" enabled: _currentSelection && !_currentSelection.link onClicked: { @@ -142,14 +141,12 @@ Rectangle { } } QGCButton { - width: ScreenTools.defaultFontPixelWidth * 10 text: "Add" onClicked: { _linkRoot.openCommSettings(null) } } QGCButton { - width: ScreenTools.defaultFontPixelWidth * 10 text: "Connect" enabled: _currentSelection && !_currentSelection.link onClicked: { @@ -158,7 +155,6 @@ Rectangle { } } QGCButton { - width: ScreenTools.defaultFontPixelWidth * 10 text: "Disconnect" enabled: _currentSelection && _currentSelection.link onClicked: { diff --git a/src/ui/preferences/MavlinkSettings.qml b/src/ui/preferences/MavlinkSettings.qml index bab7f760d395884c404d3100475273e9ec53f49b..f901bbeb59a043b7e06b8438fd4de245fe7b4830 100644 --- a/src/ui/preferences/MavlinkSettings.qml +++ b/src/ui/preferences/MavlinkSettings.qml @@ -48,14 +48,14 @@ Rectangle { anchors.fill: parent anchors.margins: ScreenTools.defaultFontPixelWidth contentHeight: settingsColumn.height - contentWidth: __mavlinkRoot.width - flickableDirection: Flickable.VerticalFlick + contentWidth: settingsColumn.width Column { id: settingsColumn - width: __mavlinkRoot.width spacing: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelWidth + anchors.left: parent.left + anchors.top: parent.top QGCLabel { text: "MavLink Settings" font.pixelSize: ScreenTools.mediumFontPixelSize diff --git a/src/ui/preferences/MockLink.qml b/src/ui/preferences/MockLink.qml index 7398aa59db6465289d848e97ec81b02952e3f71f..c6e9aeeaef82494c8ce0836b8efb0d0abd327727 100644 --- a/src/ui/preferences/MockLink.qml +++ b/src/ui/preferences/MockLink.qml @@ -29,39 +29,48 @@ import QGroundControl.Palette 1.0 import QGroundControl.ScreenTools 1.0 Rectangle { - color: qgcPal.window + color: qgcPal.window + anchors.fill: parent QGCPalette { id: qgcPal; colorGroupEnabled: true } - Column { - anchors.margins: ScreenTools.defaultFontPixelHeight - anchors.left: parent.left - anchors.top: parent.top - spacing: ScreenTools.defaultFontPixelHeight + QGCFlickable { + anchors.fill: parent + contentWidth: column.width + contentHeight: column.height + clip: true - QGCButton { - text: "PX4 Vehicle" - onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked) - } - QGCButton { - text: "APM ArduCopter Vehicle" - onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked) - } - QGCButton { - text: "APM ArduPlane Vehicle" - onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked) - } - QGCButton { - text: "Generic Vehicle" - onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked) - } - QGCCheckBox { - id: sendStatusText - text: "Send status text + voice" - } - QGCButton { - text: "Stop All MockLinks" - onClicked: QGroundControl.stopAllMockLinks() + Column { + id: column + anchors.margins: ScreenTools.defaultFontPixelHeight + anchors.left: parent.left + anchors.top: parent.top + spacing: ScreenTools.defaultFontPixelHeight + + QGCButton { + text: "PX4 Vehicle" + onClicked: QGroundControl.startPX4MockLink(sendStatusText.checked) + } + QGCButton { + text: "APM ArduCopter Vehicle" + onClicked: QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked) + } + QGCButton { + text: "APM ArduPlane Vehicle" + onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked) + } + QGCButton { + text: "Generic Vehicle" + onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked) + } + QGCCheckBox { + id: sendStatusText + text: "Send status text + voice" + } + QGCButton { + text: "Stop All MockLinks" + onClicked: QGroundControl.stopAllMockLinks() + } } } }