Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e66ae88b
Commit
e66ae88b
authored
May 01, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CheckBox, RadioButton mobile sizing
parent
08f54ff7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
10 deletions
+31
-10
QGCCheckBox.qml
src/QmlControls/QGCCheckBox.qml
+2
-2
QGCRadioButton.qml
src/QmlControls/QGCRadioButton.qml
+19
-1
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+10
-7
No files found.
src/QmlControls/QGCCheckBox.qml
View file @
e66ae88b
...
...
@@ -11,7 +11,7 @@ CheckBox {
style
:
CheckBoxStyle
{
label
:
Item
{
implicitWidth
:
text
.
implicitWidth
+
2
implicitHeight
:
text
.
implicit
Height
implicitHeight
:
ScreenTools
.
implicitCheckBox
Height
baselineOffset
:
text
.
baselineOffset
Rectangle
{
...
...
@@ -39,7 +39,7 @@ CheckBox {
}
// label
indicator
:
Item
{
implicitWidth
:
ScreenTools
.
implicitCheckBoxWidth
implicitWidth
:
ScreenTools
.
checkBoxIndicatorSize
implicitHeight
:
implicitWidth
Rectangle
{
...
...
src/QmlControls/QGCRadioButton.qml
View file @
e66ae88b
...
...
@@ -15,7 +15,7 @@ RadioButton {
style
:
RadioButtonStyle
{
label
:
Item
{
implicitWidth
:
text
.
implicitWidth
+
ScreenTools
.
defaultFontPixelWidth
*
0.25
implicitHeight
:
text
.
implicit
Height
implicitHeight
:
ScreenTools
.
implicitRadioButton
Height
baselineOffset
:
text
.
y
+
text
.
baselineOffset
Rectangle
{
...
...
@@ -43,5 +43,23 @@ RadioButton {
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
}
}
}
}
src/QmlControls/ScreenTools.qml
View file @
e66ae88b
...
...
@@ -64,13 +64,16 @@ Item {
property
real
minTouchPixels
:
0
///< Minimum touch size in pixels
// The implicit heights/widths for our custom control set
property
real
implicitButtonWidth
:
Math
.
round
(
defaultFontPixelWidth
*
(
isMobile
?
7.0
:
5.0
))
property
real
implicitButtonHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitCheckBoxWidth
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
1.5
:
1.0
))
property
real
implicitTextFieldHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitComboBoxHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitComboBoxWidth
:
Math
.
round
(
defaultFontPixelWidth
*
(
isMobile
?
7.0
:
5.0
))
property
real
implicitSliderHeight
:
isMobile
?
Math
.
max
(
defaultFontPixelHeight
,
minTouchPixels
)
:
defaultFontPixelHeight
property
real
implicitButtonWidth
:
Math
.
round
(
defaultFontPixelWidth
*
(
isMobile
?
7.0
:
5.0
))
property
real
implicitButtonHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitCheckBoxHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.0
))
property
real
implicitRadioButtonHeight
:
implicitCheckBoxHeight
property
real
implicitTextFieldHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
property
real
implicitComboBoxHeight
:
Math
.
round
(
defaultFontPixelHeight
*
(
isMobile
?
2.0
:
1.6
))
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
demiboldFontFamily
:
"
opensans-demibold
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment