From 32471f91bcd9b84164a6ccafbdf4f6c914361efc Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Wed, 4 May 2016 21:44:38 -0400 Subject: [PATCH] Done with Mac OS --- src/FlightMap/Widgets/ValuesWidget.qml | 26 +++++++++---------- src/QmlControls/QGCButton.qml | 10 +++---- src/QmlControls/QGCComboBox.qml | 4 +-- src/QmlControls/QGCTextField.qml | 2 +- .../QMLControl/OfflineMap.qml | 23 ++++++++-------- src/VehicleSetup/VehicleSummary.qml | 2 +- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/FlightMap/Widgets/ValuesWidget.qml b/src/FlightMap/Widgets/ValuesWidget.qml index 8d3e5f9f7..e2c5ed1a9 100644 --- a/src/FlightMap/Widgets/ValuesWidget.qml +++ b/src/FlightMap/Widgets/ValuesWidget.qml @@ -124,7 +124,7 @@ QGCFlickable { QGCLabel { width: parent.width horizontalAlignment: Text.AlignHCenter - font.pointSize: ScreenTools.smallFontPointSize * 0.75 + font.pointSize: ScreenTools.isTinyScreen ? ScreenTools.smallFontPointSize * 0.75 : ScreenTools.smallFontPointSize fontSizeMode: Text.HorizontalFit color: textColor text: fact.shortDescription @@ -139,7 +139,7 @@ QGCFlickable { QGCLabel { width: parent.width horizontalAlignment: Text.AlignHCenter - font.pointSize: ScreenTools.smallFontPointSize * 0.75 + font.pointSize: ScreenTools.isTinyScreen ? ScreenTools.smallFontPointSize * 0.75 : ScreenTools.smallFontPointSize fontSizeMode: Text.HorizontalFit color: textColor text: fact.units @@ -245,20 +245,20 @@ QGCFlickable { } QGCCheckBox { - id: _addCheckBox - text: factGroup.getFact(modelData).shortDescription - checked: _largeCheckBox.checked || listContains(controller.smallValues, propertyName) - onClicked: updateValues() + id: _addCheckBox + text: factGroup.getFact(modelData).shortDescription + checked: listContains(controller.smallValues, propertyName) || _largeCheckBox.checked + onClicked: updateValues() Layout.fillWidth: true Layout.minimumWidth: ScreenTools.defaultFontPixelWidth * 20 } QGCCheckBox { - id: _largeCheckBox - text: qsTr("Large") - checked: listContains(controller.largeValues, propertyName) - enabled: _addCheckBox.checked - onClicked: updateValues() + id: _largeCheckBox + text: qsTr("Large") + checked: listContains(controller.largeValues, propertyName) + enabled: _addCheckBox.checked + onClicked: updateValues() } } } @@ -267,12 +267,10 @@ QGCFlickable { Repeater { model: factGroup ? factGroup.factGroupNames : 0 - Loader { sourceComponent: factGroupList - property var factGroup: _root ? _root.parent.factGroup.getFactGroup(modelData) : undefined - property string factGroupName: _root ? _root.parent.factGroupName + "." + modelData : undefined + property string factGroupName: _root ? _root.parent.factGroupName + "." + modelData : "" } } } diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml index 3454e0cfb..b9b5e1867 100644 --- a/src/QmlControls/QGCButton.qml +++ b/src/QmlControls/QGCButton.qml @@ -12,7 +12,7 @@ Button { property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff - property bool _showBorder: _qgcPal.globalTheme == QGCPalette.Light + property bool _showBorder: _qgcPal.globalTheme === QGCPalette.Light // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn @@ -43,7 +43,7 @@ Button { repeat: true onTriggered: { - __forceHoverOff = (__lastGlobalMouseX != ScreenTools.mouseX() || __lastGlobalMouseY != ScreenTools.mouseY()); + __forceHoverOff = (__lastGlobalMouseX !== ScreenTools.mouseX() || __lastGlobalMouseY !== ScreenTools.mouseY()); } } @@ -52,15 +52,15 @@ Button { padding { top: 4 left: 4 - right: control.menu !== null ? Math.round(TextSingleton.implicitHeight * 0.5) : 4 + right: control.menu !== null ? Math.round(ScreenTools.defaultFontPixelHeight * 0.5) : 4 bottom: 4 } /*! This defines the background of the button. */ background: Item { property bool down: control.pressed || (control.checkable && control.checked) - implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) - implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) + implicitWidth: Math.round(ScreenTools.defaultFontPixelWidth * 4.5) + implicitHeight: Math.max(25, Math.round(ScreenTools.defaultFontPixelHeight * 1.2)) Rectangle { anchors.fill: parent diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml index f91a12d5a..032136aac 100644 --- a/src/QmlControls/QGCComboBox.qml +++ b/src/QmlControls/QGCComboBox.qml @@ -18,8 +18,8 @@ ComboBox { control._qgcPal.buttonText background: Item { - implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) - implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) + implicitWidth: Math.round(ScreenTools.defaultFontPixelWidth * 4.5) + implicitHeight: Math.max(25, Math.round(ScreenTools.defaultFontPixelHeight * 1.2)) Rectangle { anchors.fill: parent diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml index 1f6990bb9..bd652405b 100644 --- a/src/QmlControls/QGCTextField.qml +++ b/src/QmlControls/QGCTextField.qml @@ -20,7 +20,7 @@ TextField { property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } textColor: __qgcPal.textFieldText - height: Math.max(25, Math.round(unitsLabel.implicitHeight * 1.2)) + height: Math.max(25, Math.round(ScreenTools.defaultFontPixelHeight * 1.2)) Label { id: unitsLabelWidthGenerator diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index 75da0332e..70607cb92 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -40,9 +40,9 @@ Rectangle { anchors.fill: parent anchors.margins: ScreenTools.defaultFontPixelWidth - property var _currentSelection: null + property var _currentSelection: null - property string mapKey: "lastMapType" + property string mapKey: "lastMapType" property string mapType: QGroundControl.mapEngineManager.loadSetting(mapKey, "Google Street Map") property int mapMargin: (ScreenTools.defaultFontPixelHeight * 0.2).toFixed(0) @@ -53,9 +53,9 @@ Rectangle { property real savedZoom: 3 property string savedMapType: "" - property real _newSetMiddleLabel: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 10 : ScreenTools.defaultFontPixelWidth * 14 + property real _newSetMiddleLabel: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 10 : ScreenTools.defaultFontPixelWidth * 12 property real _newSetMiddleField: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 16 : ScreenTools.defaultFontPixelWidth * 20 - property real _netSetSliderWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 8 : ScreenTools.defaultFontPixelWidth * 14 + property real _netSetSliderWidth: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelWidth * 8 : ScreenTools.defaultFontPixelWidth * 16 property real oldlon0: 0 property real oldlon1: 0 @@ -1056,7 +1056,7 @@ Rectangle { } Rectangle { id: optionsRect - width: optionsGrid.width + (ScreenTools.defaultFontPixelWidth * 4) + width: optionsGrid.width + (ScreenTools.defaultFontPixelWidth * 4) height: optionsGrid.height + (ScreenTools.defaultFontPixelHeight * 4) color: qgcPal.window radius: ScreenTools.defaultFontPixelHeight * 0.5 @@ -1089,17 +1089,17 @@ Rectangle { Item { Layout.columnSpan: 2 Layout.fillWidth: true - implicitHeight: ScreenTools.defaultFontPixelHeight * 1.5 + height: ScreenTools.defaultFontPixelHeight * 1.5 QGCLabel { anchors.centerIn: parent text: qsTr("Memory cache changes require a restart to take effect.") - font.pointSize: ScreenTools.defaultFontPointSize * 0.85 + font.pointSize: ScreenTools.smallFontPointSize } } Rectangle { Layout.columnSpan: 2 Layout.fillWidth: true - implicitHeight: 1 + height: 1 color: qgcPal.text } QGCLabel { @@ -1107,18 +1107,17 @@ Rectangle { } QGCTextField { id: mapBoxToken - Layout.fillWidth: true maximumLength: 256 - implicitWidth : ScreenTools.defaultFontPixelWidth * 30 + width: ScreenTools.defaultFontPixelWidth * 30 } Item { Layout.columnSpan: 2 Layout.fillWidth: true - implicitHeight: ScreenTools.defaultFontPixelHeight * 1.5 + height: ScreenTools.defaultFontPixelHeight * 1.5 QGCLabel { anchors.centerIn: parent text: qsTr("With an access token, you can use MapBox Maps.") - font.pointSize: ScreenTools.defaultFontPointSize * 0.85 + font.pointSize: ScreenTools.smallFontPointSize } } } diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index ae430eccf..cdf5432af 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -39,7 +39,7 @@ Rectangle { anchors.leftMargin: ScreenTools.defaultFontPixelWidth color: qgcPal.window - property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 42 + property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 36 property real _summaryBoxWidth: _minSummaryW property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth * 2 -- 2.22.0