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
5b54450d
Commit
5b54450d
authored
Jun 08, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed all fonts to pixel sizes
parent
0ac8e637
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
282 additions
and
374 deletions
+282
-374
style-dark.css
resources/styles/style-dark.css
+11
-8
AirframeComponent.qml
src/AutoPilotPlugins/PX4/AirframeComponent.qml
+2
-2
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+2
-2
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+6
-6
RadioComponent.qml
src/AutoPilotPlugins/PX4/RadioComponent.qml
+1
-1
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+5
-5
SensorsComponent.qml
src/AutoPilotPlugins/PX4/SensorsComponent.qml
+9
-9
QGCApplication.cc
src/QGCApplication.cc
+9
-26
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+4
-4
QGCButton.qml
src/QmlControls/QGCButton.qml
+1
-1
QGCCheckBox.qml
src/QmlControls/QGCCheckBox.qml
+1
-1
QGCComboBox.qml
src/QmlControls/QGCComboBox.qml
+1
-1
QGCLabel.qml
src/QmlControls/QGCLabel.qml
+1
-1
QGCRadioButton.qml
src/QmlControls/QGCRadioButton.qml
+1
-1
QGCTextField.qml
src/QmlControls/QGCTextField.qml
+1
-1
QmlTest.qml
src/QmlControls/QmlTest.qml
+32
-0
ScreenTools.cc
src/QmlControls/ScreenTools.cc
+41
-77
ScreenTools.h
src/QmlControls/ScreenTools.h
+86
-35
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+1
-1
VehicleRotationCal.qml
src/QmlControls/VehicleRotationCal.qml
+2
-4
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+3
-3
SetupView.qml
src/VehicleSetup/SetupView.qml
+2
-2
VehicleSummary.qml
src/VehicleSetup/VehicleSummary.qml
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+0
-43
MainWindow.h
src/ui/MainWindow.h
+0
-17
FlightDisplay.cc
src/ui/flightdisplay/FlightDisplay.cc
+3
-3
FlightDisplay.qml
src/ui/flightdisplay/FlightDisplay.qml
+0
-57
QGCMapDisplay.cc
src/ui/mapdisplay/QGCMapDisplay.cc
+3
-3
QGCCompassInstrument.qml
src/ui/qmlcommon/QGCCompassInstrument.qml
+2
-2
QGCPitchWidget.qml
src/ui/qmlcommon/QGCPitchWidget.qml
+3
-3
QGCSlider.qml
src/ui/qmlcommon/QGCSlider.qml
+1
-1
QGCWaypoint.qml
src/ui/qmlcommon/QGCWaypoint.qml
+1
-1
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+0
-8
MainToolBar.h
src/ui/toolbar/MainToolBar.h
+0
-1
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+14
-14
UASQuickView.cc
src/ui/uas/UASQuickView.cc
+10
-7
UASQuickViewTextItem.cc
src/ui/uas/UASQuickViewTextItem.cc
+21
-21
No files found.
resources/styles/style-dark.css
View file @
5b54450d
...
@@ -2,12 +2,16 @@
...
@@ -2,12 +2,16 @@
This is the master style sheet as well as the dark style. This style sheet should contain both
This is the master style sheet as well as the dark style. This style sheet should contain both
color and size/positioning information for all styled controls. This sheet is always loaded first
color and size/positioning information for all styled controls. This sheet is always loaded first
Then the user specified style sheet is loaded after it to override and color settings.
Then the user specified style sheet is loaded after it to override and color settings.
Font sizes are defined with tokens, which are parsed and replaced at run time.
*/
*/
*
{
*
{
background-color
:
#222
;
background-color
:
#222
;
color
:
#FFF
;
color
:
#FFF
;
font-size
:
12pt
;
font-size
:
FONT_NORMAL
;
font-weight
:
lighter
;
}
}
QWidget
#viewModeWidget
{
QWidget
#viewModeWidget
{
...
@@ -128,7 +132,7 @@ QGroupBox::title {
...
@@ -128,7 +132,7 @@ QGroupBox::title {
subcontrol-position
:
top
center
;
subcontrol-position
:
top
center
;
margin
:
0
3px
0
3px
;
margin
:
0
3px
0
3px
;
padding
:
0
3px
0
0
;
padding
:
0
3px
0
0
;
font
:
bold
8px
;
font
:
bold
FONT_SMALL
;
color
:
#DDD
;
color
:
#DDD
;
}
}
...
@@ -149,7 +153,7 @@ QLabel:disabled {
...
@@ -149,7 +153,7 @@ QLabel:disabled {
}
}
QLabel
#noUas
{
QLabel
#noUas
{
font-size
:
30pt
;
font-size
:
FONT_LARGE
;
}
}
QMessageBox
{
QMessageBox
{
...
@@ -158,7 +162,7 @@ QMessageBox {
...
@@ -158,7 +162,7 @@ QMessageBox {
}
}
QLabel
#tabTitleLabel
{
QLabel
#tabTitleLabel
{
font-size
:
28pt
;
font-size
:
FONT_LARGE
;
font-weight
:
lighter
;
font-weight
:
lighter
;
margin-top
:
16px
;
margin-top
:
16px
;
margin-bottom
:
8px
;
margin-bottom
:
8px
;
...
@@ -166,7 +170,7 @@ QLabel#tabTitleLabel {
...
@@ -166,7 +170,7 @@ QLabel#tabTitleLabel {
QLabel
#instructionLabel
{
QLabel
#instructionLabel
{
color
:
#FEC654
;
color
:
#FEC654
;
font-size
:
26pt
;
font-size
:
FONT_LARGE
;
}
}
QLineEdit
{
QLineEdit
{
...
@@ -226,7 +230,7 @@ QPlainTextEdit {
...
@@ -226,7 +230,7 @@ QPlainTextEdit {
border
:
1px
solid
#777
;
border
:
1px
solid
#777
;
border-radius
:
2px
;
border-radius
:
2px
;
font-family
:
"Monospace"
;
font-family
:
"Monospace"
;
font
:
large
;
font
:
FONT_SMALL
;
}
}
QProgressBar
{
QProgressBar
{
...
@@ -529,11 +533,10 @@ UASQuickViewItem QLabel {
...
@@ -529,11 +533,10 @@ UASQuickViewItem QLabel {
padding
:
0
;
padding
:
0
;
margin
:
0
;
margin
:
0
;
min-height
:
1em
;
min-height
:
1em
;
font-weight
:
bold
;
}
}
UASQuickViewItem
QLabel
#value
{
UASQuickViewItem
QLabel
#value
{
font-size
:
20pt
;
font-size
:
FONT_LARGE
;
}
}
UASView
{
UASView
{
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.qml
View file @
5b54450d
...
@@ -97,7 +97,7 @@ QGCView {
...
@@ -97,7 +97,7 @@ QGCView {
QGCLabel
{
QGCLabel
{
id
:
header
id
:
header
width
:
parent
.
width
width
:
parent
.
width
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
text
:
"
AIRFRAME CONFIG
"
text
:
"
AIRFRAME CONFIG
"
}
}
...
@@ -225,4 +225,4 @@ QGCView {
...
@@ -225,4 +225,4 @@ QGCView {
}
// Flow - summary boxes
}
// Flow - summary boxes
}
// Scroll View - summary boxes
}
// Scroll View - summary boxes
}
// QGCViewPanel
}
// QGCViewPanel
}
// QGCView
}
// QGCView
\ No newline at end of file
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
5b54450d
...
@@ -384,7 +384,7 @@ Item {
...
@@ -384,7 +384,7 @@ Item {
QGCLabel
{
QGCLabel
{
text
:
"
FLIGHT MODES CONFIG
"
text
:
"
FLIGHT MODES CONFIG
"
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
}
}
Item
{
height
:
20
;
width
:
10
}
// spacer
Item
{
height
:
20
;
width
:
10
}
// spacer
...
@@ -973,7 +973,7 @@ Item {
...
@@ -973,7 +973,7 @@ Item {
QGCLabel
{
QGCLabel
{
text
:
"
FLIGHT MODES CONFIG
"
text
:
"
FLIGHT MODES CONFIG
"
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
20
)
;
font.p
ixelSize
:
ScreenTools
.
font20
;
}
}
QGCLabel
{
QGCLabel
{
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
5b54450d
...
@@ -115,12 +115,12 @@ QGCView {
...
@@ -115,12 +115,12 @@ QGCView {
QGCLabel
{
QGCLabel
{
text
:
"
POWER CONFIG
"
text
:
"
POWER CONFIG
"
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
}
}
QGCLabel
{
QGCLabel
{
text
:
"
Battery
"
text
:
"
Battery
"
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
}
}
Rectangle
{
Rectangle
{
...
@@ -234,7 +234,7 @@ QGCView {
...
@@ -234,7 +234,7 @@ QGCView {
QGCLabel
{
QGCLabel
{
text
:
"
ESC Calibration
"
text
:
"
ESC Calibration
"
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
}
}
Rectangle
{
Rectangle
{
...
@@ -269,7 +269,7 @@ QGCView {
...
@@ -269,7 +269,7 @@ QGCView {
width: (parent.width / 2) - 5
width: (parent.width / 2) - 5
QGCLabel {
QGCLabel {
text: "Propeller Function"
text: "Propeller Function"
font.p
ointSize: ScreenTools.fontPointFactor * (20)
;
font.p
ixelSize: ScreenTools.font20
;
}
}
Rectangle {
Rectangle {
width: parent.width
width: parent.width
...
@@ -282,7 +282,7 @@ QGCView {
...
@@ -282,7 +282,7 @@ QGCView {
width: (parent.width / 2) - 5
width: (parent.width / 2) - 5
QGCLabel {
QGCLabel {
text: "Magnetometer Distortion"
text: "Magnetometer Distortion"
font.p
ointSize: ScreenTools.fontPointFactor * (20)
;
font.p
ixelSize: ScreenTools.font20
;
}
}
Rectangle {
Rectangle {
width: parent.width
width: parent.width
...
@@ -301,7 +301,7 @@ QGCView {
...
@@ -301,7 +301,7 @@ QGCView {
}
}
QGCLabel
{
QGCLabel
{
text
:
"
Advanced Power Settings
"
text
:
"
Advanced Power Settings
"
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
20
)
;
font.p
ixelSize
:
ScreenTools
.
font20
;
visible
:
showAdvanced
.
checked
visible
:
showAdvanced
.
checked
}
}
Rectangle
{
Rectangle
{
...
...
src/AutoPilotPlugins/PX4/RadioComponent.qml
View file @
5b54450d
...
@@ -258,7 +258,7 @@ QGCView {
...
@@ -258,7 +258,7 @@ QGCView {
QGCLabel
{
QGCLabel
{
id
:
header
id
:
header
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
text
:
"
RADIO CONFIG
"
text
:
"
RADIO CONFIG
"
}
}
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
5b54450d
...
@@ -52,7 +52,7 @@ FactPanel {
...
@@ -52,7 +52,7 @@ FactPanel {
QGCLabel
{
QGCLabel
{
text
:
"
SAFETY CONFIG
"
text
:
"
SAFETY CONFIG
"
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
}
}
Item
{
height
:
20
;
width
:
10
}
// spacer
Item
{
height
:
20
;
width
:
10
}
// spacer
...
@@ -60,7 +60,7 @@ FactPanel {
...
@@ -60,7 +60,7 @@ FactPanel {
//-----------------------------------------------------------------
//-----------------------------------------------------------------
//-- Return Home Triggers
//-- Return Home Triggers
QGCLabel
{
text
:
"
Triggers For Return Home
"
;
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
;
}
QGCLabel
{
text
:
"
Triggers For Return Home
"
;
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
;
}
Item
{
height
:
10
;
width
:
10
}
// spacer
Item
{
height
:
10
;
width
:
10
}
// spacer
...
@@ -119,7 +119,7 @@ FactPanel {
...
@@ -119,7 +119,7 @@ FactPanel {
//-----------------------------------------------------------------
//-----------------------------------------------------------------
//-- Return Home Settings
//-- Return Home Settings
QGCLabel
{
text
:
"
Return Home Settings
"
;
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
;
}
QGCLabel
{
text
:
"
Return Home Settings
"
;
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
;
}
Item
{
height
:
10
;
width
:
10
}
// spacer
Item
{
height
:
10
;
width
:
10
}
// spacer
...
@@ -290,7 +290,7 @@ FactPanel {
...
@@ -290,7 +290,7 @@ FactPanel {
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
width
:
parent
.
width
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
text
:
"
Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.
"
;
text
:
"
Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.
"
;
visible
:
fact
.
value
!==
0
visible
:
fact
.
value
!==
0
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
...
@@ -300,7 +300,7 @@ FactPanel {
...
@@ -300,7 +300,7 @@ FactPanel {
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
width
:
parent
.
width
font.p
ointSize
:
ScreenTools
.
mediumFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
mediumFontPixel
Size
text
:
"
Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.
"
;
text
:
"
Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.
"
;
visible
:
fact
.
value
!==
0
visible
:
fact
.
value
!==
0
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.qml
View file @
5b54450d
...
@@ -57,8 +57,8 @@ QGCView {
...
@@ -57,8 +57,8 @@ QGCView {
// Used to pass help text to the preCalibrationDialog dialog
// Used to pass help text to the preCalibrationDialog dialog
property
string
preCalibrationDialogHelp
property
string
preCalibrationDialogHelp
readonly
property
int
sideBarH1PointSize
:
(
ScreenTools
.
defaultFontP
oint
Size
*
1.3
+
0.5
)
readonly
property
int
sideBarH1PointSize
:
(
ScreenTools
.
defaultFontP
izel
Size
*
1.3
+
0.5
)
readonly
property
int
mainTextH1PointSize
:
(
ScreenTools
.
defaultFontP
oint
Size
*
1.5
+
0.5
)
readonly
property
int
mainTextH1PointSize
:
(
ScreenTools
.
defaultFontP
izel
Size
*
1.5
+
0.5
)
readonly
property
int
rotationColumnWidth
:
250
readonly
property
int
rotationColumnWidth
:
250
readonly
property
var
rotations
:
[
readonly
property
var
rotations
:
[
...
@@ -213,7 +213,7 @@ QGCView {
...
@@ -213,7 +213,7 @@ QGCView {
id
:
compass0ComponentLabel
id
:
compass0ComponentLabel
QGCLabel
{
QGCLabel
{
font.p
oint
Size
:
sideBarH1PointSize
font.p
ixel
Size
:
sideBarH1PointSize
text
:
"
External Compass Orientation
"
text
:
"
External Compass Orientation
"
}
}
...
@@ -280,7 +280,7 @@ QGCView {
...
@@ -280,7 +280,7 @@ QGCView {
QGCLabel
{
QGCLabel
{
text
:
"
SENSORS CONFIG
"
text
:
"
SENSORS CONFIG
"
font.p
ointSize
:
ScreenTools
.
largeFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
largeFontPixel
Size
}
}
Item
{
height
:
20
;
width
:
10
}
// spacer
Item
{
height
:
20
;
width
:
10
}
// spacer
...
@@ -408,7 +408,7 @@ QGCView {
...
@@ -408,7 +408,7 @@ QGCView {
id
:
orientationCalAreaHelpText
id
:
orientationCalAreaHelpText
width
:
parent
.
width
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
22
)
;
font.p
ixelSize
:
ScreenTools
.
font22
;
anchors.top
:
orientationCalArea
.
top
anchors.top
:
orientationCalArea
.
top
anchors.left
:
orientationCalArea
.
left
anchors.left
:
orientationCalArea
.
left
anchors.topMargin
:
15
anchors.topMargin
:
15
...
@@ -480,7 +480,7 @@ QGCView {
...
@@ -480,7 +480,7 @@ QGCView {
spacing
:
5
spacing
:
5
QGCLabel
{
QGCLabel
{
font.p
oint
Size
:
sideBarH1PointSize
font.p
ixel
Size
:
sideBarH1PointSize
text
:
"
Autopilot Orientation
"
text
:
"
Autopilot Orientation
"
}
}
...
@@ -506,7 +506,7 @@ QGCView {
...
@@ -506,7 +506,7 @@ QGCView {
id
:
compass0ComponentLabel2
id
:
compass0ComponentLabel2
QGCLabel
{
QGCLabel
{
font.p
oint
Size
:
sideBarH1PointSize
font.p
ixel
Size
:
sideBarH1PointSize
text
:
"
External Compass Orientation
"
text
:
"
External Compass Orientation
"
}
}
}
}
...
@@ -531,7 +531,7 @@ QGCView {
...
@@ -531,7 +531,7 @@ QGCView {
id
:
compass1ComponentLabel2
id
:
compass1ComponentLabel2
QGCLabel
{
QGCLabel
{
font.p
oint
Size
:
sideBarH1PointSize
font.p
ixel
Size
:
sideBarH1PointSize
text
:
"
External Compass 1 Orientation
"
text
:
"
External Compass 1 Orientation
"
}
}
}
}
...
@@ -556,7 +556,7 @@ QGCView {
...
@@ -556,7 +556,7 @@ QGCView {
id
:
compass2ComponentLabel2
id
:
compass2ComponentLabel2
QGCLabel
{
QGCLabel
{
font.p
oint
Size
:
sidebarH1PointSize
font.p
ixel
Size
:
sidebarH1PointSize
text
:
"
Compass 2 Orientation
"
text
:
"
Compass 2 Orientation
"
}
}
}
}
...
...
src/QGCApplication.cc
View file @
5b54450d
...
@@ -655,33 +655,16 @@ void QGCApplication::_loadCurrentStyle(void)
...
@@ -655,33 +655,16 @@ void QGCApplication::_loadCurrentStyle(void)
}
}
}
}
// Now that we have the styles loaded we need to dpi adjust the font point sizes
// Now that we have the styles loaded we need to adjust the font sizes.
QString
dpiAdjustedStyles
;
if
(
success
)
{
QTextStream
styleStream
(
&
styles
,
QIODevice
::
ReadOnly
);
QRegularExpression
regex
(
"font-size:.+(
\\
d
\\
d)pt;"
);
while
(
!
styleStream
.
atEnd
())
{
QString
adjustedLine
;
QString
line
=
styleStream
.
readLine
();
QRegularExpressionMatch
match
=
regex
.
match
(
line
);
if
(
match
.
hasMatch
())
{
//qDebug() << "found:" << line << match.captured(1);
adjustedLine
=
QString
(
"font-size: %1pt;"
).
arg
(
ScreenTools
::
adjustFontPointSize_s
(
match
.
captured
(
1
).
toDouble
()));
//qDebug() << "adjusted:" << adjustedLine;
}
else
{
adjustedLine
=
line
;
}
dpiAdjustedStyles
+=
adjustedLine
;
}
}
if
(
!
dpiAdjustedStyles
.
isEmpty
())
{
QString
fSmall
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
font10_s
());
setStyleSheet
(
dpiAdjustedStyles
);
QString
fNormal
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
defaultFontPizelSize_s
());
}
QString
fLarge
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
largeFontPixelSize_s
());
styles
.
replace
(
"FONT_SMALL"
,
fSmall
);
styles
.
replace
(
"FONT_NORMAL"
,
fNormal
);
styles
.
replace
(
"FONT_LARGE"
,
fLarge
);
setStyleSheet
(
styles
);
if
(
!
success
)
{
if
(
!
success
)
{
// Fall back to plastique if we can't load our own
// Fall back to plastique if we can't load our own
...
...
src/QmlControls/ParameterEditor.qml
View file @
5b54450d
...
@@ -66,7 +66,7 @@ QGCView {
...
@@ -66,7 +66,7 @@ QGCView {
height
:
defaultTextHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
))
height
:
defaultTextHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
))
text
:
group
text
:
group
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
16
)
;
font.p
ixelSize
:
ScreenTools
.
font16
;
}
}
Rectangle
{
Rectangle
{
...
@@ -142,7 +142,7 @@ QGCView {
...
@@ -142,7 +142,7 @@ QGCView {
height
:
firstButton
.
height
height
:
firstButton
.
height
QGCLabel
{
QGCLabel
{
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
20
)
font.p
ixelSize
:
ScreenTools
.
font20
;
visible
:
fullMode
visible
:
fullMode
text
:
"
PARAMETER EDITOR
"
text
:
"
PARAMETER EDITOR
"
}
}
...
@@ -202,7 +202,7 @@ QGCView {
...
@@ -202,7 +202,7 @@ QGCView {
height
:
contentHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
))
height
:
contentHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
))
text
:
"
Component #:
"
+
componentId
.
toString
()
text
:
"
Component #:
"
+
componentId
.
toString
()
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
font.p
ointSize
:
ScreenTools
.
fontPointFactor
*
(
16
)
;
font.p
ixelSize
:
ScreenTools
.
font16
;
}
}
Repeater
{
Repeater
{
...
@@ -357,4 +357,4 @@ QGCView {
...
@@ -357,4 +357,4 @@ QGCView {
}
}
}
// Rectangle - editorDialog
}
// Rectangle - editorDialog
}
// Component - Editor Dialog
}
// Component - Editor Dialog
}
// QGCView
}
// QGCView
\ No newline at end of file
src/QmlControls/QGCButton.qml
View file @
5b54450d
...
@@ -104,7 +104,7 @@ Button {
...
@@ -104,7 +104,7 @@ Button {
id
:
text
id
:
text
antialiasing
:
true
antialiasing
:
true
text
:
control
.
text
text
:
control
.
text
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
src/QmlControls/QGCCheckBox.qml
View file @
5b54450d
...
@@ -29,7 +29,7 @@ CheckBox {
...
@@ -29,7 +29,7 @@ CheckBox {
id
:
text
id
:
text
text
:
control
.
text
text
:
control
.
text
antialiasing
:
true
antialiasing
:
true
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
anchors.centerIn
:
parent
anchors.centerIn
:
parent
...
...
src/QmlControls/QGCComboBox.qml
View file @
5b54450d
...
@@ -11,7 +11,7 @@ ComboBox {
...
@@ -11,7 +11,7 @@ ComboBox {
property
bool
__showHighlight
:
pressed
|
hovered
property
bool
__showHighlight
:
pressed
|
hovered
style
:
ComboBoxStyle
{
style
:
ComboBoxStyle
{
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
textColor
:
__showHighlight
?
textColor
:
__showHighlight
?
control
.
__qgcPal
.
buttonHighlightText
:
control
.
__qgcPal
.
buttonHighlightText
:
control
.
__qgcPal
.
buttonText
control
.
__qgcPal
.
buttonText
...
...
src/QmlControls/QGCLabel.qml
View file @
5b54450d
...
@@ -10,7 +10,7 @@ Text {
...
@@ -10,7 +10,7 @@ Text {
property
bool
enabled
:
true
property
bool
enabled
:
true
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
color
:
__qgcPal
.
text
color
:
__qgcPal
.
text
antialiasing
:
true
antialiasing
:
true
}
}
src/QmlControls/QGCRadioButton.qml
View file @
5b54450d
...
@@ -28,7 +28,7 @@ RadioButton {
...
@@ -28,7 +28,7 @@ RadioButton {
Text
{
Text
{
id
:
text
id
:
text
text
:
control
.
text
text
:
control
.
text
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
antialiasing
:
true
antialiasing
:
true
anchors.centerIn
:
parent
anchors.centerIn
:
parent
...
...
src/QmlControls/QGCTextField.qml
View file @
5b54450d
...
@@ -50,7 +50,7 @@ TextField {
...
@@ -50,7 +50,7 @@ TextField {
width
:
unitsLabelWidthGenerator
.
width
width
:
unitsLabelWidthGenerator
.
width
text
:
control
.
unitsLabel
text
:
control
.
unitsLabel
font.p
ointSize
:
ScreenTools
.
defaultFontPoint
Size
font.p
ixelSize
:
ScreenTools
.
defaultFontPizel
Size
antialiasing
:
true
antialiasing
:
true
color
:
control
.
textColor
color
:
control
.
textColor
...
...
src/QmlControls/QmlTest.qml
View file @
5b54450d
...
@@ -483,5 +483,37 @@ Rectangle {
...
@@ -483,5 +483,37 @@ Rectangle {
}
}
}
}
}
}
Row
{
Column
{
Text
{
font.pixelSize
:
8
;
color
:
"
white
"
;
text
:
"
Text Test 8px
"
;
}
Text
{
font.pixelSize
:
9
;
color
:
"
white
"
;
text
:
"
Text Test 9px
"
;
}
Text
{
font.pixelSize
:
10
;
color
:
"
white
"
;
text
:
"
Text Test 10px
"
;
}
Text
{
font.pixelSize
:
11
;
color
:
"
white
"
;
text
:
"
Text Test 11px
"
;
}
Text
{
font.pixelSize
:
12
;
color
:
"
white
"
;
text
:
"
Text Test 12px
"
;
}
Text
{
font.pixelSize
:
13
;
color
:
"
white
"
;
text
:
"
Text Test 13px
"
;
}
Text
{
font.pixelSize
:
14
;
color
:
"
white
"
;
text
:
"
Text Test 14px
"
;
}
Text
{
font.pixelSize
:
15
;
color
:
"
white
"
;
text
:
"
Text Test 15px
"
;
}
Text
{
font.pixelSize
:
16
;
color
:
"
white
"
;
text
:
"
Text Test 16px
"
;
}
Text
{
font.pixelSize
:
17
;
color
:
"
white
"
;
text
:
"
Text Test 17px
"
;
}
Text
{
font.pixelSize
:
18
;
color
:
"
white
"
;
text
:
"
Text Test 18px
"
;
}
Text
{
font.pixelSize
:
19
;
color
:
"
white
"
;
text
:
"
Text Test 19px
"
;
}
Text
{
font.pixelSize
:
20
;
color
:
"
white
"
;
text
:
"
Text Test 20px
"
;
}
}
Column
{
Text
{
font.pixelSize
:
8
;
color
:
"
white
"
;
text
:
"
Text Test 8pt
"
;
}
Text
{
font.pixelSize
:
9
;
color
:
"
white
"
;
text
:
"
Text Test 9pt
"
;
}
Text
{
font.pixelSize
:
10
;
color
:
"
white
"
;
text
:
"
Text Test 10pt
"
;
}
Text
{
font.pixelSize
:
11
;
color
:
"
white
"
;
text
:
"
Text Test 11pt
"
;
}
Text
{
font.pixelSize
:
12
;
color
:
"
white
"
;
text
:
"
Text Test 12pt
"
;
}
Text
{
font.pixelSize
:
13
;
color
:
"
white
"
;
text
:
"
Text Test 13pt
"
;
}
Text
{
font.pixelSize
:
14
;
color
:
"
white
"
;
text
:
"
Text Test 14pt
"
;
}
Text
{
font.pixelSize
:
15
;
color
:
"
white
"
;
text
:
"
Text Test 15pt
"
;
}
Text
{
font.pixelSize
:
16
;
color
:
"
white
"
;
text
:
"
Text Test 16pt
"
;
}
Text
{
font.pixelSize
:
17
;
color
:
"
white
"
;
text
:
"
Text Test 17pt
"
;
}
Text
{
font.pixelSize
:
18
;
color
:
"
white
"
;
text
:
"
Text Test 18pt
"
;
}
Text
{
font.pixelSize
:
19
;
color
:
"
white
"
;
text
:
"
Text Test 19pt
"
;
}
Text
{
font.pixelSize
:
20
;
color
:
"
white
"
;
text
:
"
Text Test 20pt
"
;
}
}
}
}
}
}
}
src/QmlControls/ScreenTools.cc
View file @
5b54450d
...
@@ -27,35 +27,55 @@
...
@@ -27,35 +27,55 @@
#include "ScreenTools.h"
#include "ScreenTools.h"
#include "MainWindow.h"
#include "MainWindow.h"
#include <QFont>
// Pixel size, instead of a physical thing is actually a philosophical question when
#include <QFontMetrics>
// it comes to Qt. Fonts are that and some heavy Kabalistic Voodoo added to the mix.
// The values below came from actually measuring the elements on the screen on these
const
double
ScreenTools
::
_defaultFontPointSize
=
13
;
// devices. I have yet to find a constant from Qt so these things can be properly
const
double
ScreenTools
::
_mediumFontPointSize
=
16
;
// computed at runtime.
const
double
ScreenTools
::
_largeFontPointSize
=
20
;
#if defined(Q_OS_OSX)
double
ScreenTools
::
_pixelFactor
=
1.0
;
#elif defined(__ios__)
double
ScreenTools
::
_pixelFactor
=
0.75
;
#elif defined(Q_OS_WIN)
double
ScreenTools
::
_pixelFactor
=
0.86
;
#elif defined(__android__)
double
ScreenTools
::
_pixelFactor
=
2.5
;
#elif defined(Q_OS_LINUX)
double
ScreenTools
::
_pixelFactor
=
1.0
;
#endif
#if defined(__android__)
#define FONT_FACTOR 2
#else
#define FONT_FACTOR 1
#endif
int
ScreenTools
::
_font8
=
8
*
FONT_FACTOR
;
int
ScreenTools
::
_font9
=
9
*
FONT_FACTOR
;
int
ScreenTools
::
_font10
=
10
*
FONT_FACTOR
;
int
ScreenTools
::
_font11
=
11
*
FONT_FACTOR
;
int
ScreenTools
::
_font12
=
12
*
FONT_FACTOR
;
int
ScreenTools
::
_font13
=
13
*
FONT_FACTOR
;
int
ScreenTools
::
_font14
=
14
*
FONT_FACTOR
;
int
ScreenTools
::
_font15
=
15
*
FONT_FACTOR
;
int
ScreenTools
::
_font16
=
16
*
FONT_FACTOR
;
int
ScreenTools
::
_font17
=
17
*
FONT_FACTOR
;
int
ScreenTools
::
_font18
=
18
*
FONT_FACTOR
;
int
ScreenTools
::
_font19
=
19
*
FONT_FACTOR
;
int
ScreenTools
::
_font20
=
20
*
FONT_FACTOR
;
int
ScreenTools
::
_font21
=
21
*
FONT_FACTOR
;
int
ScreenTools
::
_font22
=
22
*
FONT_FACTOR
;
ScreenTools
::
ScreenTools
()
ScreenTools
::
ScreenTools
()
{
{
MainWindow
*
mainWindow
=
MainWindow
::
instance
();
MainWindow
*
mainWindow
=
MainWindow
::
instance
();