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
9b6e5499
Commit
9b6e5499
authored
Mar 10, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added convenience function to ScreenTools to compute appropriate font point size.
parent
a5bd0794
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
32 deletions
+43
-32
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+2
-2
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+8
-8
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+9
-9
SensorsComponent.qml
src/AutoPilotPlugins/PX4/SensorsComponent.qml
+1
-1
FactSystemTest.qml
src/FactSystem/FactSystemTest.qml
+1
-1
ScreenTools.cc
src/QmlControls/ScreenTools.cc
+5
-0
ScreenTools.h
src/QmlControls/ScreenTools.h
+6
-0
VehicleRotationCal.qml
src/QmlControls/VehicleRotationCal.qml
+2
-2
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+1
-1
VehicleSummary.qml
src/VehicleSetup/VehicleSummary.qml
+1
-1
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+7
-7
No files found.
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
9b6e5499
...
...
@@ -382,7 +382,7 @@ Item {
QGCLabel
{
text
:
"
FLIGHT MODES CONFIG
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
height
:
20
;
width
:
10
}
// spacer
...
...
@@ -873,7 +873,7 @@ Item {
QGCLabel
{
text
:
"
FLIGHT MODES CONFIG
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
QGCLabel
{
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
9b6e5499
...
...
@@ -98,13 +98,13 @@ Rectangle {
QGCLabel
{
text
:
"
POWER CONFIG
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
QGCLabel
{
text
:
"
Battery
"
color
:
palette
.
text
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Rectangle
{
...
...
@@ -208,12 +208,12 @@ Rectangle {
text
:
"
Battery Max:
"
color
:
palette
.
text
width
:
80
font.pointSize
:
12
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
)
;
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battHighVolt
.
value
).
toFixed
(
1
)
+
'
V
'
color
:
palette
.
text
font.pointSize
:
12
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
)
;
}
}
Row
{
...
...
@@ -222,12 +222,12 @@ Rectangle {
text
:
"
Battery Min:
"
color
:
palette
.
text
width
:
80
font.pointSize
:
12
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
)
;
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battLowVolt
.
value
).
toFixed
(
1
)
+
'
V
'
color
:
palette
.
text
font.pointSize
:
12
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
)
;
}
}
}
...
...
@@ -245,7 +245,7 @@ Rectangle {
QGCLabel
{
text
:
"
Propeller Function
"
color
:
palette
.
text
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Rectangle
{
width
:
parent
.
width
...
...
@@ -259,7 +259,7 @@ Rectangle {
QGCLabel
{
text
:
"
Magnetometer Distortion
"
color
:
palette
.
text
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Rectangle
{
width
:
parent
.
width
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
9b6e5499
...
...
@@ -54,7 +54,7 @@ Rectangle {
QGCLabel
{
text
:
"
SAFETY CONFIG
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
height
:
20
;
width
:
10
}
// spacer
...
...
@@ -62,7 +62,7 @@ Rectangle {
//-----------------------------------------------------------------
//-- Return Home Triggers
QGCLabel
{
text
:
"
Triggers For Return Home
"
;
color
:
palette
.
text
;
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
}
QGCLabel
{
text
:
"
Triggers For Return Home
"
;
color
:
palette
.
text
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
height
:
10
;
width
:
10
}
// spacer
...
...
@@ -121,7 +121,7 @@ Rectangle {
//-----------------------------------------------------------------
//-- Return Home Settings
QGCLabel
{
text
:
"
Return Home Settings
"
;
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
}
QGCLabel
{
text
:
"
Return Home Settings
"
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
height
:
10
;
width
:
10
}
// spacer
...
...
@@ -273,12 +273,12 @@ Rectangle {
QGCLabel
{
text
:
"
Home loiter altitude
"
;
color
:
palette
.
text
;
enabled
:
homeLoiterCheckbox
.
checked
==
true
enabled
:
homeLoiterCheckbox
.
checked
==
=
true
}
FactTextField
{
id
:
descendField
;
fact
:
Fact
{
name
:
"
RTL_DESCEND_ALT
"
}
enabled
:
homeLoiterCheckbox
.
checked
==
true
enabled
:
homeLoiterCheckbox
.
checked
==
=
true
showUnits
:
true
}
}
...
...
@@ -291,17 +291,17 @@ Rectangle {
QGCLabel
{
property
Fact
fact
:
Fact
{
name
:
"
NAV_RCL_OBC
"
}
width
:
parent
.
width
font.pointSize
:
14
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
)
;
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
}
QGCLabel
{
property
Fact
fact
:
Fact
{
name
:
"
NAV_DLL_OBC
"
}
width
:
parent
.
width
font.pointSize
:
14
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
)
;
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
}
}
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.qml
View file @
9b6e5499
...
...
@@ -87,7 +87,7 @@ Rectangle {
QGCLabel
{
text
:
"
SENSORS CONFIG
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
height
:
20
;
width
:
10
}
// spacer
...
...
src/FactSystem/FactSystemTest.qml
View file @
9b6e5499
...
...
@@ -33,7 +33,7 @@ Item {
Fact
{
id
:
fact
;
name
:
"
RC_MAP_THROTTLE
"
}
text
:
fact
.
value
font.family
:
"
Helvetica
"
font.pointSize
:
24
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
24
)
;
color
:
"
red
"
focus
:
true
onAccepted
:
{
fact
.
value
=
text
;
}
...
...
src/QmlControls/ScreenTools.cc
View file @
9b6e5499
...
...
@@ -42,6 +42,11 @@ ScreenTools::ScreenTools()
connect
(
MainWindow
::
instance
(),
&
MainWindow
::
repaintCanvas
,
this
,
&
ScreenTools
::
_updateCanvas
);
}
qreal
ScreenTools
::
dpiAdjustedPointSize
(
qreal
pointSize
)
{
return
pointSize
*
_dpiFactor
;
}
void
ScreenTools
::
_updateCanvas
()
{
emit
repaintRequestedChanged
();
...
...
src/QmlControls/ScreenTools.h
View file @
9b6e5499
...
...
@@ -110,6 +110,12 @@ public:
*/
Q_PROPERTY
(
bool
repaintRequested
READ
repaintRequested
NOTIFY
repaintRequestedChanged
)
//! Utility for adjusting font point size.
/*!
@sa dpiFactor
*/
Q_INVOKABLE
qreal
dpiAdjustedPointSize
(
qreal
pointSize
);
double
screenDPI
()
{
return
_dotsPerInch
;
}
double
dpiFactor
()
{
return
_dpiFactor
;
}
int
mouseX
()
{
return
QCursor
::
pos
().
x
();
}
...
...
src/QmlControls/VehicleRotationCal.qml
View file @
9b6e5499
...
...
@@ -68,7 +68,7 @@ Rectangle {
height
:
parent
.
height
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignBottom
font.pointSize
:
25
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
25
)
;
font.bold
:
true
color
:
"
black
"
...
...
@@ -79,7 +79,7 @@ Rectangle {
height
:
parent
.
height
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignBottom
font.pointSize
:
25
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
25
)
;
color
:
calInProgress
?
"
yellow
"
:
"
white
"
text
:
parent
.
calText
...
...
src/VehicleSetup/FirmwareUpgrade.qml
View file @
9b6e5499
...
...
@@ -51,7 +51,7 @@ Rectangle {
QGCLabel
{
text
:
"
FIRMWARE UPDATE
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
...
...
src/VehicleSetup/VehicleSummary.qml
View file @
9b6e5499
...
...
@@ -47,7 +47,7 @@ Rectangle {
QGCLabel
{
text
:
"
VEHICLE SUMMARY
"
font.pointSize
:
20
*
screenTools
.
dpiFactor
;
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
20
)
;
}
Item
{
...
...
src/ui/toolbar/MainToolBar.qml
View file @
9b6e5499
...
...
@@ -241,7 +241,7 @@ Rectangle {
Text
{
id
:
messageText
text
:
(
mainToolBar
.
messageCount
>
0
)
?
mainToolBar
.
messageCount
:
''
font.pointSize
:
14
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
);
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -329,7 +329,7 @@ Rectangle {
Text
{
id
:
satelitteText
text
:
(
mainToolBar
.
satelliteCount
>
0
)
?
mainToolBar
.
satelliteCount
:
''
font.pointSize
:
14
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
);
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
...
...
@@ -364,7 +364,7 @@ Rectangle {
Text
{
id
:
batteryText
text
:
mainToolBar
.
batteryVoltage
.
toFixed
(
1
)
+
'
V
'
;
font.pointSize
:
14
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
);
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
...
...
@@ -392,7 +392,7 @@ Rectangle {
Text
{
id
:
armedStatusText
text
:
(
mainToolBar
.
systemArmed
)
?
qsTr
(
"
ARMED
"
)
:
qsTr
(
"
DISARMED
"
)
font.pointSize
:
12
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
);
font.weight
:
Font
.
DemiBold
anchors.centerIn
:
parent
color
:
(
mainToolBar
.
systemArmed
)
?
colorOrangeText
:
colorGreenText
...
...
@@ -411,7 +411,7 @@ Rectangle {
Text
{
id
:
stateStatusText
text
:
mainToolBar
.
currentState
font.pointSize
:
12
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
);
font.weight
:
Font
.
DemiBold
anchors.centerIn
:
parent
color
:
(
mainToolBar
.
currentState
===
"
STANDBY
"
)
?
colorGreenText
:
colorRedText
...
...
@@ -432,7 +432,7 @@ Rectangle {
Text
{
id
:
modeStatusText
text
:
mainToolBar
.
currentMode
font.pointSize
:
12
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
12
);
font.weight
:
Font
.
DemiBold
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -453,7 +453,7 @@ Rectangle {
Text
{
id
:
connectionStatusText
text
:
qsTr
(
"
CONNECTION LOST
"
)
font.pointSize
:
14
*
screenTools
.
dpiFactor
font.pointSize
:
screenTools
.
dpiAdjustedPointSize
(
14
);
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
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