Browse Source

Allow plugin to define default font size, toolbar height and option to display/hide plan view selector.

QGC4.4
Gus Grubba 8 years ago
parent
commit
a241a1b230
  1. 3
      src/MissionEditor/MissionEditor.qml
  2. 8
      src/QmlControls/ScreenTools.qml
  3. 18
      src/api/QGCOptions.h

3
src/MissionEditor/MissionEditor.qml

@ -554,6 +554,7 @@ QGCView { @@ -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 { @@ -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

8
src/QmlControls/ScreenTools.qml

@ -47,7 +47,7 @@ Item { @@ -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 { @@ -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 { @@ -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

18
src/api/QGCOptions.h

@ -29,6 +29,9 @@ public: @@ -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: @@ -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; }
};

Loading…
Cancel
Save