Browse Source

Merge pull request #4490 from dogmaphobic/moreTweaks

More tweaks
QGC4.4
Gus Grubba 8 years ago committed by GitHub
parent
commit
ef3d54014a
  1. 3
      src/MissionEditor/MissionEditor.qml
  2. 8
      src/QmlControls/ScreenTools.qml
  3. 18
      src/api/QGCOptions.h
  4. 1
      src/ui/preferences/GeneralSettings.qml
  5. 3
      src/ui/toolbar/MainToolBarController.h

3
src/MissionEditor/MissionEditor.qml

@ -554,6 +554,7 @@ QGCView {
anchors.leftMargin: parent.width - _rightPanelWidth anchors.leftMargin: parent.width - _rightPanelWidth
anchors.left: parent.left anchors.left: parent.left
spacing: _horizontalMargin spacing: _horizontalMargin
visible: QGroundControl.corePlugin.options.enablePlanViewSelector
readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75 readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75
@ -615,7 +616,7 @@ QGCView {
Item { Item {
id: missionItemEditor id: missionItemEditor
anchors.topMargin: _margin anchors.topMargin: _margin
anchors.top: planElementSelectorRow.bottom anchors.top: planElementSelectorRow.visible ? planElementSelectorRow.bottom : planElementSelectorRow.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
width: _rightPanelWidth width: _rightPanelWidth

8
src/QmlControls/ScreenTools.qml

@ -47,7 +47,7 @@ Item {
property real largeFontPointSize: 10 property real largeFontPointSize: 10
property real availableHeight: 0 property real availableHeight: 0
property real toolbarHeight: defaultFontPixelHeight * 3 property real toolbarHeight: 0
readonly property real smallFontPointRatio: 0.75 readonly property real smallFontPointRatio: 0.75
readonly property real mediumFontPointRatio: 1.25 readonly property real mediumFontPointRatio: 1.25
@ -93,6 +93,7 @@ Item {
smallFontPointSize = defaultFontPointSize * _screenTools.smallFontPointRatio smallFontPointSize = defaultFontPointSize * _screenTools.smallFontPointRatio
mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio
largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio
toolbarHeight = defaultFontPixelHeight * 3 * QGroundControl.corePlugin.options.toolbarHeightMultiplier
} }
Text { Text {
@ -107,7 +108,10 @@ Item {
property real fontWidth: contentWidth property real fontWidth: contentWidth
property real fontHeight: contentHeight property real fontHeight: contentHeight
Component.onCompleted: { Component.onCompleted: {
var baseSize = QGroundControl.baseFontPointSize; var baseSize = QGroundControl.corePlugin.options.defaultFontPointSize
if(baseSize == 0.0) {
baseSize = QGroundControl.baseFontPointSize;
}
//-- If this is the first time (not saved in settings) //-- If this is the first time (not saved in settings)
if(baseSize < 6 || baseSize > 48) { if(baseSize < 6 || baseSize > 48) {
//-- Init base size base on the platform //-- Init base size base on the platform

18
src/api/QGCOptions.h

@ -29,6 +29,9 @@ public:
Q_PROPERTY(bool definesVideo READ definesVideo CONSTANT) Q_PROPERTY(bool definesVideo READ definesVideo CONSTANT)
Q_PROPERTY(uint16_t videoUDPPort READ videoUDPPort CONSTANT) Q_PROPERTY(uint16_t videoUDPPort READ videoUDPPort CONSTANT)
Q_PROPERTY(QString videoRSTPUrl READ videoRSTPUrl CONSTANT) Q_PROPERTY(QString videoRSTPUrl READ videoRSTPUrl CONSTANT)
Q_PROPERTY(double toolbarHeightMultiplier READ toolbarHeightMultiplier CONSTANT)
Q_PROPERTY(double defaultFontPointSize READ defaultFontPointSize CONSTANT)
Q_PROPERTY(bool enablePlanViewSelector READ enablePlanViewSelector CONSTANT)
//! Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)? //! Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/*! /*!
@ -65,4 +68,19 @@ public:
@return RTSP url to use. Return "" to disable RTSP. @return RTSP url to use. Return "" to disable RTSP.
*/ */
virtual QString videoRSTPUrl () { return QString(); } virtual QString videoRSTPUrl () { return QString(); }
//! Main ToolBar Multiplier.
/*!
@return Factor to use when computing toolbar height
*/
virtual double toolbarHeightMultiplier () { return 1.0; }
//! Application wide default font point size
/*!
@return Font size or 0.0 to use computed size.
*/
virtual double defaultFontPointSize () { return 0.0; }
//! Enable Plan View Selector (Mission, Fence or Rally)
/*!
@return True or false
*/
virtual bool enablePlanViewSelector () { return true; }
}; };

1
src/ui/preferences/GeneralSettings.qml

@ -145,6 +145,7 @@ QGCView {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Base UI Font Point Size //-- Base UI Font Point Size
Row { Row {
visible: QGroundControl.corePlugin.options.defaultFontPointSize < 1.0
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
id: baseFontLabel id: baseFontLabel

3
src/ui/toolbar/MainToolBarController.h

@ -37,7 +37,6 @@ public:
MainToolBarController(QObject* parent = NULL); MainToolBarController(QObject* parent = NULL);
~MainToolBarController(); ~MainToolBarController();
Q_PROPERTY(double height MEMBER _toolbarHeight NOTIFY heightChanged)
Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged) Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged)
Q_PROPERTY(int telemetryLRSSI READ telemetryLRSSI NOTIFY telemetryLRSSIChanged) Q_PROPERTY(int telemetryLRSSI READ telemetryLRSSI NOTIFY telemetryLRSSIChanged)
Q_PROPERTY(unsigned int telemetryRXErrors READ telemetryRXErrors NOTIFY telemetryRXErrorsChanged) Q_PROPERTY(unsigned int telemetryRXErrors READ telemetryRXErrors NOTIFY telemetryRXErrorsChanged)
@ -82,8 +81,6 @@ private:
uint32_t _telemetryLNoise; uint32_t _telemetryLNoise;
uint32_t _telemetryRNoise; uint32_t _telemetryRNoise;
double _toolbarHeight;
QStringList _toolbarMessageQueue; QStringList _toolbarMessageQueue;
QMutex _toolbarMessageQueueMutex; QMutex _toolbarMessageQueueMutex;
}; };

Loading…
Cancel
Save