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
9c94295b
Commit
9c94295b
authored
Jun 09, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Major font rework
Everything is now based off of default font pixel size
parent
890ea6ab
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
424 additions
and
191 deletions
+424
-191
QGCApplication.pro
QGCApplication.pro
+2
-2
qgroundcontrol.qrc
qgroundcontrol.qrc
+5
-1
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+2
-2
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+6
-6
SensorsComponent.qml
src/AutoPilotPlugins/PX4/SensorsComponent.qml
+10
-10
QGCApplication.cc
src/QGCApplication.cc
+37
-44
QGCPalette.cc
src/QGCPalette.cc
+0
-1
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+7
-7
QGCButton.qml
src/QmlControls/QGCButton.qml
+6
-6
QGCCheckBox.qml
src/QmlControls/QGCCheckBox.qml
+1
-1
QGCComboBox.qml
src/QmlControls/QGCComboBox.qml
+1
-1
QGCLabel.qml
src/QmlControls/QGCLabel.qml
+1
-1
QGCMovableItem.qml
src/QmlControls/QGCMovableItem.qml
+2
-2
QGCRadioButton.qml
src/QmlControls/QGCRadioButton.qml
+1
-1
QGCTextField.qml
src/QmlControls/QGCTextField.qml
+1
-1
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+0
-0
QGroundControl.ScreenTools.qmldir
src/QmlControls/QGroundControl.ScreenTools.qmldir
+3
-0
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+39
-0
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+59
-0
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+127
-0
ScreenToolsFontQuery.qml
src/QmlControls/ScreenToolsFontQuery.qml
+9
-0
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+1
-1
VehicleRotationCal.qml
src/QmlControls/VehicleRotationCal.qml
+2
-2
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+2
-2
VehicleSummary.qml
src/VehicleSetup/VehicleSummary.qml
+3
-3
FlightDisplay.cc
src/ui/flightdisplay/FlightDisplay.cc
+3
-3
FlightDisplay.qml
src/ui/flightdisplay/FlightDisplay.qml
+31
-31
QGCMapDisplay.cc
src/ui/mapdisplay/QGCMapDisplay.cc
+3
-3
QGCAltitudeWidget.qml
src/ui/qmlcommon/QGCAltitudeWidget.qml
+6
-6
QGCCompass.qml
src/ui/qmlcommon/QGCCompass.qml
+2
-2
QGCCompassInstrument.qml
src/ui/qmlcommon/QGCCompassInstrument.qml
+2
-2
QGCCurrentAltitude.qml
src/ui/qmlcommon/QGCCurrentAltitude.qml
+2
-2
QGCCurrentSpeed.qml
src/ui/qmlcommon/QGCCurrentSpeed.qml
+2
-2
QGCMapBackground.qml
src/ui/qmlcommon/QGCMapBackground.qml
+6
-6
QGCMapToolButton.qml
src/ui/qmlcommon/QGCMapToolButton.qml
+5
-5
QGCPitchWidget.qml
src/ui/qmlcommon/QGCPitchWidget.qml
+2
-2
QGCSlider.qml
src/ui/qmlcommon/QGCSlider.qml
+9
-9
QGCSpeedWidget.qml
src/ui/qmlcommon/QGCSpeedWidget.qml
+6
-6
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+3
-3
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+15
-15
No files found.
QGCApplication.pro
View file @
9c94295b
...
...
@@ -267,7 +267,7 @@ HEADERS += \
src
/
QGCTemporaryFile
.
h
\
src
/
QmlControls
/
MavManager
.
h
\
src
/
QmlControls
/
ParameterEditorController
.
h
\
src
/
QmlControls
/
ScreenTools
.
h
\
src
/
QmlControls
/
ScreenTools
Controller
.
h
\
src
/
uas
/
QGCMAVLinkUASFactory
.
h
\
src
/
uas
/
FileManager
.
h
\
src
/
uas
/
UAS
.
h
\
...
...
@@ -398,7 +398,7 @@ SOURCES += \
src
/
QGCTemporaryFile
.
cc
\
src
/
QmlControls
/
MavManager
.
cc
\
src
/
QmlControls
/
ParameterEditorController
.
cc
\
src
/
QmlControls
/
ScreenTools
.
cc
\
src
/
QmlControls
/
ScreenTools
Controller
.
cc
\
src
/
uas
/
QGCMAVLinkUASFactory
.
cc
\
src
/
uas
/
FileManager
.
cc
\
src
/
uas
/
UAS
.
cc
\
...
...
qgroundcontrol.qrc
View file @
9c94295b
...
...
@@ -15,7 +15,7 @@
<file alias="QGroundControl/FactControls/FactCheckBox.qml">src/FactSystem/FactControls/FactCheckBox.qml</file>
<file alias="QGroundControl/FactControls/FactComboBox.qml">src/FactSystem/FactControls/FactComboBox.qml</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/qmldir</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/
QGroundControl.Controls.
qmldir</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
...
...
@@ -26,6 +26,10 @@
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/ScreenTools/qmldir">src/QmlControls/QGroundControl.ScreenTools.qmldir</file>
<file alias="QGroundControl/ScreenTools/ScreenTools.qml">src/QmlControls/ScreenTools.qml</file>
<file alias="ScreenToolsFontQuery.qml">src/QmlControls/ScreenToolsFontQuery.qml</file>
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
9c94295b
...
...
@@ -973,7 +973,7 @@ Item {
QGCLabel
{
text
:
"
FLIGHT MODES CONFIG
"
font.pixelSize
:
ScreenTools
.
font20
;
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
QGCLabel
{
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
9c94295b
...
...
@@ -179,7 +179,7 @@ QGCView {
antialiasing
:
true
Connections
{
target
:
ScreenTools
onRepaintRequested
Changed
:
{
onRepaintRequested
:
{
arrows
.
requestPaint
();
}
}
...
...
@@ -269,7 +269,7 @@ QGCView {
width: (parent.width / 2) - 5
QGCLabel {
text: "Propeller Function"
font.pixelSize: ScreenTools.
font20;
font.pixelSize: ScreenTools.
mediumFontPixelSize
}
Rectangle {
width: parent.width
...
...
@@ -282,7 +282,7 @@ QGCView {
width: (parent.width / 2) - 5
QGCLabel {
text: "Magnetometer Distortion"
font.pixelSize: ScreenTools.
font20;
font.pixelSize: ScreenTools.
mediumFontPixelSize
}
Rectangle {
width: parent.width
...
...
@@ -301,7 +301,7 @@ QGCView {
}
QGCLabel
{
text
:
"
Advanced Power Settings
"
font.pixelSize
:
ScreenTools
.
font20
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
visible
:
showAdvanced
.
checked
}
Rectangle
{
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.qml
View file @
9c94295b
...
...
@@ -408,7 +408,7 @@ QGCView {
id
:
orientationCalAreaHelpText
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
font.pixelSize
:
ScreenTools
.
font22
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
anchors.top
:
orientationCalArea
.
top
anchors.left
:
orientationCalArea
.
left
anchors.topMargin
:
15
...
...
src/QGCApplication.cc
View file @
9c94295b
...
...
@@ -69,13 +69,13 @@
#include "SensorsComponentController.h"
#include "PowerComponentController.h"
#include "RadioComponentController.h"
#include "ScreenToolsController.h"
#ifndef __mobile__
#include "FirmwareUpgradeController.h"
#endif
#include "AutoPilotPlugin.h"
#include "VehicleComponent.h"
#include "ScreenTools.h"
#include "MavManager.h"
#ifdef QGC_RTLAB_ENABLED
...
...
@@ -104,10 +104,10 @@ const char* QGCApplication::_lightStyleFile = ":/res/styles/style-light.css";
* This is called by the QtQuick engine for creating the singleton
**/
static
QObject
*
screenToolsSingletonFactory
(
QQmlEngine
*
,
QJSEngine
*
)
static
QObject
*
screenTools
Controller
SingletonFactory
(
QQmlEngine
*
,
QJSEngine
*
)
{
ScreenTools
*
screenTools
=
new
ScreenTools
;
return
screenTools
;
ScreenTools
Controller
*
screenToolsController
=
new
ScreenToolsController
;
return
screenTools
Controller
;
}
/**
...
...
@@ -261,6 +261,33 @@ void QGCApplication::_initCommon(void)
{
QSettings
settings
;
// Register our Qml objects
qmlRegisterType
<
QGCPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCPalette"
);
qmlRegisterUncreatableType
<
AutoPilotPlugin
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"AutoPilotPlugin"
,
"Can only reference, cannot create"
);
qmlRegisterUncreatableType
<
VehicleComponent
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"VehicleComponent"
,
"Can only reference, cannot create"
);
qmlRegisterType
<
ViewWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ViewWidgetController"
);
qmlRegisterType
<
ParameterEditorController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ParameterEditorController"
);
qmlRegisterType
<
CustomCommandWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"CustomCommandWidgetController"
);
qmlRegisterType
<
FlightModesComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FlightModesComponentController"
);
qmlRegisterType
<
AirframeComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"AirframeComponentController"
);
qmlRegisterType
<
SensorsComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"SensorsComponentController"
);
qmlRegisterType
<
PowerComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"PowerComponentController"
);
qmlRegisterType
<
RadioComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"RadioComponentController"
);
qmlRegisterType
<
ScreenToolsController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ScreenToolsController"
);
#ifndef __mobile__
qmlRegisterType
<
FirmwareUpgradeController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FirmwareUpgradeController"
);
#endif
//-- Create QML Singleton Interfaces
qmlRegisterSingletonType
<
ScreenToolsController
>
(
"QGroundControl.ScreenToolsController"
,
1
,
0
,
"ScreenToolsController"
,
screenToolsControllerSingletonFactory
);
qmlRegisterSingletonType
<
MavManager
>
(
"QGroundControl.MavManager"
,
1
,
0
,
"MavManager"
,
mavManagerSingletonFactory
);
//-- Register Waypoint Interface
qmlRegisterInterface
<
Waypoint
>
(
"Waypoint"
);
// Show user an upgrade message if the settings version has been bumped up
bool
settingsUpgraded
=
false
;
if
(
settings
.
contains
(
_settingsVersionKey
))
{
...
...
@@ -314,42 +341,6 @@ void QGCApplication::_initCommon(void)
}
qDebug
()
<<
"Saved files location"
<<
savedFilesLocation
;
settings
.
setValue
(
_savedFilesLocationKey
,
savedFilesLocation
);
// Load application font
QFontDatabase
fontDatabase
=
QFontDatabase
();
const
QString
fontFileName
=
":/res/fonts/vera.ttf"
;
///< Font file is part of the QRC file and compiled into the app
//const QString fontFamilyName = "Bitstream Vera Sans";
if
(
!
QFile
::
exists
(
fontFileName
))
printf
(
"ERROR! font file: %s DOES NOT EXIST!
\n
"
,
fontFileName
.
toStdString
().
c_str
());
fontDatabase
.
addApplicationFont
(
fontFileName
);
// Avoid Using setFont(). In the Qt docu you can read the following:
// "Warning: Do not use this function in conjunction with Qt Style Sheets."
// setFont(fontDatabase.font(fontFamilyName, "Roman", 12));
// Register our Qml objects
qmlRegisterType
<
QGCPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCPalette"
);
qmlRegisterUncreatableType
<
AutoPilotPlugin
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"AutoPilotPlugin"
,
"Can only reference, cannot create"
);
qmlRegisterUncreatableType
<
VehicleComponent
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"VehicleComponent"
,
"Can only reference, cannot create"
);
qmlRegisterType
<
ViewWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ViewWidgetController"
);
qmlRegisterType
<
ParameterEditorController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ParameterEditorController"
);
qmlRegisterType
<
CustomCommandWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"CustomCommandWidgetController"
);
qmlRegisterType
<
FlightModesComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FlightModesComponentController"
);
qmlRegisterType
<
AirframeComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"AirframeComponentController"
);
qmlRegisterType
<
SensorsComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"SensorsComponentController"
);
qmlRegisterType
<
PowerComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"PowerComponentController"
);
qmlRegisterType
<
RadioComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"RadioComponentController"
);
#ifndef __mobile__
qmlRegisterType
<
FirmwareUpgradeController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FirmwareUpgradeController"
);
#endif
//-- Create QML Singleton Interfaces
qmlRegisterSingletonType
<
ScreenTools
>
(
"QGroundControl.ScreenTools"
,
1
,
0
,
"ScreenTools"
,
screenToolsSingletonFactory
);
qmlRegisterSingletonType
<
MavManager
>
(
"QGroundControl.MavManager"
,
1
,
0
,
"MavManager"
,
mavManagerSingletonFactory
);
//-- Register Waypoint Interface
qmlRegisterInterface
<
Waypoint
>
(
"Waypoint"
);
}
bool
QGCApplication
::
_initForNormalAppBoot
(
void
)
...
...
@@ -657,9 +648,11 @@ void QGCApplication::_loadCurrentStyle(void)
// Now that we have the styles loaded we need to adjust the font sizes.
QString
fSmall
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
font10_s
());
QString
fNormal
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
defaultFontPizelSize_s
());
QString
fLarge
=
QString
(
"%1px;"
).
arg
(
ScreenTools
::
largeFontPixelSize_s
());
QString
fSmall
=
QString
(
"%1px;"
).
arg
(
ScreenToolsController
::
smallFontPixelSize_s
());
QString
fNormal
=
QString
(
"%1px;"
).
arg
(
ScreenToolsController
::
defaultFontPixelSize_s
());
QString
fLarge
=
QString
(
"%1px;"
).
arg
(
ScreenToolsController
::
largeFontPixelSize_s
());
qDebug
()
<<
fSmall
<<
fNormal
<<
fLarge
;
styles
.
replace
(
"FONT_SMALL"
,
fSmall
);
styles
.
replace
(
"FONT_NORMAL"
,
fNormal
);
...
...
src/QGCPalette.cc
View file @
9c94295b
...
...
@@ -25,7 +25,6 @@
/// @author Don Gagne <don@thegagnes.com>
#include "QGCPalette.h"
#include "ScreenTools.h"
#include <QApplication>
#include <QPalette>
...
...
src/QmlControls/ParameterEditor.qml
View file @
9c94295b
...
...
@@ -63,10 +63,10 @@ QGCView {
x
:
__leftMargin
QGCLabel
{
height
:
defaultTextHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
)
)
height
:
defaultTextHeight
+
(
ScreenTools
.
defaultFontPizelSize
*
0.5
)
text
:
group
verticalAlignment
:
Text
.
AlignVCenter
font.pixelSize
:
ScreenTools
.
font16
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
}
Rectangle
{
...
...
@@ -84,7 +84,7 @@ QGCView {
Item
{
x
:
__leftMargin
width
:
parent
.
width
height
:
defaultTextHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
)
)
height
:
defaultTextHeight
+
(
ScreenTools
.
defaultFontPixelSize
*
0.5
)
QGCLabel
{
id
:
nameLabel
...
...
@@ -142,7 +142,7 @@ QGCView {
height
:
firstButton
.
height
QGCLabel
{
font.pixelSize
:
ScreenTools
.
font20
;
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
visible
:
fullMode
text
:
"
PARAMETER EDITOR
"
}
...
...
@@ -199,10 +199,10 @@ QGCView {
readonly
property
int
componentId
:
parseInt
(
modelData
)
QGCLabel
{
height
:
contentHeight
+
(
ScreenTools
.
pixelSizeFactor
*
(
9
)
)
height
:
contentHeight
+
(
ScreenTools
.
defaultFontPixelHeight
*
0.5
)
text
:
"
Component #:
"
+
componentId
.
toString
()
verticalAlignment
:
Text
.
AlignVCenter
font.pixelSize
:
ScreenTools
.
font16
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
}
Repeater
{
...
...
@@ -224,7 +224,7 @@ QGCView {
Item
{
width
:
1
height
:
ScreenTools
.
pixelSizeFactor
*
(
3
)
height
:
ScreenTools
.
defaultFontPixelSize
*
0.25
}
}
// Column - Group
}
// Repeater - Groups
...
...
src/QmlControls/QGCButton.qml
View file @
9c94295b
...
...
@@ -26,12 +26,12 @@ Button {
Connections
{
target
:
__behavior
onMouseXChanged
:
{
__lastGlobalMouseX
=
ScreenTools
.
mouseX
__lastGlobalMouseY
=
ScreenTools
.
mouseY
__lastGlobalMouseX
=
ScreenTools
.
mouseX
()
__lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
onMouseYChanged
:
{
__lastGlobalMouseX
=
ScreenTools
.
mouseX
__lastGlobalMouseY
=
ScreenTools
.
mouseY
__lastGlobalMouseX
=
ScreenTools
.
mouseX
()
__lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
onEntered
:
{
__forceHoverOff
;
false
;
hoverTimer
.
start
()
}
onExited
:
{
__forceHoverOff
;
false
;
hoverTimer
.
stop
()
}
...
...
@@ -43,7 +43,7 @@ Button {
repeat
:
true
onTriggered
:
{
if
(
__lastGlobalMouseX
!=
ScreenTools
.
mouseX
||
__lastGlobalMouseY
!=
ScreenTools
.
mouseY
)
{
if
(
__lastGlobalMouseX
!=
ScreenTools
.
mouseX
()
||
__lastGlobalMouseY
!=
ScreenTools
.
mouseY
()
)
{
__forceHoverOff
=
true
}
else
{
__forceHoverOff
=
false
...
...
@@ -104,7 +104,7 @@ Button {
id
:
text
antialiasing
:
true
text
:
control
.
text
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
src/QmlControls/QGCCheckBox.qml
View file @
9c94295b
...
...
@@ -29,7 +29,7 @@ CheckBox {
id
:
text
text
:
control
.
text
antialiasing
:
true
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
anchors.centerIn
:
parent
...
...
src/QmlControls/QGCComboBox.qml
View file @
9c94295b
...
...
@@ -11,7 +11,7 @@ ComboBox {
property
bool
__showHighlight
:
pressed
|
hovered
style
:
ComboBoxStyle
{
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
textColor
:
__showHighlight
?
control
.
__qgcPal
.
buttonHighlightText
:
control
.
__qgcPal
.
buttonText
...
...
src/QmlControls/QGCLabel.qml
View file @
9c94295b
...
...
@@ -10,7 +10,7 @@ Text {
property
bool
enabled
:
true
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
color
:
__qgcPal
.
text
antialiasing
:
true
}
src/QmlControls/QGCMovableItem.qml
View file @
9c94295b
...
...
@@ -9,8 +9,8 @@ import QGroundControl.ScreenTools 1.0
Item
{
id
:
root
property
bool
allowDragging
:
true
property
real
minimumWidth
:
ScreenTools
.
pixelSizeFactor
*
(
60
)
property
real
minimumHeight
:
ScreenTools
.
pixelSizeFactor
*
(
60
)
property
real
minimumWidth
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
property
real
minimumHeight
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
property
alias
tForm
:
tform
signal
resetRequested
()
transform
:
Scale
{
...
...
src/QmlControls/QGCRadioButton.qml
View file @
9c94295b
...
...
@@ -28,7 +28,7 @@ RadioButton {
Text
{
id
:
text
text
:
control
.
text
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
antialiasing
:
true
anchors.centerIn
:
parent
...
...
src/QmlControls/QGCTextField.qml
View file @
9c94295b
...
...
@@ -50,7 +50,7 @@ TextField {
width
:
unitsLabelWidthGenerator
.
width
text
:
control
.
unitsLabel
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
antialiasing
:
true
color
:
control
.
textColor
...
...
src/QmlControls/qmldir
→
src/QmlControls/
QGroundControl.Controls.
qmldir
View file @
9c94295b
File moved
src/QmlControls/QGroundControl.ScreenTools.qmldir
0 → 100644
View file @
9c94295b
Module QGroundControl.ScreenTools
singleton ScreenTools 1.0 ScreenTools.qml
src/QmlControls/ScreenTools.qml
0 → 100644
View file @
9c94295b
pragma
Singleton
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
ScreenToolsController
1.0
Item
{
signal
repaintRequested
readonly
property
real
defaultFontPixelSize
:
_textMeasure
.
contentHeight
*
0.8
readonly
property
real
defaultFontPixelHeight
:
defaultFontPixelSize
readonly
property
real
defaultFontPixelWidth
:
_textMeasure
.
contentWidth
readonly
property
real
smallFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
smallFontPixelSizeRatio
readonly
property
real
mediumFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
mediumFontPixelSizeRatio
readonly
property
real
largeFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
largeFontPixelSizeRatio
property
bool
isAndroid
:
ScreenToolsController
.
isAndroid
property
bool
isiOS
:
ScreenToolsController
.
isiOS
property
bool
isMobile
:
ScreenToolsController
.
isMobile
function
mouseX
()
{
return
ScreenToolsController
.
mouseX
()
}
function
mouseY
()
{
return
ScreenToolsController
.
mouseY
()
}
Text
{
id
:
_textMeasure
text
:
"
X
"
}
Connections
{
target
:
ScreenToolsController
onRepaintRequested
:
repaintRequested
()
}
}
src/QmlControls/ScreenTools.cc
→
src/QmlControls/ScreenTools
Controller
.cc
View file @
9c94295b
...
...
@@ -24,69 +24,36 @@
/// @file
/// @author Gus Grubba <mavlink@grubba.com>
#include "ScreenTools.h"
#include "ScreenTools
Controller
.h"
#include "MainWindow.h"
// Pixel size, instead of a physical thing is actually a philosophical question when
// it comes to Qt.
// The values below came from actually measuring the elements on the screen on these
// devices. I have yet to find a constant from Qt so these things can be properly
// computed at runtime.
#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
()
int
ScreenToolsController
::
_qmlDefaultFontPixelSize
=
-
1
;
const
double
ScreenToolsController
::
_smallFontPixelSizeRatio
=
0.75
;
const
double
ScreenToolsController
::
_mediumFontPixelSizeRatio
=
1.22
;
const
double
ScreenToolsController
::
_largeFontPixelSizeRatio
=
1.66
;
ScreenToolsController
::
ScreenToolsController
()
{
MainWindow
*
mainWindow
=
MainWindow
::
instance
();
// Unit tests can run Qml without MainWindow
if
(
mainWindow
)
{
connect
(
mainWindow
,
&
MainWindow
::
repaintCanvas
,
this
,
&
ScreenTools
::
_updateCanvas
);
connect
(
mainWindow
,
&
MainWindow
::
repaintCanvas
,
this
,
&
ScreenTools
Controller
::
_updateCanvas
);
}
}
qreal
ScreenTools
::
adjustPixelSize
(
qreal
pixelSize
)
void
ScreenToolsController
::
_updateCanvas
(
)
{
return
adjustPixelSize_s
(
pixelSize
);
emit
repaintRequested
(
);
}
qreal
ScreenTools
::
adjustPixelSize_s
(
qreal
pixelSize
)
double
ScreenToolsController
::
getQmlDefaultFontPixelSize
(
void
)
{
return
pixelSize
*
_pixelFactor
;
}
if
(
_qmlDefaultFontPixelSize
==
-
1
)
{
QGCQmlWidgetHolder
qmlWidgetHolder
;
void
ScreenTools
::
_updateCanvas
()
{
emit
repaintRequestedChanged
();
qmlWidgetHolder
.
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/ScreenToolsFontQuery.qml"
));
}
return
_qmlDefaultFontPixelSize
;
}
src/QmlControls/ScreenTools.h
→
src/QmlControls/ScreenTools
Controller
.h
View file @
9c94295b
...
...
@@ -24,35 +24,33 @@
/// @file
/// @author Gus Grubba <mavlink@grubba.com>
#ifndef S
CREENTOOLS
_H
#define S
CREENTOOLS
_H
#ifndef S
creenToolsController
_H
#define S
creenToolsController
_H
#include <QObject>
#include "QGCApplication.h"
#include <QQuickItem>
#include <QCursor>
/*!
@brief Screen helper tools for QML widgets
To use its functions, you need to import the module with the following line:
@code
import QGroundControl.ScreenTools 1.0
@endcode
*/
/// This Qml control is used to return screen parameters
class
ScreenTools
:
public
QObject
class
ScreenTools
Controller
:
public
QQuickItem
{
Q_OBJECT
public:
ScreenTools
();
ScreenTools
Controller
();
Q_PROPERTY
(
bool
isAndroid
READ
isAndroid
CONSTANT
)
Q_PROPERTY
(
bool
isiOS
READ
isiOS
CONSTANT
)
Q_PROPERTY
(
bool
isMobile
READ
isMobile
CONSTANT
)
//! Returns the global mouse X position
Q_PROPERTY
(
int
mouseX
READ
mouseX
)
//! Returns the global mouse Y position
Q_PROPERTY
(
int
mouseY
READ
mouseY
)
//! Used to trigger a \c Canvas element repaint.
/*!
There is a bug as of Qt 5.4 where a Canvas element defined within a QQuickWidget does not receive
...
...
@@ -60,14 +58,14 @@ public:
repainted.
If you use a \c Canvas element inside some QML widget, you can use this code to handle repaint:
@code
import QGroundControl.ScreenTools 1.0
import QGroundControl.ScreenTools
Controller
1.0
...
Canvas {
id: myCanvas
height: 40
width: 40
Connections {
target: ScreenTools
target: ScreenTools
Controller
onRepaintRequestedChanged: {
myCanvas.requestPaint();
}
...
...
@@ -80,87 +78,23 @@ public:
@endcode
*/
//! Font sizes
Q_PROPERTY
(
int
font22
READ
font22
CONSTANT
)
Q_PROPERTY
(
int
font21
READ
font21
CONSTANT
)
Q_PROPERTY
(
int
font20
READ
font20
CONSTANT
)
Q_PROPERTY
(
int
font19
READ
font19
CONSTANT
)
Q_PROPERTY
(
int
font18
READ
font18
CONSTANT
)
Q_PROPERTY
(
int
font17
READ
font17
CONSTANT
)
Q_PROPERTY
(
int
font16
READ
font16
CONSTANT
)
Q_PROPERTY
(
int
font15
READ
font15
CONSTANT
)
Q_PROPERTY
(
int
font14
READ
font14
CONSTANT
)
Q_PROPERTY
(
int
font13
READ
font13
CONSTANT
)
Q_PROPERTY
(
int
font12
READ
font12
CONSTANT
)
Q_PROPERTY
(
int
font11
READ
font11
CONSTANT
)
Q_PROPERTY
(
int
font10
READ
font10
CONSTANT
)
Q_PROPERTY
(
int
font9
READ
font9
CONSTANT
)
Q_PROPERTY
(
int
font8
READ
font8
CONSTANT
)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY
(
int
defaultFontPizelSize
READ
defaultFontPizelSize
CONSTANT
)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY
(
int
mediumFontPixelSize
READ
mediumFontPixelSize
CONSTANT
)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY
(
int
largeFontPixelSize
READ
largeFontPixelSize
CONSTANT
)
Q_PROPERTY
(
bool
repaintRequested
READ
repaintRequested
NOTIFY
repaintRequestedChanged
)
//! Returns the pixel size factor
Q_PROPERTY
(
double
pixelSizeFactor
READ
pixelSizeFactor
CONSTANT
)
//! Utility for adjusting pixel size. Not dynamic (no signals)
Q_INVOKABLE
qreal
adjustPixelSize
(
qreal
pixelSize
);
/// Static version of adjustPixelSize of use in C++ code
static
qreal
adjustPixelSize_s
(
qreal
pixelSize
);
int
mouseX
()
{
return
QCursor
::
pos
().
x
();
}
int
mouseY
()
{
return
QCursor
::
pos
().
y
();
}
bool
repaintRequested
()
{
return
true
;
}
double
pixelSizeFactor
()
{
return
_pixelFactor
;
}
int
font22
()
{
return
_font22
;
}
int
font21
()
{
return
_font21
;
}
int
font20
()
{
return
_font20
;
}
int
font19
()
{
return
_font19
;
}
int
font18
()
{
return
_font18
;
}
int
font17
()
{
return
_font17
;
}
int
font16
()
{
return
_font16
;
}
int
font15
()
{
return
_font15
;
}
int
font14
()
{
return
_font14
;
}
int
font13
()
{
return
_font13
;
}
int
font12
()
{
return
_font12
;
}
int
font11
()
{
return
_font11
;
}
int
font10
()
{
return
_font10
;
}
int
font9
()
{
return
_font9
;
}
int
font8
()
{
return
_font8
;
}
int
defaultFontPizelSize
()
{
return
_font12
;
}
int
mediumFontPixelSize
()
{
return
_font16
;
}
int
largeFontPixelSize
()
{
return
_font20
;
}
/// Static version for use in C++ code
static
int
font22_s
()
{
return
_font22
;
}
static
int
font21_s
()
{
return
_font21
;
}
static
int
font20_s
()
{
return
_font20
;
}
static
int
font19_s
()
{
return
_font19
;
}
static
int
font18_s
()
{
return
_font18
;
}
static
int
font17_s
()
{
return
_font17
;
}
static
int
font16_s
()
{
return
_font16
;
}
static
int
font15_s
()
{
return
_font15
;
}
static
int
font14_s
()
{
return
_font14
;
}
static
int
font13_s
()
{
return
_font13
;
}
static
int
font12_s
()
{
return
_font12
;
}
static
int
font11_s
()
{
return
_font11
;
}
static
int
font10_s
()
{
return
_font10
;
}
static
int
font9_s
()
{
return
_font9
;
}
static
int
font8_s
()
{
return
_font8
;
}
static
int
defaultFontPizelSize_s
()
{
return
_font12
;
}
static
int
mediumFontPixelSize_s
()
{
return
_font16
;
}
static
int
largeFontPixelSize_s
()
{
return
_font20
;
}
static
double
pixelSizeFactor_s
()
{
return
_pixelFactor
;
}
// Returns current mouse position
Q_INVOKABLE
int
mouseX
(
void
)
{
return
QCursor
::
pos
().
x
();
}
Q_INVOKABLE
int
mouseY
(
void
)
{
return
QCursor
::
pos
().
y
();
}
// Used to calculate font sizes based on default font size
Q_PROPERTY
(
double
smallFontPixelSizeRatio
MEMBER
_smallFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
mediumFontPixelSizeRatio
MEMBER
_mediumFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
largeFontPixelSizeRatio
MEMBER
_largeFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
qmlDefaultFontPixelSize
MEMBER
_qmlDefaultFontPixelSize
)
static
double
getQmlDefaultFontPixelSize
(
void
);
static
int
defaultFontPixelSize_s
()
{
return
(
int
)
getQmlDefaultFontPixelSize
();
}
static
int
smallFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_smallFontPixelSizeRatio
);
}
static
int
mediumFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_mediumFontPixelSizeRatio
);
}
static
int
largeFontPixelSize_s
()
{
return
(
int
)((
double
)
defaultFontPixelSize_s
()
*
_largeFontPixelSizeRatio
);
}
#if defined (__android__)
bool
isAndroid
()
{
return
true
;
}
...
...
@@ -177,30 +111,17 @@ public:
#endif
signals:
void
repaintRequested
Changed
(
);
void
repaintRequested
(
void
);
private
slots
:
void
_updateCanvas
();
private:
// Font Sizes
static
int
_font8
;
static
int
_font9
;
static
int
_font10
;
static
int
_font11
;
static
int
_font12
;
static
int
_font13
;
static
int
_font14
;
static
int
_font15
;
static
int
_font16
;
static
int
_font17
;
static
int
_font18
;
static
int
_font19
;
static
int
_font20
;
static
int
_font21
;
static
int
_font22
;
// UI Dimension Factors
static
double
_pixelFactor
;
static
const
double
_smallFontPixelSizeRatio
;
static
const
double
_mediumFontPixelSizeRatio
;
static
const
double
_largeFontPixelSizeRatio
;
static
int
_qmlDefaultFontPixelSize
;
};
#endif
src/QmlControls/ScreenToolsFontQuery.qml
0 → 100644
View file @
9c94295b
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenToolsController
1.0
Item
{
Component.onCompleted
:
ScreenToolsController
.
qmlDefaultFontPixelSize
=
ScreenTools
.
defaultFontPixelSize
}
src/QmlControls/SubMenuButton.qml
View file @
9c94295b
...
...
@@ -40,7 +40,7 @@ Button {
horizontalAlignment
:
TextEdit
.
AlignHCenter
text
:
control
.
text
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
antialiasing
:
true
color
:
__showHighlight
?
__qgcPal
.
buttonHighlightText
:
__qgcPal
.
buttonText
...
...
src/QmlControls/VehicleRotationCal.qml
View file @
9c94295b
...
...
@@ -70,7 +70,7 @@ Rectangle {
height
:
parent
.
height
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignBottom
font.pixelSize
:
ScreenTools
.
font22
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
font.bold
:
true
color
:
"
black
"
text
:
parent
.
calText
...
...
@@ -80,7 +80,7 @@ Rectangle {
height
:
parent
.
height
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignBottom
font.pixelSize
:
ScreenTools
.
font22
;
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
color
:
calInProgress
?
"
yellow
"
:
"
white
"
text
:
parent
.
calText
}
...
...
src/VehicleSetup/FirmwareUpgrade.qml
View file @
9c94295b
...
...
@@ -74,7 +74,7 @@ QGCView {
QGCLabel
{
text
:
"
FIRMWARE UPDATE
"
font.pixelSize
:
ScreenTools
.
font20
;
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
Item
{
...
...
@@ -177,7 +177,7 @@ QGCView {
height
:
300
readOnly
:
true
frameVisible
:
false
font.pixelSize
:
ScreenTools
.
defaultFontPi
z
elSize
font.pixelSize
:
ScreenTools
.
defaultFontPi
x
elSize
text
:
qsTr
(
"
Please disconnect all vehicles from QGroundControl before selecting Upgrade.
"
)
...
...
src/VehicleSetup/VehicleSummary.qml
View file @
9c94295b
...
...
@@ -46,7 +46,7 @@ Rectangle {
QGCLabel
{
text
:
"
VEHICLE SUMMARY
"
font.pixelSize
:
ScreenTools
.
font20
;
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
Item
{
...
...
@@ -59,7 +59,7 @@ Rectangle {
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
color
:
setupComplete
?
qgcPal
.
text
:
"
red
"
font.pixelSize
:
setupComplete
?
ScreenTools
.
defaultFontPi
zelSize
:
ScreenTools
.
font20
font.pixelSize
:
setupComplete
?
ScreenTools
.
defaultFontPi
xelSize
:
ScreenTools
.
mediumFontPixelSize
text
:
setupComplete
?
"
Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component.
"
:
"
WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left.
"
...
...
src/ui/flightdisplay/FlightDisplay.cc
View file @
9c94295b
...
...
@@ -31,7 +31,7 @@ This file is part of the QGROUNDCONTROL project
#include <QQmlEngine>
#include <QSettings>
#include "ScreenTools.h"
#include "ScreenTools
Controller
.h"
#include "FlightDisplay.h"
#include "UASManager.h"
...
...
@@ -48,8 +48,8 @@ FlightDisplay::FlightDisplay(QWidget *parent)
pl
->
setContentsMargins
(
0
,
0
,
0
,
0
);
}
#ifndef __android__
setMinimumWidth
(
3
80
*
ScreenTools
::
pixelSizeFactor
_s
());
setMinimumHeight
(
400
*
ScreenTools
::
pixelSizeFactor
_s
());
setMinimumWidth
(
3
1
*
ScreenToolsController
::
defaultFontPixelSize
_s
());
setMinimumHeight
(
33
*
ScreenToolsController
::
defaultFontPixelSize
_s
());
#endif
setContextPropertyObject
(
"flightDisplay"
,
this
);
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/FlightDisplay.qml"
));
...
...
src/ui/flightdisplay/FlightDisplay.qml
View file @
9c94295b
...
...
@@ -118,17 +118,17 @@ Item {
}
contentItem
:
Rectangle
{
color
:
__qgcPal
.
window
implicitWidth
:
ScreenTools
.
pixelSizeFactor
*
(
36
0
)
implicitHeight
:
ScreenTools
.
pixelSizeFactor
*
(
30
0
)
implicitWidth
:
ScreenTools
.
defaultFontPixelSize
*
(
3
0
)
implicitHeight
:
ScreenTools
.
defaultFontPixelSize
*
(
3
0
)
Column
{
id
:
dialogColumn
anchors.centerIn
:
parent
spacing
:
ScreenTools
.
adjustPixelSize
(
10
)
spacing
:
ScreenTools
.
defaultFontPixelSize
width
:
parent
.
width
Grid
{
columns
:
2
spacing
:
ScreenTools
.
pixelSizeFactor
*
(
8
)
rowSpacing
:
ScreenTools
.
pixelSizeFactor
*
(
10
)
spacing
:
ScreenTools
.
defaultFontPixelSize
*
(
0.66
)
rowSpacing
:
ScreenTools
.
defaultFontPixelSize
*
(
0.83
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCCheckBox
{
text
:
"
Map Background
"
...
...
@@ -432,25 +432,25 @@ Item {
QGCHudMessage
{
id
:
hudMessage
y
:
ScreenTools
.
pixelSizeFactor
*
(
5
)
y
:
ScreenTools
.
defaultFontPizelSize
*
(
0.42
)
width
:
(
parent
.
width
-
520
>
200
)
?
parent
.
width
-
520
:
200
height
:
ScreenTools
.
pixelSizeFactor
*
(
30
)
height
:
ScreenTools
.
defaultFontPizelSize
*
(
2.5
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
z
:
mapBackground
.
z
+
1
}
QGCCompassInstrument
{
id
:
compassInstrument
y
:
ScreenTools
.
pixelSizeFactor
*
(
5
)
x
:
ScreenTools
.
pixelSizeFactor
*
(
85
)
size
:
ScreenTools
.
pixelSizeFactor
*
(
160
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
visible
:
mapBackground
.
visible
&&
showCompass
z
:
mapBackground
.
z
+
2
onResetRequested
:
{
y
=
ScreenTools
.
pixelSizeFactor
*
(
5
)
x
=
ScreenTools
.
pixelSizeFactor
*
(
85
)
size
=
ScreenTools
.
pixelSizeFactor
*
(
160
)
y
=
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
x
=
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
size
=
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
tForm
.
xScale
=
1
tForm
.
yScale
=
1
}
...
...
@@ -458,20 +458,20 @@ Item {
QGCAttitudeInstrument
{
id
:
attitudeInstrument
y
:
ScreenTools
.
pixelSizeFactor
*
(
5
)
size
:
ScreenTools
.
pixelSizeFactor
*
(
160
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
rollAngle
:
roll
pitchAngle
:
pitch
showPitch
:
showPitchIndicator
visible
:
mapBackground
.
visible
&&
showAttitudeIndicator
anchors.right
:
root
.
right
anchors.rightMargin
:
ScreenTools
.
pixelSizeFactor
*
(
85
)
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
z
:
mapBackground
.
z
+
2
onResetRequested
:
{
y
=
ScreenTools
.
pixelSizeFactor
*
(
5
)
y
=
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
anchors
.
right
=
root
.
right
anchors
.
rightMargin
=
ScreenTools
.
pixelSizeFactor
*
(
85
)
size
=
ScreenTools
.
pixelSizeFactor
*
(
160
)
anchors
.
rightMargin
=
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
size
=
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
tForm
.
xScale
=
1
tForm
.
yScale
=
1
}
...
...
@@ -490,8 +490,8 @@ Item {
rollAngle
:
roll
pitchAngle
:
pitch
visible
:
!
mapBackground
.
visible
&&
showAttitudeIndicator
width
:
ScreenTools
.
pixelSizeFactor
*
(
260
)
height
:
ScreenTools
.
pixelSizeFactor
*
(
260
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
21.7
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
21.7
)
z
:
20
}
...
...
@@ -502,15 +502,15 @@ Item {
pitchAngle
:
pitch
rollAngle
:
roll
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
size
:
ScreenTools
.
pixelSizeFactor
*
(
12
0
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
1
0
)
z
:
30
}
QGCAltitudeWidget
{
id
:
altitudeWidget
anchors.right
:
parent
.
right
width
:
ScreenTools
.
pixelSizeFactor
*
(
60
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
pixelSizeFactor
*
(
280
)
?
ScreenTools
.
pixelSizeFactor
*
(
280
)
:
parent
.
height
*
0.65
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
altitude
:
MavManager
.
altitudeWGS84
z
:
30
}
...
...
@@ -518,8 +518,8 @@ Item {
QGCSpeedWidget
{
id
:
speedWidget
anchors.left
:
parent
.
left
width
:
ScreenTools
.
pixelSizeFactor
*
(
60
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
pixelSizeFactor
*
(
280
)
?
ScreenTools
.
pixelSizeFactor
*
(
280
)
:
parent
.
height
*
0.65
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
speed
:
MavManager
.
groundSpeed
z
:
40
}
...
...
@@ -527,7 +527,7 @@ Item {
QGCCurrentSpeed
{
id
:
currentSpeed
anchors.left
:
parent
.
left
width
:
ScreenTools
.
pixelSizeFactor
*
(
7
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.2
5
)
airspeed
:
MavManager
.
airSpeed
groundspeed
:
MavManager
.
groundSpeed
showAirSpeed
:
true
...
...
@@ -539,7 +539,7 @@ Item {
QGCCurrentAltitude
{
id
:
currentAltitude
anchors.right
:
parent
.
right
width
:
ScreenTools
.
pixelSizeFactor
*
(
7
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.2
5
)
altitude
:
MavManager
.
altitudeWGS84
vertZ
:
MavManager
.
climbRate
showAltitude
:
true
...
...
@@ -551,9 +551,9 @@ Item {
QGCCompass
{
id
:
compassIndicator
y
:
root
.
height
*
0.7
x
:
root
.
width
*
0.5
-
ScreenTools
.
pixelSizeFactor
*
(
60
)
width
:
ScreenTools
.
pixelSizeFactor
*
(
12
0
)
height
:
ScreenTools
.
pixelSizeFactor
*
(
12
0
)
x
:
root
.
width
*
0.5
-
ScreenTools
.
defaultFontPixelSize
*
(
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
1
0
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
1
0
)
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
visible
:
!
mapBackground
.
visible
&&
showCompass
z
:
70
...
...
src/ui/mapdisplay/QGCMapDisplay.cc
View file @
9c94295b
...
...
@@ -31,7 +31,7 @@ This file is part of the QGROUNDCONTROL project
#include <QQmlEngine>
#include <QSettings>
#include "ScreenTools.h"
#include "ScreenTools
Controller
.h"
#include "QGCMapDisplay.h"
#include "UASManager.h"
...
...
@@ -48,8 +48,8 @@ QGCMapDisplay::QGCMapDisplay(QWidget *parent)
pl
->
setContentsMargins
(
0
,
0
,
0
,
0
);
}
#ifndef __android__
setMinimumWidth
(
3
80
*
ScreenTools
::
pixelSizeFactor
_s
());
setMinimumHeight
(
400
*
ScreenTools
::
pixelSizeFactor
_s
());
setMinimumWidth
(
3
2
*
ScreenToolsController
::
defaultFontPixelSize
_s
());
setMinimumHeight
(
33
*
ScreenToolsController
::
defaultFontPixelSize
_s
());
#endif
setContextPropertyObject
(
"mapEngine"
,
this
);
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/MapDisplay.qml"
));
...
...
src/ui/qmlcommon/QGCAltitudeWidget.qml
View file @
9c94295b
...
...
@@ -34,8 +34,8 @@ import QGroundControl.ScreenTools 1.0
Rectangle
{
id
:
root
property
real
altitude
:
50
property
real
_reticleSpacing
:
ScreenTools
.
pixelSizeFactor
*
(
16
)
property
real
_reticleHeight
:
ScreenTools
.
pixelSizeFactor
*
(
2
)
property
real
_reticleSpacing
:
ScreenTools
.
defaultFontPixelSize
*
(
1.33
)
property
real
_reticleHeight
:
ScreenTools
.
defaultFontPixelSize
*
(
0.166
)
property
real
_reticleSlot
:
_reticleSpacing
+
_reticleHeight
property
var
_speedArray
:
[]
property
int
_currentCenter
:
0
...
...
@@ -64,7 +64,7 @@ Rectangle {
anchors
.
verticalCenter
:
parent
.
verticalCenter
smooth
:
true
radius
:
ScreenTools
.
pixelSizeFactor
*
(
5
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
border
.
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
)
}
...
...
@@ -73,7 +73,7 @@ Rectangle {
}
Rectangle
{
id
:
clipRect
height
:
parent
.
height
-
ScreenTools
.
pixelSizeFactor
*
(
5
)
height
:
parent
.
height
-
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
width
:
parent
.
width
clip
:
true
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
);
...
...
@@ -88,12 +88,12 @@ Rectangle {
anchors.left
:
parent
.
left
Rectangle
{
property
int
_alt
:
modelData
width
:
(
_alt
%
10
===
0
)
?
ScreenTools
.
pixelSizeFactor
*
(
10
)
:
ScreenTools
.
pixelSizeFactor
*
(
1
5
)
width
:
(
_alt
%
10
===
0
)
?
ScreenTools
.
defaultFontPixelSize
*
(
0.83
)
:
ScreenTools
.
defaultFontPixelSize
*
(
1.2
5
)
height
:
_reticleHeight
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.35
)
QGCLabel
{
visible
:
(
_alt
%
10
===
0
)
x
:
ScreenTools
.
pixelSizeFactor
*
(
20
)
x
:
ScreenTools
.
defaultFontPixelSize
*
(
1.66
)
anchors.verticalCenter
:
parent
.
verticalCenter
antialiasing
:
true
font.weight
:
Font
.
DemiBold
...
...
src/ui/qmlcommon/QGCCompass.qml
View file @
9c94295b
...
...
@@ -58,8 +58,8 @@ Item {
}
Rectangle
{
anchors.centerIn
:
compass
width
:
ScreenTools
.
pixelSizeFactor
*
(
40
)
height
:
ScreenTools
.
pixelSizeFactor
*
(
25
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
3.33
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
2.08
)
border.color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.15
)
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
QGCLabel
{
...
...
src/ui/qmlcommon/QGCCompassInstrument.qml
View file @
9c94295b
...
...
@@ -34,8 +34,8 @@ import QGroundControl.ScreenTools 1.0
QGCMovableItem
{
id
:
root
property
real
heading
:
0
property
real
size
:
ScreenTools
.
pixelSizeFactor
*
(
12
0
)
property
int
_fontSize
:
ScreenTools
.
font12
property
real
size
:
ScreenTools
.
defaultFontPixelSize
*
(
1
0
)
property
int
_fontSize
:
ScreenTools
.
defaultFontPixelSize
width
:
size
height
:
size
Rectangle
{
...
...
src/ui/qmlcommon/QGCCurrentAltitude.qml
View file @
9c94295b
...
...
@@ -39,13 +39,13 @@ Rectangle {
property
bool
showClimbRate
:
true
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
parent
.
width
height
:
(
showAltitude
&&
showClimbRate
)
?
ScreenTools
.
pixelSizeFactor
*
(
50
)
:
ScreenTools
.
pixelSizeFactor
*
(
25
)
height
:
(
showAltitude
&&
showClimbRate
)
?
ScreenTools
.
defaultFontPixelSize
*
(
4.16
)
:
ScreenTools
.
defaultFontPixelSize
*
(
2.08
)
color
:
"
black
"
border.color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
opacity
:
1.0
Column
{
anchors.centerIn
:
parent
spacing
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
spacing
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
QGCLabel
{
text
:
'
h:
'
+
altitude
.
toFixed
(
0
)
font.weight
:
Font
.
DemiBold
...
...
src/ui/qmlcommon/QGCCurrentSpeed.qml
View file @
9c94295b
...
...
@@ -39,13 +39,13 @@ Rectangle {
property
bool
showGroundSpeed
:
true
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
parent
.
width
height
:
(
showAirSpeed
&&
showGroundSpeed
)
?
ScreenTools
.
pixelSizeFactor
*
(
50
)
:
ScreenTools
.
pixelSizeFactor
*
(
25
)
height
:
(
showAirSpeed
&&
showGroundSpeed
)
?
ScreenTools
.
defaultFontPixelSize
*
(
4.16
)
:
ScreenTools
.
defaultFontPixelSize
*
(
2.08
)
color
:
"
black
"
border.color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
opacity
:
1.0
Column
{
anchors.centerIn
:
parent
spacing
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
spacing
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
QGCLabel
{
text
:
'
GS:
'
+
groundspeed
.
toFixed
(
0
)
font.weight
:
Font
.
DemiBold
...
...
src/ui/qmlcommon/QGCMapBackground.qml
View file @
9c94295b
...
...
@@ -307,9 +307,9 @@ Item {
z
:
1000
anchors
{
bottom
:
parent
.
bottom
;
bottomMargin
:
ScreenTools
.
pixelSizeFactor
*
(
1
5
)
rightMargin
:
ScreenTools
.
pixelSizeFactor
*
(
20
)
leftMargin
:
ScreenTools
.
pixelSizeFactor
*
(
20
)
bottomMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
1.2
5
)
rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
1.66
)
leftMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
1.66
)
left
:
parent
.
left
}
width
:
parent
.
width
-
anchors
.
rightMargin
-
anchors
.
leftMargin
...
...
@@ -330,9 +330,9 @@ Item {
opacity
:
1
anchors
{
bottom
:
zoomSlider
.
top
;
bottomMargin
:
ScreenTools
.
pixelSizeFactor
*
(
8
);
bottomMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
0.66
);
left
:
zoomSlider
.
left
leftMargin
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
leftMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
}
Image
{
id
:
scaleImageLeft
...
...
@@ -359,7 +359,7 @@ Item {
horizontalAlignment
:
Text
.
AlignHCenter
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.bottomMargin
:
ScreenTools
.
pixelSizeFactor
*
(
10
)
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
0.83
)
text
:
"
0 m
"
}
Component.onCompleted
:
{
...
...
src/ui/qmlcommon/QGCMapToolButton.qml
View file @
9c94295b
...
...
@@ -23,12 +23,12 @@ Button {
Connections
{
target
:
__behavior
onMouseXChanged
:
{
__lastGlobalMouseX
=
ScreenTools
.
mouseX
__lastGlobalMouseY
=
ScreenTools
.
mouseY
__lastGlobalMouseX
=
ScreenTools
.
mouseX
()
__lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
onMouseYChanged
:
{
__lastGlobalMouseX
=
ScreenTools
.
mouseX
__lastGlobalMouseY
=
ScreenTools
.
mouseY
__lastGlobalMouseX
=
ScreenTools
.
mouseX
()
__lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
onEntered
:
{
__forceHoverOff
;
false
;
hoverTimer
.
start
()
}
onExited
:
{
__forceHoverOff
;
false
;
hoverTimer
.
stop
()
}
...
...
@@ -39,7 +39,7 @@ Button {
interval
:
250
repeat
:
true
onTriggered
:
{
if
(
__lastGlobalMouseX
!=
ScreenTools
.
mouseX
||
__lastGlobalMouseY
!=
ScreenTools
.
mouseY
)
{
if
(
__lastGlobalMouseX
!=
ScreenTools
.
mouseX
()
||
__lastGlobalMouseY
!=
ScreenTools
.
mouseY
()
)
{
__forceHoverOff
=
true
}
else
{
__forceHoverOff
=
false
...
...
src/ui/qmlcommon/QGCPitchWidget.qml
View file @
9c94295b
...
...
@@ -40,10 +40,10 @@ Rectangle {
property
real
_reticleSlot
:
_reticleSpacing
+
_reticleHeight
property
real
_longDash
:
size
*
0.40
property
real
_shortDash
:
size
*
0.25
property
real
_fontSize
:
ScreenTools
.
font11
property
real
_fontSize
:
ScreenTools
.
defaultFontPixelSize
height
:
size
*
0.9
width
:
size
radius
:
ScreenTools
.
pixelSizeFactor
*
(
8
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.66
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
clip
:
true
...
...
src/ui/qmlcommon/QGCSlider.qml
View file @
9c94295b
...
...
@@ -52,15 +52,15 @@ Item {
Rectangle
{
anchors.fill
:
parent
radius
:
ScreenTools
.
pixelSizeFactor
*
(
6
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.5
)
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
);
}
Rectangle
{
anchors.left
:
parent
.
left
anchors.leftMargin
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
radius
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
height
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
width
:
handle
.
x
-
x
color
:
"
#69bb17
"
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -69,14 +69,14 @@ Item {
Rectangle
{
id
:
labelRect
width
:
label
.
width
height
:
label
.
height
+
ScreenTools
.
pixelSizeFactor
*
(
4
)
radius
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
height
:
label
.
height
+
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
smooth
:
true
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.75
);
border.width
:
ScreenTools
.
pixelSizeFactor
*
(
1
)
border.width
:
ScreenTools
.
defaultFontPixelSize
*
(
0.083
)
border.color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.45
);
anchors.bottom
:
handle
.
top
anchors.bottomMargin
:
ScreenTools
.
pixelSizeFactor
*
(
4
)
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
0.33
)
visible
:
mouseRegion
.
pressed
x
:
Math
.
max
(
Math
.
min
(
handle
.
x
+
(
handle
.
width
-
width
)
/
2
,
slider
.
width
-
width
),
0
)
QGCLabel
{
...
...
@@ -93,7 +93,7 @@ Item {
Rectangle
{
id
:
handle
;
smooth
:
true
width
:
ScreenTools
.
pixelSizeFactor
*
(
2
6
);
width
:
ScreenTools
.
defaultFontPixelSize
*
(
2.1
6
);
y
:
(
slider
.
height
-
height
)
/
2
;
x
:
(
slider
.
value
-
slider
.
minimum
)
*
slider
.
length
/
(
slider
.
maximum
-
slider
.
minimum
)
...
...
src/ui/qmlcommon/QGCSpeedWidget.qml
View file @
9c94295b
...
...
@@ -34,13 +34,13 @@ import QGroundControl.Controls 1.0
Rectangle
{
id
:
root
property
real
speed
:
0
property
real
_reticleSpacing
:
ScreenTools
.
pixelSizeFactor
*
(
10
)
property
real
_reticleHeight
:
ScreenTools
.
pixelSizeFactor
*
(
2
)
property
real
_reticleSpacing
:
ScreenTools
.
defaultFontPixelSize
*
(
0.83
)
property
real
_reticleHeight
:
ScreenTools
.
defaultFontPixelSize
*
(
0.166
)
property
real
_reticleSlot
:
_reticleSpacing
+
_reticleHeight
anchors.verticalCenter
:
parent
.
verticalCenter
z
:
10
smooth
:
true
radius
:
ScreenTools
.
pixelSizeFactor
*
(
5
)
radius
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
border.color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
)
}
...
...
@@ -49,7 +49,7 @@ Rectangle {
}
Rectangle
{
id
:
clipRect
height
:
parent
.
height
-
ScreenTools
.
pixelSizeFactor
*
(
5
)
height
:
parent
.
height
-
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
width
:
parent
.
width
clip
:
true
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
);
...
...
@@ -63,14 +63,14 @@ Rectangle {
model
:
40
Rectangle
{
property
int
_speed
:
-
(
index
-
20
)
width
:
(
_speed
%
5
===
0
)
?
ScreenTools
.
pixelSizeFactor
*
(
10
)
:
ScreenTools
.
pixelSizeFactor
*
(
1
5
)
width
:
(
_speed
%
5
===
0
)
?
ScreenTools
.
defaultFontPixelSize
*
(
0.83
)
:
ScreenTools
.
defaultFontPixelSize
*
(
1.2
5
)
anchors.right
:
parent
.
right
height
:
_reticleHeight
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.35
)
QGCLabel
{
visible
:
(
_speed
%
5
===
0
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenterOffset
:
ScreenTools
.
pixelSizeFactor
*
(
-
30
)
anchors.horizontalCenterOffset
:
ScreenTools
.
defaultFontPixelSize
*
(
-
2.5
)
anchors.verticalCenter
:
parent
.
verticalCenter
antialiasing
:
true
font.weight
:
Font
.
DemiBold
...
...
src/ui/toolbar/MainToolBar.cc
View file @
9c94295b
...
...
@@ -31,7 +31,7 @@ This file is part of the QGROUNDCONTROL project
#include <QQmlEngine>
#include "MainToolBar.h"
#include "ScreenTools.h"
#include "ScreenTools
Controller
.h"
#include "MainWindow.h"
#include "UASMessageView.h"
#include "UASMessageHandler.h"
...
...
@@ -64,8 +64,8 @@ MainToolBar::MainToolBar(QWidget* parent)
if
(
pl
)
{
pl
->
setContentsMargins
(
0
,
0
,
0
,
0
);
}
setMinimumHeight
(
40
*
ScreenTools
::
pixelSizeFactor_s
()
);
setMaximumHeight
(
40
*
ScreenTools
::
pixelSizeFactor_s
()
);
setMinimumHeight
(
ScreenToolsController
::
defaultFontPixelSize_s
()
*
3
);
setMaximumHeight
(
ScreenToolsController
::
defaultFontPixelSize_s
()
*
3
);
// Tool Bar Preferences
QSettings
settings
;
settings
.
beginGroup
(
TOOL_BAR_SETTINGS_GROUP
);
...
...
src/ui/toolbar/MainToolBar.qml
View file @
9c94295b
...
...
@@ -197,7 +197,7 @@ Rectangle {
visible
:
!
ScreenTools
.
isMobile
Connections
{
target
:
ScreenTools
onRepaintRequested
Changed
:
{
onRepaintRequested
:
{
setupButton
.
repaintChevron
=
true
;
planButton
.
repaintChevron
=
true
;
flyButton
.
repaintChevron
=
true
;
...
...
@@ -338,7 +338,7 @@ Rectangle {
QGCLabel
{
id
:
messageText
text
:
(
MavManager
.
messageCount
>
0
)
?
MavManager
.
messageCount
:
''
font.pixelSize
:
ScreenTools
.
font14
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -424,7 +424,7 @@ Rectangle {
QGCLabel
{
id
:
satelitteText
text
:
MavManager
.
satelliteCount
>=
0
?
MavManager
.
satelliteCount
:
'
NA
'
font.pixelSize
:
MavManager
.
satelliteCount
>=
0
?
ScreenTools
.
font14
:
ScreenTools
.
font10
font.pixelSize
:
MavManager
.
satelliteCount
>=
0
?
ScreenTools
.
defaultFontPixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
...
...
@@ -459,7 +459,7 @@ Rectangle {
anchors.rightMargin
:
getProportionalDimmension
(
6
)
anchors.verticalCenter
:
parent
.
verticalCenter
horizontalAlignment
:
Text
.
AlignRight
font.pixelSize
:
ScreenTools
.
font12
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -492,7 +492,7 @@ Rectangle {
anchors.right
:
parent
.
right
QGCLabel
{
text
:
'
R
'
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -500,7 +500,7 @@ Rectangle {
text
:
mainToolBar
.
telemetryRRSSI
+
'
dB
'
width
:
getProportionalDimmension
(
30
)
horizontalAlignment
:
Text
.
AlignRight
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -509,7 +509,7 @@ Rectangle {
anchors.right
:
parent
.
right
QGCLabel
{
text
:
'
L
'
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -517,7 +517,7 @@ Rectangle {
text
:
mainToolBar
.
telemetryLRSSI
+
'
dB
'
width
:
getProportionalDimmension
(
30
)
horizontalAlignment
:
Text
.
AlignRight
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -548,7 +548,7 @@ Rectangle {
QGCLabel
{
visible
:
batteryStatus
.
visible
&&
MavManager
.
batteryConsumed
<
0.0
text
:
MavManager
.
batteryVoltage
.
toFixed
(
1
)
+
'
V
'
;
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.right
:
parent
.
right
anchors.rightMargin
:
getProportionalDimmension
(
6
)
...
...
@@ -566,7 +566,7 @@ Rectangle {
text
:
MavManager
.
batteryVoltage
.
toFixed
(
1
)
+
'
V
'
;
width
:
getProportionalDimmension
(
30
)
horizontalAlignment
:
Text
.
AlignRight
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -574,7 +574,7 @@ Rectangle {
text
:
MavManager
.
batteryConsumed
.
toFixed
(
0
)
+
'
mA
'
;
width
:
getProportionalDimmension
(
30
)
horizontalAlignment
:
Text
.
AlignRight
font.pixelSize
:
ScreenTools
.
font11
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
color
:
colorWhite
}
...
...
@@ -599,7 +599,7 @@ Rectangle {
QGCLabel
{
id
:
armedStatusText
text
:
(
MavManager
.
systemArmed
)
?
qsTr
(
"
ARMED
"
)
:
qsTr
(
"
DISARMED
"
)
font.pixelSize
:
ScreenTools
.
font12
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.centerIn
:
parent
color
:
(
MavManager
.
systemArmed
)
?
colorOrangeText
:
colorGreenText
...
...
@@ -618,7 +618,7 @@ Rectangle {
QGCLabel
{
id
:
stateStatusText
text
:
MavManager
.
currentState
font.pixelSize
:
ScreenTools
.
font12
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.centerIn
:
parent
color
:
(
MavManager
.
currentState
===
"
STANDBY
"
)
?
colorGreenText
:
colorRedText
...
...
@@ -639,7 +639,7 @@ Rectangle {
QGCLabel
{
id
:
modeStatusText
text
:
MavManager
.
currentMode
font.pixelSize
:
ScreenTools
.
font12
font.pixelSize
:
ScreenTools
.
smallFontPixelSize
font.weight
:
Font
.
DemiBold
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -660,7 +660,7 @@ Rectangle {
QGCLabel
{
id
:
connectionStatusText
text
:
qsTr
(
"
CONNECTION LOST
"
)
font.pixelSize
:
ScreenTools
.
font14
font.pixelSize
:
ScreenTools
.
defaultFontPixelSize
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