diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index a4360b72fab2060b6971d52d5e22dac224c2be99..5f0c4265d0ad54d6ff0a120376ec61e3a621a8fb 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -41,6 +41,9 @@ QGCView { property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30 property Fact _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider property Fact _mapType: QGroundControl.settingsManager.flightMapSettings.mapType + property real _panelWidth: _qgcView.width * _internalWidthRatio + + readonly property real _internalWidthRatio: 0.8 readonly property string _requiresRestart: qsTr("(Requires Restart)") @@ -63,7 +66,7 @@ QGCView { //----------------------------------------------------------------- //-- Units Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: unitLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -76,7 +79,7 @@ QGCView { } Rectangle { height: unitsCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -115,7 +118,7 @@ QGCView { //----------------------------------------------------------------- //-- Miscellaneous Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: miscLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -128,7 +131,7 @@ QGCView { } Rectangle { height: miscCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -359,7 +362,7 @@ QGCView { //----------------------------------------------------------------- //-- Save path - Row { + RowLayout { spacing: ScreenTools.defaultFontPixelWidth visible: _savePath.visible && !ScreenTools.isMobile @@ -368,8 +371,10 @@ QGCView { text: qsTr("File Save Path:") } QGCLabel { - anchors.baseline: savePathBrowse.baseline - text: _savePath.rawValue === "" ? qsTr("") : _savePath.value + anchors.baseline: savePathBrowse.baseline + Layout.maximumWidth: _panelWidth * 0.5 + elide: Text.ElideMiddle + text: _savePath.rawValue === "" ? qsTr("") : _savePath.value } QGCButton { id: savePathBrowse @@ -394,7 +399,7 @@ QGCView { //----------------------------------------------------------------- //-- RTK GPS Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: unitLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -407,7 +412,7 @@ QGCView { } Rectangle { height: rtkGrid.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -438,7 +443,7 @@ QGCView { //----------------------------------------------------------------- //-- Autoconnect settings Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: autoConnectLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -451,7 +456,7 @@ QGCView { } Rectangle { height: autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -490,7 +495,7 @@ QGCView { //----------------------------------------------------------------- //-- Video Source Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: videoLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -503,7 +508,7 @@ QGCView { } Rectangle { height: videoCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -605,7 +610,7 @@ QGCView { //----------------------------------------------------------------- //-- Video Source Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: videoRecLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -618,7 +623,7 @@ QGCView { } Rectangle { height: videoRecCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -676,7 +681,7 @@ QGCView { //----------------------------------------------------------------- //-- Custom Brand Image Item { - width: _qgcView.width * 0.8 + width: _panelWidth height: userBrandImageLabel.height anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter @@ -689,7 +694,7 @@ QGCView { } Rectangle { height: userBrandImageCol.height + (ScreenTools.defaultFontPixelHeight * 2) - width: _qgcView.width * 0.8 + width: _panelWidth color: qgcPal.windowShade anchors.margins: ScreenTools.defaultFontPixelWidth anchors.horizontalCenter: parent.horizontalCenter