Commit 8e347812 authored by dogmaphobic's avatar dogmaphobic

Making ScreenTools a Singleton.

parent 97568cf4
...@@ -36,7 +36,6 @@ Item { ...@@ -36,7 +36,6 @@ Item {
Loader { Loader {
property FlightModesComponentController controller: FlightModesComponentController { } property FlightModesComponentController controller: FlightModesComponentController { }
property QGCPalette qgcPal: QGCPalette { colorGroupEnabled: true } property QGCPalette qgcPal: QGCPalette { colorGroupEnabled: true }
property ScreenTools screenTools: ScreenTools { }
property bool loading: true property bool loading: true
anchors.fill: parent anchors.fill: parent
...@@ -364,7 +363,7 @@ Item { ...@@ -364,7 +363,7 @@ Item {
QGCLabel { QGCLabel {
text: "FLIGHT MODES CONFIG" text: "FLIGHT MODES CONFIG"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -894,7 +893,7 @@ Item { ...@@ -894,7 +893,7 @@ Item {
QGCLabel { QGCLabel {
text: "FLIGHT MODES CONFIG" text: "FLIGHT MODES CONFIG"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
QGCLabel { QGCLabel {
......
...@@ -45,7 +45,6 @@ Rectangle { ...@@ -45,7 +45,6 @@ Rectangle {
property int firstColumnWidth: 220 property int firstColumnWidth: 220
property int textEditWidth: 80 property int textEditWidth: 80
property ScreenTools screenTools: ScreenTools { }
property Fact battNumCells: Fact { name: "BAT_N_CELLS" } property Fact battNumCells: Fact { name: "BAT_N_CELLS" }
property Fact battHighVolt: Fact { name: "BAT_V_CHARGED" } property Fact battHighVolt: Fact { name: "BAT_V_CHARGED" }
...@@ -98,13 +97,13 @@ Rectangle { ...@@ -98,13 +97,13 @@ Rectangle {
QGCLabel { QGCLabel {
text: "POWER CONFIG" text: "POWER CONFIG"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
QGCLabel { QGCLabel {
text: "Battery" text: "Battery"
color: palette.text color: palette.text
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Rectangle { Rectangle {
...@@ -162,7 +161,7 @@ Rectangle { ...@@ -162,7 +161,7 @@ Rectangle {
width: 40 width: 40
antialiasing: true antialiasing: true
Connections { Connections {
target: screenTools target: ScreenTools
onRepaintRequestedChanged: { onRepaintRequestedChanged: {
arrows.requestPaint(); arrows.requestPaint();
} }
...@@ -231,7 +230,7 @@ Rectangle { ...@@ -231,7 +230,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "Propeller Function" text: "Propeller Function"
color: palette.text color: palette.text
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Rectangle { Rectangle {
width: parent.width width: parent.width
...@@ -245,7 +244,7 @@ Rectangle { ...@@ -245,7 +244,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "Magnetometer Distortion" text: "Magnetometer Distortion"
color: palette.text color: palette.text
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Rectangle { Rectangle {
width: parent.width width: parent.width
...@@ -264,7 +263,7 @@ Rectangle { ...@@ -264,7 +263,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "Advanced Power Settings" text: "Advanced Power Settings"
color: palette.text color: palette.text
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
visible: showAdvanced.checked visible: showAdvanced.checked
} }
Rectangle { Rectangle {
......
...@@ -38,7 +38,6 @@ Rectangle { ...@@ -38,7 +38,6 @@ Rectangle {
height: 600 height: 600
color: palette.window color: palette.window
property ScreenTools screenTools: ScreenTools { }
property int flightLineWidth: 2 // width of lines for flight graphic property int flightLineWidth: 2 // width of lines for flight graphic
property int loiterAltitudeColumnWidth: 180 // width of loiter altitude column property int loiterAltitudeColumnWidth: 180 // width of loiter altitude column
property int shadedMargin: 20 // margin inset for shaded areas property int shadedMargin: 20 // margin inset for shaded areas
...@@ -54,7 +53,7 @@ Rectangle { ...@@ -54,7 +53,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "SAFETY CONFIG" text: "SAFETY CONFIG"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -62,7 +61,7 @@ Rectangle { ...@@ -62,7 +61,7 @@ Rectangle {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Return Home Triggers //-- Return Home Triggers
QGCLabel { text: "Triggers For Return Home"; color: palette.text; font.pointSize: screenTools.fontPointFactor * (20); } QGCLabel { text: "Triggers For Return Home"; color: palette.text; font.pointSize: ScreenTools.fontPointFactor * (20); }
Item { height: 10; width: 10 } // spacer Item { height: 10; width: 10 } // spacer
...@@ -121,7 +120,7 @@ Rectangle { ...@@ -121,7 +120,7 @@ Rectangle {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Return Home Settings //-- Return Home Settings
QGCLabel { text: "Return Home Settings"; font.pointSize: screenTools.fontPointFactor * (20); } QGCLabel { text: "Return Home Settings"; font.pointSize: ScreenTools.fontPointFactor * (20); }
Item { height: 10; width: 10 } // spacer Item { height: 10; width: 10 } // spacer
...@@ -291,7 +290,7 @@ Rectangle { ...@@ -291,7 +290,7 @@ Rectangle {
QGCLabel { QGCLabel {
property Fact fact: Fact { name: "NAV_RCL_OBC" } property Fact fact: Fact { name: "NAV_RCL_OBC" }
width: parent.width width: parent.width
font.pointSize: screenTools.fontPointFactor * (14); font.pointSize: ScreenTools.fontPointFactor * (14);
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
...@@ -299,7 +298,7 @@ Rectangle { ...@@ -299,7 +298,7 @@ Rectangle {
QGCLabel { QGCLabel {
property Fact fact: Fact { name: "NAV_DLL_OBC" } property Fact fact: Fact { name: "NAV_DLL_OBC" }
width: parent.width width: parent.width
font.pointSize: screenTools.fontPointFactor * (14); font.pointSize: ScreenTools.fontPointFactor * (14);
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
......
...@@ -34,7 +34,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -34,7 +34,6 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
property QGCPalette qgcPal: QGCPalette { colorGroupEnabled: true } property QGCPalette qgcPal: QGCPalette { colorGroupEnabled: true }
property ScreenTools screenTools: ScreenTools { }
readonly property int rotationColumnWidth: 200 readonly property int rotationColumnWidth: 200
readonly property var rotations: [ readonly property var rotations: [
...@@ -332,7 +331,7 @@ Rectangle { ...@@ -332,7 +331,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "SENSORS CONFIG" text: "SENSORS CONFIG"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -437,7 +436,7 @@ Rectangle { ...@@ -437,7 +436,7 @@ Rectangle {
id: orientationCalAreaHelpText id: orientationCalAreaHelpText
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pointSize: screenTools.fontPointFactor * (17); font.pointSize: ScreenTools.fontPointFactor * (17);
} }
Flow { Flow {
......
...@@ -84,6 +84,20 @@ const char* QGCApplication::_savedFileParameterDirectoryName = "SavedParameters" ...@@ -84,6 +84,20 @@ const char* QGCApplication::_savedFileParameterDirectoryName = "SavedParameters"
const char* QGCApplication::_darkStyleFile = ":/res/styles/style-dark.css"; const char* QGCApplication::_darkStyleFile = ":/res/styles/style-dark.css";
const char* QGCApplication::_lightStyleFile = ":/res/styles/style-light.css"; const char* QGCApplication::_lightStyleFile = ":/res/styles/style-light.css";
/**
* @brief ScreenTools creation callback
*
* This is called by the QtQuick engine for creating the singleton
**/
#include <QQmlEngine>
static QObject* screenToolsSingletonFactory(QQmlEngine*, QJSEngine*)
{
ScreenTools* screenTools = new ScreenTools;
return screenTools;
}
/** /**
* @brief Constructor for the main application. * @brief Constructor for the main application.
* *
...@@ -272,9 +286,11 @@ void QGCApplication::_initCommon(void) ...@@ -272,9 +286,11 @@ void QGCApplication::_initCommon(void)
// Register our Qml objects // Register our Qml objects
qmlRegisterType<QGCPalette>("QGroundControl.Palette", 1, 0, "QGCPalette"); qmlRegisterType<QGCPalette>("QGroundControl.Palette", 1, 0, "QGCPalette");
qmlRegisterType<ScreenTools>("QGroundControl.ScreenTools", 1, 0, "ScreenTools");
qmlRegisterType<ViewWidgetController>("QGroundControl.Controllers", 1, 0, "ViewWidgetController"); qmlRegisterType<ViewWidgetController>("QGroundControl.Controllers", 1, 0, "ViewWidgetController");
qmlRegisterType<ParameterEditorController>("QGroundControl.Controllers", 1, 0, "ParameterEditorController"); qmlRegisterType<ParameterEditorController>("QGroundControl.Controllers", 1, 0, "ParameterEditorController");
//-- Create QML Singleton Interfaces
qmlRegisterSingletonType<ScreenTools>("QGroundControl.ScreenTools", 1, 0, "ScreenTools", screenToolsSingletonFactory);
} }
bool QGCApplication::_initForNormalAppBoot(void) bool QGCApplication::_initForNormalAppBoot(void)
...@@ -465,6 +481,7 @@ void QGCApplication::_createSingletons(void) ...@@ -465,6 +481,7 @@ void QGCApplication::_createSingletons(void)
MAVLinkProtocol* mavlink = MAVLinkProtocol::_createSingleton(); MAVLinkProtocol* mavlink = MAVLinkProtocol::_createSingleton();
Q_UNUSED(mavlink); Q_UNUSED(mavlink);
Q_ASSERT(mavlink); Q_ASSERT(mavlink);
} }
void QGCApplication::_destroySingletons(void) void QGCApplication::_destroySingletons(void)
......
...@@ -23,17 +23,15 @@ Button { ...@@ -23,17 +23,15 @@ Button {
property int __lastGlobalMouseX: 0 property int __lastGlobalMouseX: 0
property int __lastGlobalMouseY: 0 property int __lastGlobalMouseY: 0
property ScreenTools __screenTools: ScreenTools { }
Connections { Connections {
target: __behavior target: __behavior
onMouseXChanged: { onMouseXChanged: {
__lastGlobalMouseX = __screenTools.mouseX __lastGlobalMouseX = ScreenTools.mouseX
__lastGlobalMouseY = __screenTools.mouseY __lastGlobalMouseY = ScreenTools.mouseY
} }
onMouseYChanged: { onMouseYChanged: {
__lastGlobalMouseX = __screenTools.mouseX __lastGlobalMouseX = ScreenTools.mouseX
__lastGlobalMouseY = __screenTools.mouseY __lastGlobalMouseY = ScreenTools.mouseY
} }
onEntered: { __forceHoverOff; false; hoverTimer.start() } onEntered: { __forceHoverOff; false; hoverTimer.start() }
onExited: { __forceHoverOff; false; hoverTimer.stop() } onExited: { __forceHoverOff; false; hoverTimer.stop() }
...@@ -45,7 +43,7 @@ Button { ...@@ -45,7 +43,7 @@ Button {
repeat: true repeat: true
onTriggered: { onTriggered: {
if (__lastGlobalMouseX != __screenTools.mouseX || __lastGlobalMouseY != __screenTools.mouseY) { if (__lastGlobalMouseX != ScreenTools.mouseX || __lastGlobalMouseY != ScreenTools.mouseY) {
__forceHoverOff = true __forceHoverOff = true
} else { } else {
__forceHoverOff = false __forceHoverOff = false
...@@ -106,7 +104,7 @@ Button { ...@@ -106,7 +104,7 @@ Button {
id: text id: text
antialiasing: true antialiasing: true
text: control.text text: control.text
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
......
...@@ -7,7 +7,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -7,7 +7,6 @@ import QGroundControl.ScreenTools 1.0
CheckBox { CheckBox {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
style: CheckBoxStyle { style: CheckBoxStyle {
label: Item { label: Item {
...@@ -30,7 +29,7 @@ CheckBox { ...@@ -30,7 +29,7 @@ CheckBox {
id: text id: text
text: control.text text: control.text
antialiasing: true antialiasing: true
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
anchors.centerIn: parent anchors.centerIn: parent
......
...@@ -8,11 +8,10 @@ import QGroundControl.ScreenTools 1.0 ...@@ -8,11 +8,10 @@ import QGroundControl.ScreenTools 1.0
ComboBox { ComboBox {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
property bool __showHighlight: pressed | hovered property bool __showHighlight: pressed | hovered
style: ComboBoxStyle { style: ComboBoxStyle {
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
textColor: __showHighlight ? textColor: __showHighlight ?
control.__qgcPal.buttonHighlightText : control.__qgcPal.buttonHighlightText :
control.__qgcPal.buttonText control.__qgcPal.buttonText
......
...@@ -7,11 +7,10 @@ import QGroundControl.ScreenTools 1.0 ...@@ -7,11 +7,10 @@ import QGroundControl.ScreenTools 1.0
Text { Text {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled } QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
property bool enabled: true property bool enabled: true
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
color: __qgcPal.text color: __qgcPal.text
antialiasing: true antialiasing: true
} }
...@@ -8,10 +8,9 @@ import QGroundControl.ScreenTools 1.0 ...@@ -8,10 +8,9 @@ import QGroundControl.ScreenTools 1.0
Item { Item {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property bool allowDragging: true property bool allowDragging: true
property real minimumWidth: __screenTools.pixelSizeFactor * (60) property real minimumWidth: ScreenTools.pixelSizeFactor * (60)
property real minimumHeight: __screenTools.pixelSizeFactor * (60) property real minimumHeight: ScreenTools.pixelSizeFactor * (60)
property alias tForm: tform property alias tForm: tform
signal resetRequested() signal resetRequested()
transform: Scale { transform: Scale {
......
...@@ -7,7 +7,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -7,7 +7,6 @@ import QGroundControl.ScreenTools 1.0
RadioButton { RadioButton {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
style: RadioButtonStyle { style: RadioButtonStyle {
label: Item { label: Item {
...@@ -29,7 +28,7 @@ RadioButton { ...@@ -29,7 +28,7 @@ RadioButton {
Text { Text {
id: text id: text
text: control.text text: control.text
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
antialiasing: true antialiasing: true
anchors.centerIn: parent anchors.centerIn: parent
......
...@@ -10,7 +10,6 @@ TextField { ...@@ -10,7 +10,6 @@ TextField {
property string unitsLabel: "" property string unitsLabel: ""
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
textColor: __qgcPal.textFieldText textColor: __qgcPal.textFieldText
...@@ -51,7 +50,7 @@ TextField { ...@@ -51,7 +50,7 @@ TextField {
width: unitsLabelWidthGenerator.width width: unitsLabelWidthGenerator.width
text: control.unitsLabel text: control.unitsLabel
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
antialiasing: true antialiasing: true
color: control.textColor color: control.textColor
......
...@@ -57,15 +57,13 @@ public: ...@@ -57,15 +57,13 @@ public:
If you use a \c Canvas element inside some QML widget, you can use this code to handle repaint: If you use a \c Canvas element inside some QML widget, you can use this code to handle repaint:
@code @code
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
...
property ScreenTools screenTools: ScreenTools { }
... ...
Canvas { Canvas {
id: myCanvas id: myCanvas
height: 40 height: 40
width: 40 width: 40
Connections { Connections {
target: screenTools target: ScreenTools
onRepaintRequestedChanged: { onRepaintRequestedChanged: {
myCanvas.requestPaint(); myCanvas.requestPaint();
} }
......
...@@ -14,7 +14,6 @@ Button { ...@@ -14,7 +14,6 @@ Button {
property bool setupComplete: true property bool setupComplete: true
property bool setupIndicator: true property bool setupIndicator: true
property string imageResource: "subMenuButtonImage.png" property string imageResource: "subMenuButtonImage.png"
property ScreenTools __screenTools: ScreenTools { }
style: ButtonStyle { style: ButtonStyle {
id: buttonStyle id: buttonStyle
...@@ -41,7 +40,7 @@ Button { ...@@ -41,7 +40,7 @@ Button {
horizontalAlignment: TextEdit.AlignHCenter horizontalAlignment: TextEdit.AlignHCenter
text: control.text text: control.text
font.pointSize: __screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
antialiasing: true antialiasing: true
color: __showHighlight ? __qgcPal.buttonHighlightText : __qgcPal.buttonText color: __showHighlight ? __qgcPal.buttonHighlightText : __qgcPal.buttonText
......
...@@ -42,7 +42,6 @@ Rectangle { ...@@ -42,7 +42,6 @@ Rectangle {
property var imageSource: "" property var imageSource: ""
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
width: 200 width: 200
height: 200 height: 200
...@@ -71,7 +70,7 @@ Rectangle { ...@@ -71,7 +70,7 @@ Rectangle {
height: parent.height height: parent.height
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
font.pointSize: __screenTools.fontPointFactor * (25); font.pointSize: ScreenTools.fontPointFactor * (25);
font.bold: true font.bold: true
color: "black" color: "black"
...@@ -82,7 +81,7 @@ Rectangle { ...@@ -82,7 +81,7 @@ Rectangle {
height: parent.height height: parent.height
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
font.pointSize: __screenTools.fontPointFactor * (25); font.pointSize: ScreenTools.fontPointFactor * (25);
color: calInProgress ? "yellow" : "white" color: calInProgress ? "yellow" : "white"
text: parent.calText text: parent.calText
......
...@@ -36,7 +36,6 @@ Rectangle { ...@@ -36,7 +36,6 @@ Rectangle {
height: 600 height: 600
property var qgcPal: QGCPalette { colorGroupEnabled: true } property var qgcPal: QGCPalette { colorGroupEnabled: true }
property ScreenTools screenTools: ScreenTools { }
property FirmwareUpgradeController controller: FirmwareUpgradeController { property FirmwareUpgradeController controller: FirmwareUpgradeController {
upgradeButton: upgradeButton upgradeButton: upgradeButton
progressBar: progressBar progressBar: progressBar
...@@ -51,7 +50,7 @@ Rectangle { ...@@ -51,7 +50,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "FIRMWARE UPDATE" text: "FIRMWARE UPDATE"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Item { Item {
...@@ -119,7 +118,7 @@ Rectangle { ...@@ -119,7 +118,7 @@ Rectangle {
height: 300 height: 300
readOnly: true readOnly: true
frameVisible: false frameVisible: false
font.pointSize: screenTools.defaultFontPointSize font.pointSize: ScreenTools.defaultFontPointSize
text: qsTr("Please disconnect all vehicles from QGroundControl before selecting Upgrade.") text: qsTr("Please disconnect all vehicles from QGroundControl before selecting Upgrade.")
......
...@@ -28,6 +28,39 @@ import QGroundControl.Controls 1.0 ...@@ -28,6 +28,39 @@ import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
ParameterEditor { Rectangle {
fullMode: true QGCPalette { id: qgcPal; colorGroupEnabled: true }
color: qgcPal.window
// We use an ExclusiveGroup to maintain the visibility of a single editing control at a time
ExclusiveGroup {
id: exclusiveEditorGroup
}
Column {
anchors.fill:parent
QGCLabel {
text: "PARAMETER EDITOR"
font.pointSize: ScreenTools.fontPointFactor * (20)
}
Item {
height: 20
width: 5
}
QGCLabel {
id: infoLabel
width: parent.width
wrapMode: Text.WordWrap
text: "Click a parameter value to modify. Right-click for additional options. Values which have been modified from the default are shown in orange. Use caution when modifying parameters here since the values are not checked for validity."
}
ParameterEditor {
width: parent.width
height: parent.height - (infoLabel.y + infoLabel.height)
}
}
} }
...@@ -35,7 +35,6 @@ Rectangle { ...@@ -35,7 +35,6 @@ Rectangle {
height: 400 height: 400
property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true } property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true }
property ScreenTools screenTools: ScreenTools { }
id: topLevel id: topLevel
objectName: "topLevel" objectName: "topLevel"
...@@ -47,7 +46,7 @@ Rectangle { ...@@ -47,7 +46,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "VEHICLE SUMMARY" text: "VEHICLE SUMMARY"
font.pointSize: screenTools.fontPointFactor * (20); font.pointSize: ScreenTools.fontPointFactor * (20);
} }
Item { Item {
...@@ -60,7 +59,7 @@ Rectangle { ...@@ -60,7 +59,7 @@ Rectangle {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: autopilot.setupComplete ? qgcPal.text : "red" color: autopilot.setupComplete ? qgcPal.text : "red"
font.pointSize: autopilot.setupComplete ? screenTools.defaultFontPointSize : screenTools.fontPointFactor * (20) font.pointSize: autopilot.setupComplete ? ScreenTools.defaultFontPointSize : ScreenTools.fontPointFactor * (20)
text: autopilot.setupComplete ? text: autopilot.setupComplete ?
"Below you will find a summary of the settings for your vehicle. To the left are the setup buttons for deatiled settings for each component." : "Below you will find a summary of the settings for your vehicle. To the left are the setup buttons for deatiled settings for each component." :
"WARNING: One or more of your vehicle's components require setup prior to flight. It will be shown with a red circular indicator below. " + "WARNING: One or more of your vehicle's components require setup prior to flight. It will be shown with a red circular indicator below. " +
......
This diff is collapsed.
...@@ -33,10 +33,9 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,10 +33,9 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real altitude: 50 property real altitude: 50
property real _reticleSpacing: __screenTools.pixelSizeFactor * (16) property real _reticleSpacing: ScreenTools.pixelSizeFactor * (16)
property real _reticleHeight: __screenTools.pixelSizeFactor * (2) property real _reticleHeight: ScreenTools.pixelSizeFactor * (2)
property real _reticleSlot: _reticleSpacing + _reticleHeight property real _reticleSlot: _reticleSpacing + _reticleHeight
property var _speedArray: [] property var _speedArray: []
property int _currentCenter: 0 property int _currentCenter: 0
...@@ -65,7 +64,7 @@ Rectangle { ...@@ -65,7 +64,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
smooth: true smooth: true
radius: __screenTools.pixelSizeFactor * (5) radius: ScreenTools.pixelSizeFactor * (5)
border.color: Qt.rgba(1,1,1,0.25) border.color: Qt.rgba(1,1,1,0.25)
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.65) } GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.65) }
...@@ -74,7 +73,7 @@ Rectangle { ...@@ -74,7 +73,7 @@ Rectangle {
} }
Rectangle { Rectangle {
id: clipRect id: clipRect
height: parent.height - __screenTools.pixelSizeFactor * (5) height: parent.height - ScreenTools.pixelSizeFactor * (5)
width: parent.width width: parent.width
clip: true clip: true
color: Qt.rgba(0,0,0,0); color: Qt.rgba(0,0,0,0);
...@@ -89,12 +88,12 @@ Rectangle { ...@@ -89,12 +88,12 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
Rectangle { Rectangle {
property int _alt: modelData property int _alt: modelData
width: (_alt % 10 === 0) ? __screenTools.pixelSizeFactor * (10) : __screenTools.pixelSizeFactor * (15) width: (_alt % 10 === 0) ? ScreenTools.pixelSizeFactor * (10) : ScreenTools.pixelSizeFactor * (15)
height: _reticleHeight height: _reticleHeight
color: Qt.rgba(1,1,1,0.35) color: Qt.rgba(1,1,1,0.35)
QGCLabel { QGCLabel {
visible: (_alt % 10 === 0) visible: (_alt % 10 === 0)
x: __screenTools.pixelSizeFactor * (20) x: ScreenTools.pixelSizeFactor * (20)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
antialiasing: true antialiasing: true
font.weight: Font.DemiBold font.weight: Font.DemiBold
......
...@@ -33,7 +33,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,7 +33,6 @@ import QGroundControl.ScreenTools 1.0
Item { Item {
id: root id: root
anchors.centerIn: parent anchors.centerIn: parent
property ScreenTools __screenTools: ScreenTools { }
property real rollAngle : 0 property real rollAngle : 0
property real pitchAngle: 0 property real pitchAngle: 0
......
...@@ -33,7 +33,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,7 +33,6 @@ import QGroundControl.ScreenTools 1.0
Item { Item {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real heading : 0 property real heading : 0
Image { Image {
id: compass id: compass
...@@ -59,8 +58,8 @@ Item { ...@@ -59,8 +58,8 @@ Item {
} }
Rectangle { Rectangle {
anchors.centerIn: compass anchors.centerIn: compass
width: __screenTools.pixelSizeFactor * (40) width: ScreenTools.pixelSizeFactor * (40)
height: __screenTools.pixelSizeFactor * (25) height: ScreenTools.pixelSizeFactor * (25)
border.color: Qt.rgba(1,1,1,0.15) border.color: Qt.rgba(1,1,1,0.15)
color: Qt.rgba(0,0,0,0.25) color: Qt.rgba(0,0,0,0.25)
QGCLabel { QGCLabel {
......
...@@ -33,10 +33,9 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,10 +33,9 @@ import QGroundControl.ScreenTools 1.0
QGCMovableItem { QGCMovableItem {
id: root id: root
property ScreenTools screenTools: ScreenTools { }
property real heading: 0 property real heading: 0
property real size: screenTools.pixelSizeFactor * (120) property real size: ScreenTools.pixelSizeFactor * (120)
property real _fontSize: screenTools.fontPointFactor * (12) property real _fontSize: ScreenTools.fontPointFactor * (12)
width: size width: size
height: size height: size
Rectangle { Rectangle {
......
...@@ -33,20 +33,19 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,20 +33,19 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real altitude: 0 property real altitude: 0
property real vertZ: 0 property real vertZ: 0
property bool showAltitude: true property bool showAltitude: true
property bool showClimbRate: true property bool showClimbRate: true
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width width: parent.width
height: (showAltitude && showClimbRate) ? __screenTools.pixelSizeFactor * (50) : __screenTools.pixelSizeFactor * (25) height: (showAltitude && showClimbRate) ? ScreenTools.pixelSizeFactor * (50) : ScreenTools.pixelSizeFactor * (25)
color: "black" color: "black"
border.color: Qt.rgba(1,1,1,0.25) border.color: Qt.rgba(1,1,1,0.25)
opacity: 1.0 opacity: 1.0
Column{ Column{
anchors.centerIn: parent anchors.centerIn: parent
spacing: __screenTools.pixelSizeFactor * (4) spacing: ScreenTools.pixelSizeFactor * (4)
QGCLabel { QGCLabel {
text: 'h: ' + altitude.toFixed(0) text: 'h: ' + altitude.toFixed(0)
font.weight: Font.DemiBold font.weight: Font.DemiBold
......
...@@ -33,20 +33,19 @@ import QGroundControl.ScreenTools 1.0 ...@@ -33,20 +33,19 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real airspeed: 0 property real airspeed: 0
property real groundspeed: 0 property real groundspeed: 0
property bool showAirSpeed: true property bool showAirSpeed: true
property bool showGroundSpeed: true property bool showGroundSpeed: true
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width width: parent.width
height: (showAirSpeed && showGroundSpeed) ? __screenTools.pixelSizeFactor * (50) : __screenTools.pixelSizeFactor * (25) height: (showAirSpeed && showGroundSpeed) ? ScreenTools.pixelSizeFactor * (50) : ScreenTools.pixelSizeFactor * (25)
color: "black" color: "black"
border.color: Qt.rgba(1,1,1,0.25) border.color: Qt.rgba(1,1,1,0.25)
opacity: 1.0 opacity: 1.0
Column{ Column{
anchors.centerIn: parent anchors.centerIn: parent
spacing: __screenTools.pixelSizeFactor * (4) spacing: ScreenTools.pixelSizeFactor * (4)
QGCLabel { QGCLabel {
text: 'GS: ' + groundspeed.toFixed(0) text: 'GS: ' + groundspeed.toFixed(0)
font.weight: Font.DemiBold font.weight: Font.DemiBold
......
...@@ -37,7 +37,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -37,7 +37,6 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real latitude: 37.803784 property real latitude: 37.803784
property real longitude : -122.462276 property real longitude : -122.462276
property real zoomLevel: 18 property real zoomLevel: 18
...@@ -165,9 +164,9 @@ Rectangle { ...@@ -165,9 +164,9 @@ Rectangle {
z: map.z + 20 z: map.z + 20
anchors { anchors {
bottom: parent.bottom; bottom: parent.bottom;
bottomMargin: __screenTools.pixelSizeFactor * (15) bottomMargin: ScreenTools.pixelSizeFactor * (15)
rightMargin: __screenTools.pixelSizeFactor * (20) rightMargin: ScreenTools.pixelSizeFactor * (20)
leftMargin: __screenTools.pixelSizeFactor * (20) leftMargin: ScreenTools.pixelSizeFactor * (20)
left: parent.left left: parent.left
} }
width: parent.width - anchors.rightMargin - anchors.leftMargin width: parent.width - anchors.rightMargin - anchors.leftMargin
...@@ -188,9 +187,9 @@ Rectangle { ...@@ -188,9 +187,9 @@ Rectangle {
opacity: 1 opacity: 1
anchors { anchors {
bottom: zoomSlider.top; bottom: zoomSlider.top;
bottomMargin: __screenTools.pixelSizeFactor * (8); bottomMargin: ScreenTools.pixelSizeFactor * (8);
left: zoomSlider.left left: zoomSlider.left
leftMargin: __screenTools.pixelSizeFactor * (4) leftMargin: ScreenTools.pixelSizeFactor * (4)
} }
Image { Image {
id: scaleImageLeft id: scaleImageLeft
...@@ -217,7 +216,7 @@ Rectangle { ...@@ -217,7 +216,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.bottomMargin: __screenTools.pixelSizeFactor * (10) anchors.bottomMargin: ScreenTools.pixelSizeFactor * (10)
text: "0 m" text: "0 m"
} }
Component.onCompleted: { Component.onCompleted: {
......
...@@ -11,7 +11,6 @@ Button { ...@@ -11,7 +11,6 @@ Button {
property var imageSource: undefined property var imageSource: undefined
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool __showHighlight: (pressed | hovered | checked) && !__forceHoverOff property bool __showHighlight: (pressed | hovered | checked) && !__forceHoverOff
property ScreenTools __screenTools: ScreenTools { }
// This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
// move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
...@@ -24,12 +23,12 @@ Button { ...@@ -24,12 +23,12 @@ Button {
Connections { Connections {
target: __behavior target: __behavior
onMouseXChanged: { onMouseXChanged: {
__lastGlobalMouseX = __screenTools.mouseX __lastGlobalMouseX = ScreenTools.mouseX
__lastGlobalMouseY = __screenTools.mouseY __lastGlobalMouseY = ScreenTools.mouseY
} }
onMouseYChanged: { onMouseYChanged: {
__lastGlobalMouseX = __screenTools.mouseX __lastGlobalMouseX = ScreenTools.mouseX
__lastGlobalMouseY = __screenTools.mouseY __lastGlobalMouseY = ScreenTools.mouseY
} }
onEntered: { __forceHoverOff; false; hoverTimer.start() } onEntered: { __forceHoverOff; false; hoverTimer.start() }
onExited: { __forceHoverOff; false; hoverTimer.stop() } onExited: { __forceHoverOff; false; hoverTimer.stop() }
...@@ -40,7 +39,7 @@ Button { ...@@ -40,7 +39,7 @@ Button {
interval: 250 interval: 250
repeat: true repeat: true
onTriggered: { onTriggered: {
if (__lastGlobalMouseX != __screenTools.mouseX || __lastGlobalMouseY != __screenTools.mouseY) { if (__lastGlobalMouseX != ScreenTools.mouseX || __lastGlobalMouseY != ScreenTools.mouseY) {
__forceHoverOff = true __forceHoverOff = true
} else { } else {
__forceHoverOff = false __forceHoverOff = false
......
...@@ -32,7 +32,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -32,7 +32,6 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Rectangle { Rectangle {
property ScreenTools screenTools: ScreenTools { }
property real pitchAngle: 0 property real pitchAngle: 0
property real rollAngle: 0 property real rollAngle: 0
property real size: 120 property real size: 120
...@@ -41,10 +40,10 @@ Rectangle { ...@@ -41,10 +40,10 @@ Rectangle {
property real _reticleSlot: _reticleSpacing + _reticleHeight property real _reticleSlot: _reticleSpacing + _reticleHeight
property real _longDash: size * 0.40 property real _longDash: size * 0.40
property real _shortDash: size * 0.25 property real _shortDash: size * 0.25
property real _fontSize: __screenTools.fontPointFactor * (11); property real _fontSize: ScreenTools.fontPointFactor * (11);
height: size * 0.9 height: size * 0.9
width: size width: size
radius: screenTools.pixelSizeFactor * (8) radius: ScreenTools.pixelSizeFactor * (8)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
clip: true clip: true
......
...@@ -45,7 +45,6 @@ import QGroundControl.ScreenTools 1.0 ...@@ -45,7 +45,6 @@ import QGroundControl.ScreenTools 1.0
Item { Item {
id: slider; id: slider;
height: 12 height: 12
property ScreenTools __screenTools: ScreenTools { }
property real value // value is read/write. property real value // value is read/write.
property real minimum: 0 property real minimum: 0
property real maximum: 1 property real maximum: 1
...@@ -53,15 +52,15 @@ Item { ...@@ -53,15 +52,15 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: __screenTools.pixelSizeFactor * (6) radius: ScreenTools.pixelSizeFactor * (6)
color: Qt.rgba(0,0,0,0.65); color: Qt.rgba(0,0,0,0.65);
} }
Rectangle { Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: __screenTools.pixelSizeFactor * (4) anchors.leftMargin: ScreenTools.pixelSizeFactor * (4)
radius: __screenTools.pixelSizeFactor * (4) radius: ScreenTools.pixelSizeFactor * (4)
height: __screenTools.pixelSizeFactor * (4) height: ScreenTools.pixelSizeFactor * (4)
width: handle.x - x width: handle.x - x
color: "#69bb17" color: "#69bb17"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -70,14 +69,14 @@ Item { ...@@ -70,14 +69,14 @@ Item {
Rectangle { Rectangle {
id: labelRect id: labelRect
width: label.width width: label.width
height: label.height + __screenTools.pixelSizeFactor * (4) height: label.height + ScreenTools.pixelSizeFactor * (4)
radius: __screenTools.pixelSizeFactor * (4) radius: ScreenTools.pixelSizeFactor * (4)
smooth: true smooth: true
color: Qt.rgba(1,1,1,0.75); color: Qt.rgba(1,1,1,0.75);
border.width: __screenTools.pixelSizeFactor * (1) border.width: ScreenTools.pixelSizeFactor * (1)
border.color: Qt.rgba(0,0,0,0.45); border.color: Qt.rgba(0,0,0,0.45);
anchors.bottom: handle.top anchors.bottom: handle.top
anchors.bottomMargin: __screenTools.pixelSizeFactor * (4) anchors.bottomMargin: ScreenTools.pixelSizeFactor * (4)
visible: mouseRegion.pressed visible: mouseRegion.pressed
x: Math.max(Math.min(handle.x + (handle.width - width ) / 2, slider.width - width), 0) x: Math.max(Math.min(handle.x + (handle.width - width ) / 2, slider.width - width), 0)
QGCLabel{ QGCLabel{
...@@ -94,7 +93,7 @@ Item { ...@@ -94,7 +93,7 @@ Item {
Rectangle { Rectangle {
id: handle; id: handle;
smooth: true smooth: true
width: __screenTools.pixelSizeFactor * (26); width: ScreenTools.pixelSizeFactor * (26);
y: (slider.height - height) / 2; y: (slider.height - height) / 2;
x: (slider.value - slider.minimum) * slider.length / (slider.maximum - slider.minimum) x: (slider.value - slider.minimum) * slider.length / (slider.maximum - slider.minimum)
......
...@@ -33,15 +33,14 @@ import QGroundControl.Controls 1.0 ...@@ -33,15 +33,14 @@ import QGroundControl.Controls 1.0
Rectangle { Rectangle {
id: root id: root
property ScreenTools __screenTools: ScreenTools { }
property real speed: 0 property real speed: 0
property real _reticleSpacing: __screenTools.pixelSizeFactor * (10) property real _reticleSpacing: ScreenTools.pixelSizeFactor * (10)
property real _reticleHeight: __screenTools.pixelSizeFactor * (2) property real _reticleHeight: ScreenTools.pixelSizeFactor * (2)
property real _reticleSlot: _reticleSpacing + _reticleHeight property real _reticleSlot: _reticleSpacing + _reticleHeight
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
z:10 z:10
smooth: true smooth: true
radius: __screenTools.pixelSizeFactor * (5) radius: ScreenTools.pixelSizeFactor * (5)
border.color: Qt.rgba(1,1,1,0.25) border.color: Qt.rgba(1,1,1,0.25)
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.65) } GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.65) }
...@@ -50,7 +49,7 @@ Rectangle { ...@@ -50,7 +49,7 @@ Rectangle {
} }
Rectangle { Rectangle {
id: clipRect id: clipRect
height: parent.height - __screenTools.pixelSizeFactor * (5) height: parent.height - ScreenTools.pixelSizeFactor * (5)
width: parent.width width: parent.width
clip: true clip: true
color: Qt.rgba(0,0,0,0); color: Qt.rgba(0,0,0,0);
...@@ -64,14 +63,14 @@ Rectangle { ...@@ -64,14 +63,14 @@ Rectangle {
model: 40 model: 40
Rectangle { Rectangle {
property int _speed: -(index - 20) property int _speed: -(index - 20)
width: (_speed % 5 === 0) ? __screenTools.pixelSizeFactor * (10) : __screenTools.pixelSizeFactor * (15) width: (_speed % 5 === 0) ? ScreenTools.pixelSizeFactor * (10) : ScreenTools.pixelSizeFactor * (15)
anchors.right: parent.right anchors.right: parent.right
height: _reticleHeight height: _reticleHeight
color: Qt.rgba(1,1,1,0.35) color: Qt.rgba(1,1,1,0.35)
QGCLabel { QGCLabel {
visible: (_speed % 5 === 0) visible: (_speed % 5 === 0)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: __screenTools.pixelSizeFactor * (-30) anchors.horizontalCenterOffset: ScreenTools.pixelSizeFactor * (-30)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
antialiasing: true antialiasing: true
font.weight: Font.DemiBold font.weight: Font.DemiBold
......
...@@ -41,7 +41,6 @@ Rectangle { ...@@ -41,7 +41,6 @@ Rectangle {
id: toolBarHolder id: toolBarHolder
property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true } property var qgcPal: QGCPalette { id: palette; colorGroupEnabled: true }
property ScreenTools __screenTools: ScreenTools { }
property int cellSpacerSize: mainToolBar.isMobile ? getProportionalDimmension(6) : getProportionalDimmension(4) property int cellSpacerSize: mainToolBar.isMobile ? getProportionalDimmension(6) : getProportionalDimmension(4)
property int cellHeight: getProportionalDimmension(30) property int cellHeight: getProportionalDimmension(30)
...@@ -196,7 +195,7 @@ Rectangle { ...@@ -196,7 +195,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: !mainToolBar.isMobile visible: !mainToolBar.isMobile
Connections { Connections {
target: __screenTools target: ScreenTools
onRepaintRequestedChanged: { onRepaintRequestedChanged: {
setupButton.repaintChevron = true; setupButton.repaintChevron = true;
planButton.repaintChevron = true; planButton.repaintChevron = true;
...@@ -338,7 +337,7 @@ Rectangle { ...@@ -338,7 +337,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: messageText id: messageText
text: (mainToolBar.messageCount > 0) ? mainToolBar.messageCount : '' text: (mainToolBar.messageCount > 0) ? mainToolBar.messageCount : ''
font.pointSize: __screenTools.fontPointFactor * (14); font.pointSize: ScreenTools.fontPointFactor * (14);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
...@@ -424,7 +423,7 @@ Rectangle { ...@@ -424,7 +423,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: satelitteText id: satelitteText
text: mainToolBar.satelliteCount >= 0 ? mainToolBar.satelliteCount : 'NA' text: mainToolBar.satelliteCount >= 0 ? mainToolBar.satelliteCount : 'NA'
font.pointSize: mainToolBar.satelliteCount >= 0 ? __screenTools.fontPointFactor * (14) : __screenTools.fontPointFactor * (10) font.pointSize: mainToolBar.satelliteCount >= 0 ? ScreenTools.fontPointFactor * (14) : ScreenTools.fontPointFactor * (10)
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
...@@ -459,7 +458,7 @@ Rectangle { ...@@ -459,7 +458,7 @@ Rectangle {
anchors.rightMargin: getProportionalDimmension(6) anchors.rightMargin: getProportionalDimmension(6)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
font.pointSize: __screenTools.fontPointFactor * (12); font.pointSize: ScreenTools.fontPointFactor * (12);
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: colorWhite color: colorWhite
} }
...@@ -492,7 +491,7 @@ Rectangle { ...@@ -492,7 +491,7 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
QGCLabel { QGCLabel {
text: 'R ' text: 'R '
font.pointSize: __screenTools.fontPointFactor * (11); font.pointSize: ScreenTools.fontPointFactor * (11);
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: colorWhite color: colorWhite
} }
...@@ -500,7 +499,7 @@ Rectangle { ...@@ -500,7 +499,7 @@ Rectangle {
text: mainToolBar.telemetryRRSSI + 'dB' text: mainToolBar.telemetryRRSSI + 'dB'
width: getProportionalDimmension(30) width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
font.pointSize: __screenTools.fontPointFactor * (11); font.pointSize: ScreenTools.fontPointFactor * (11);
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: colorWhite color: colorWhite
} }
...@@ -509,7 +508,7 @@ Rectangle { ...@@ -509,7 +508,7 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
QGCLabel { QGCLabel {
text: 'L ' text: 'L '
font.pointSize: __screenTools.fontPointFactor * (11); font.pointSize: ScreenTools.fontPointFactor * (11);
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: colorWhite color: colorWhite
} }
...@@ -517,7 +516,7 @@ Rectangle { ...@@ -517,7 +516,7 @@ Rectangle {
text: mainToolBar.telemetryLRSSI + 'dB' text: mainToolBar.telemetryLRSSI + 'dB'
width: getProportionalDimmension(30) width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
font.pointSize: __screenTools.fontPointFactor * (11); font.pointSize: ScreenTools.fontPointFactor * (11);
font.weight: Font.DemiBold font.weight: Font.DemiBold
color: colorWhite color: colorWhite
} }
...@@ -549,7 +548,7 @@ Rectangle { ...@@ -549,7 +548,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: batteryText id: batteryText
text: mainToolBar.batteryVoltage.toFixed(1) + 'V'; text: mainToolBar.batteryVoltage.toFixed(1) + 'V';
font.pointSize: __screenTools.fontPointFactor * (11); font.pointSize: ScreenTools.fontPointFactor * (11);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
...@@ -577,7 +576,7 @@ Rectangle { ...@@ -577,7 +576,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: armedStatusText id: armedStatusText
text: (mainToolBar.systemArmed) ? qsTr("ARMED") : qsTr("DISARMED") text: (mainToolBar.systemArmed) ? qsTr("ARMED") : qsTr("DISARMED")
font.pointSize: __screenTools.fontPointFactor * (12); font.pointSize: ScreenTools.fontPointFactor * (12);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.centerIn: parent anchors.centerIn: parent
color: (mainToolBar.systemArmed) ? colorOrangeText : colorGreenText color: (mainToolBar.systemArmed) ? colorOrangeText : colorGreenText
...@@ -596,7 +595,7 @@ Rectangle { ...@@ -596,7 +595,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: stateStatusText id: stateStatusText
text: mainToolBar.currentState text: mainToolBar.currentState
font.pointSize: __screenTools.fontPointFactor * (12); font.pointSize: ScreenTools.fontPointFactor * (12);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.centerIn: parent anchors.centerIn: parent
color: (mainToolBar.currentState === "STANDBY") ? colorGreenText : colorRedText color: (mainToolBar.currentState === "STANDBY") ? colorGreenText : colorRedText
...@@ -617,7 +616,7 @@ Rectangle { ...@@ -617,7 +616,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: modeStatusText id: modeStatusText
text: mainToolBar.currentMode text: mainToolBar.currentMode
font.pointSize: __screenTools.fontPointFactor * (12); font.pointSize: ScreenTools.fontPointFactor * (12);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -638,7 +637,7 @@ Rectangle { ...@@ -638,7 +637,7 @@ Rectangle {
QGCLabel { QGCLabel {
id: connectionStatusText id: connectionStatusText
text: qsTr("CONNECTION LOST") text: qsTr("CONNECTION LOST")
font.pointSize: __screenTools.fontPointFactor * (14); font.pointSize: ScreenTools.fontPointFactor * (14);
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment