From e74046c97d166bd453c5675e566f9b186f9fdb9d Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Mon, 30 Jan 2017 19:21:22 -0500 Subject: [PATCH 1/3] Remove unused code --- src/ui/toolbar/MainToolBarController.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ui/toolbar/MainToolBarController.h b/src/ui/toolbar/MainToolBarController.h index 19fb78e..c8f42b2 100644 --- a/src/ui/toolbar/MainToolBarController.h +++ b/src/ui/toolbar/MainToolBarController.h @@ -37,7 +37,6 @@ public: MainToolBarController(QObject* parent = NULL); ~MainToolBarController(); - Q_PROPERTY(double height MEMBER _toolbarHeight NOTIFY heightChanged) Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged) Q_PROPERTY(int telemetryLRSSI READ telemetryLRSSI NOTIFY telemetryLRSSIChanged) Q_PROPERTY(unsigned int telemetryRXErrors READ telemetryRXErrors NOTIFY telemetryRXErrorsChanged) @@ -82,8 +81,6 @@ private: uint32_t _telemetryLNoise; uint32_t _telemetryRNoise; - double _toolbarHeight; - QStringList _toolbarMessageQueue; QMutex _toolbarMessageQueueMutex; }; From a241a1b23006decba3eed2125182a93e8de75e6d Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Mon, 30 Jan 2017 20:33:26 -0500 Subject: [PATCH 2/3] Allow plugin to define default font size, toolbar height and option to display/hide plan view selector. --- src/MissionEditor/MissionEditor.qml | 3 ++- src/QmlControls/ScreenTools.qml | 8 ++++++-- src/api/QGCOptions.h | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/MissionEditor/MissionEditor.qml b/src/MissionEditor/MissionEditor.qml index e71b230..f2eee50 100644 --- a/src/MissionEditor/MissionEditor.qml +++ b/src/MissionEditor/MissionEditor.qml @@ -554,6 +554,7 @@ QGCView { anchors.leftMargin: parent.width - _rightPanelWidth anchors.left: parent.left spacing: _horizontalMargin + visible: QGroundControl.corePlugin.options.enablePlanViewSelector readonly property real _buttonRadius: ScreenTools.defaultFontPixelHeight * 0.75 @@ -615,7 +616,7 @@ QGCView { Item { id: missionItemEditor anchors.topMargin: _margin - anchors.top: planElementSelectorRow.bottom + anchors.top: planElementSelectorRow.visible ? planElementSelectorRow.bottom : planElementSelectorRow.top anchors.bottom: parent.bottom anchors.right: parent.right width: _rightPanelWidth diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index 84bb0a0..9645592 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -47,7 +47,7 @@ Item { property real largeFontPointSize: 10 property real availableHeight: 0 - property real toolbarHeight: defaultFontPixelHeight * 3 + property real toolbarHeight: 0 readonly property real smallFontPointRatio: 0.75 readonly property real mediumFontPointRatio: 1.25 @@ -93,6 +93,7 @@ Item { smallFontPointSize = defaultFontPointSize * _screenTools.smallFontPointRatio mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio + toolbarHeight = defaultFontPixelHeight * 3 * QGroundControl.corePlugin.options.toolbarHeightMultiplier } Text { @@ -107,7 +108,10 @@ Item { property real fontWidth: contentWidth property real fontHeight: contentHeight 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(baseSize < 6 || baseSize > 48) { //-- Init base size base on the platform diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index e1e9135..1845d3a 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -29,6 +29,9 @@ public: Q_PROPERTY(bool definesVideo READ definesVideo CONSTANT) Q_PROPERTY(uint16_t videoUDPPort READ videoUDPPort 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)? /*! @@ -65,4 +68,19 @@ public: @return RTSP url to use. Return "" to disable RTSP. */ 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; } }; From 170606b4547ea9853f9b245b2146acea74726dd9 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Mon, 30 Jan 2017 21:09:40 -0500 Subject: [PATCH 3/3] Disable font size control when fixed size is defined. --- src/ui/preferences/GeneralSettings.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 1eacfab..0e7ce90 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -145,6 +145,7 @@ QGCView { //----------------------------------------------------------------- //-- Base UI Font Point Size Row { + visible: QGroundControl.corePlugin.options.defaultFontPointSize < 1.0 spacing: ScreenTools.defaultFontPixelWidth QGCLabel { id: baseFontLabel