Skip to content

Commit cc895fa

Browse files
committed
Adjust mobile control sizing to match desktop
No need to increases the sizes, they are very "touchable" using standard desktop sizing
1 parent a86279a commit cc895fa

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/QmlControls/QGCSlider.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Slider {
6262
border.width: 1
6363
radius: _radius
6464

65-
property real _radius: ScreenTools.isMobile ? ScreenTools.minTouchPixels / 2 : ScreenTools.defaultFontPixelHeight / 2
65+
property real _radius: ScreenTools.defaultFontPixelHeight / 2
6666

6767
Label {
6868
text: control.value.toFixed( control.to <= 1 ? 1 : 0)

src/QmlControls/ScreenTools.qml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,20 @@ Item {
103103
property real minTouchPixels: 0 ///< Minimum touch size in pixels (calculatedd from minTouchMillimeters and realPixelDensity)
104104

105105
// The implicit heights/widths for our custom control set
106-
property real implicitButtonWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0))
107-
property real implicitButtonHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
108-
property real implicitCheckBoxHeight: Math.round(defaultFontPixelHeight * (isMobile ? 1.2 : 1.0))
106+
property real implicitButtonWidth: Math.round(defaultFontPixelWidth * 5.0)
107+
property real implicitButtonHeight: Math.round(defaultFontPixelHeight * 1.6)
108+
property real implicitCheckBoxHeight: Math.round(defaultFontPixelHeight * 1.0)
109109
property real implicitRadioButtonHeight: implicitCheckBoxHeight
110110
property real implicitTextFieldWidth: defaultFontPixelWidth * 13
111-
property real implicitTextFieldHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
112-
property real implicitComboBoxHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
113-
property real implicitComboBoxWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0))
111+
property real implicitTextFieldHeight: implicitButtonHeight
112+
property real implicitComboBoxHeight: implicitButtonHeight
113+
property real implicitComboBoxWidth: implicitButtonWidth
114114
property real comboBoxPadding: defaultFontPixelWidth
115-
property real implicitSliderHeight: isMobile ? Math.max(defaultFontPixelHeight, minTouchPixels) : defaultFontPixelHeight
115+
property real implicitSliderHeight: defaultFontPixelHeight
116116
property real defaultBorderRadius: defaultFontPixelWidth / 2
117+
117118
// It's not possible to centralize an even number of pixels, checkBoxIndicatorSize should be an odd number to allow centralization
118-
property real checkBoxIndicatorSize: 2 * Math.floor(defaultFontPixelHeight * (isMobile ? 1.5 : 1.0) / 2) + 1
119+
property real checkBoxIndicatorSize: 2 * Math.floor(defaultFontPixelHeight / 2) + 1
119120
property real radioButtonIndicatorSize: checkBoxIndicatorSize
120121

121122
readonly property string normalFontFamily: ScreenToolsController.normalFontFamily

0 commit comments

Comments
 (0)