Commit e66ae88b authored by DonLakeFlyer's avatar DonLakeFlyer

CheckBox, RadioButton mobile sizing

parent 08f54ff7
...@@ -11,7 +11,7 @@ CheckBox { ...@@ -11,7 +11,7 @@ CheckBox {
style: CheckBoxStyle { style: CheckBoxStyle {
label: Item { label: Item {
implicitWidth: text.implicitWidth + 2 implicitWidth: text.implicitWidth + 2
implicitHeight: text.implicitHeight implicitHeight: ScreenTools.implicitCheckBoxHeight
baselineOffset: text.baselineOffset baselineOffset: text.baselineOffset
Rectangle { Rectangle {
...@@ -39,7 +39,7 @@ CheckBox { ...@@ -39,7 +39,7 @@ CheckBox {
} // label } // label
indicator: Item { indicator: Item {
implicitWidth: ScreenTools.implicitCheckBoxWidth implicitWidth: ScreenTools.checkBoxIndicatorSize
implicitHeight: implicitWidth implicitHeight: implicitWidth
Rectangle { Rectangle {
......
...@@ -15,7 +15,7 @@ RadioButton { ...@@ -15,7 +15,7 @@ RadioButton {
style: RadioButtonStyle { style: RadioButtonStyle {
label: Item { label: Item {
implicitWidth: text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25 implicitWidth: text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25
implicitHeight: text.implicitHeight implicitHeight: ScreenTools.implicitRadioButtonHeight
baselineOffset: text.y + text.baselineOffset baselineOffset: text.y + text.baselineOffset
Rectangle { Rectangle {
...@@ -43,5 +43,23 @@ RadioButton { ...@@ -43,5 +43,23 @@ RadioButton {
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
indicator: Rectangle {
width: ScreenTools.radioButtonIndicatorSize
height: width
border.color: qgcPal.text
antialiasing: true
radius: height / 2
Rectangle {
anchors.centerIn: parent
width: Math.round(parent.width * 0.5)
height: width
antialiasing: true
radius: height/2
color: qgcPal.text
opacity: control.checked ? (control.enabled ? 1 : 0.5) : 0
}
}
} }
} }
...@@ -64,13 +64,16 @@ Item { ...@@ -64,13 +64,16 @@ Item {
property real minTouchPixels: 0 ///< Minimum touch size in pixels property real minTouchPixels: 0 ///< Minimum touch size in pixels
// The implicit heights/widths for our custom control set // The implicit heights/widths for our custom control set
property real implicitButtonWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0)) property real implicitButtonWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0))
property real implicitButtonHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6)) property real implicitButtonHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
property real implicitCheckBoxWidth: Math.round(defaultFontPixelHeight * (isMobile ? 1.5 : 1.0)) property real implicitCheckBoxHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.0))
property real implicitTextFieldHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6)) property real implicitRadioButtonHeight: implicitCheckBoxHeight
property real implicitComboBoxHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6)) property real implicitTextFieldHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
property real implicitComboBoxWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0)) property real implicitComboBoxHeight: Math.round(defaultFontPixelHeight * (isMobile ? 2.0 : 1.6))
property real implicitSliderHeight: isMobile ? Math.max(defaultFontPixelHeight, minTouchPixels) : defaultFontPixelHeight property real implicitComboBoxWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0))
property real implicitSliderHeight: isMobile ? Math.max(defaultFontPixelHeight, minTouchPixels) : defaultFontPixelHeight
property real checkBoxIndicatorSize: Math.round(defaultFontPixelHeight * (isMobile ? 1.5 : 1.0))
property real radioButtonIndicatorSize: checkBoxIndicatorSize
readonly property string normalFontFamily: "opensans" readonly property string normalFontFamily: "opensans"
readonly property string demiboldFontFamily: "opensans-demibold" readonly property string demiboldFontFamily: "opensans-demibold"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment