Commit f35b2631 authored by Gus Grubba's avatar Gus Grubba Committed by Lorenz Meier

Make charting on mobile official

UI tweaks
parent 2b28400e
...@@ -157,11 +157,7 @@ static QObject* shapeFileHelperSingletonFactory(QQmlEngine*, QJSEngine*) ...@@ -157,11 +157,7 @@ static QObject* shapeFileHelperSingletonFactory(QQmlEngine*, QJSEngine*)
} }
QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#if defined(__mobile__)
: QGuiApplication (argc, argv)
#else
: QApplication (argc, argv) : QApplication (argc, argv)
#endif
, _runningUnitTests (unitTesting) , _runningUnitTests (unitTesting)
{ {
_app = this; _app = this;
......
...@@ -43,20 +43,13 @@ class QGCFileDownload; ...@@ -43,20 +43,13 @@ class QGCFileDownload;
* *
* Needs QApplication base to support QtCharts module. This way * Needs QApplication base to support QtCharts module. This way
* we avoid application crashing on 5.12 when using the module. * we avoid application crashing on 5.12 when using the module.
* We don't have QtWidgets on mobile, avoid using it.
* *
* Note: `lastWindowClosed` will be sent by MessageBox popups and other * Note: `lastWindowClosed` will be sent by MessageBox popups and other
* dialogs, that are spawned in QML, when they are closed * dialogs, that are spawned in QML, when they are closed
**/ **/
class QGCApplication : class QGCApplication : public QApplication
#if defined(__mobile__)
public QGuiApplication
#else
public QApplication
#endif
{ {
Q_OBJECT Q_OBJECT
public: public:
QGCApplication(int &argc, char* argv[], bool unitTesting); QGCApplication(int &argc, char* argv[], bool unitTesting);
~QGCApplication(); ~QGCApplication();
......
...@@ -58,7 +58,7 @@ ChartView { ...@@ -58,7 +58,7 @@ ChartView {
tickCount: 5 tickCount: 5
gridVisible: true gridVisible: true
labelsFont.family: "Fixed" labelsFont.family: "Fixed"
labelsFont.pixelSize: ScreenTools.smallFontPointSize labelsFont.pointSize: ScreenTools.smallFontPointSize
} }
ValueAxis { ValueAxis {
...@@ -68,7 +68,7 @@ ChartView { ...@@ -68,7 +68,7 @@ ChartView {
visible: chartController !== null visible: chartController !== null
lineVisible: false lineVisible: false
labelsFont.family: "Fixed" labelsFont.family: "Fixed"
labelsFont.pixelSize: ScreenTools.smallFontPointSize labelsFont.pointSize: ScreenTools.smallFontPointSize
} }
Row { Row {
...@@ -88,7 +88,6 @@ ChartView { ...@@ -88,7 +88,6 @@ ChartView {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
QGCLabel { QGCLabel {
text: qsTr("Scale:"); text: qsTr("Scale:");
font.pixelSize: ScreenTools.smallFontPointSize
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
QGCComboBox { QGCComboBox {
...@@ -98,12 +97,10 @@ ChartView { ...@@ -98,12 +97,10 @@ ChartView {
model: controller.timeScales model: controller.timeScales
currentIndex: chartController ? chartController.rangeXIndex : 0 currentIndex: chartController ? chartController.rangeXIndex : 0
onActivated: { if(chartController) chartController.rangeXIndex = index; } onActivated: { if(chartController) chartController.rangeXIndex = index; }
font.pixelSize: ScreenTools.smallFontPointSize
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
QGCLabel { QGCLabel {
text: qsTr("Range:"); text: qsTr("Range:");
font.pixelSize: ScreenTools.smallFontPointSize
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
QGCComboBox { QGCComboBox {
...@@ -113,7 +110,6 @@ ChartView { ...@@ -113,7 +110,6 @@ ChartView {
model: controller.rangeList model: controller.rangeList
currentIndex: chartController ? chartController.rangeYIndex : 0 currentIndex: chartController ? chartController.rangeYIndex : 0
onActivated: { if(chartController) chartController.rangeYIndex = index; } onActivated: { if(chartController) chartController.rangeYIndex = index; }
font.pixelSize: ScreenTools.smallFontPointSize
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
} }
...@@ -124,7 +120,7 @@ ChartView { ...@@ -124,7 +120,7 @@ ChartView {
QGCLabel { QGCLabel {
text: modelData.label text: modelData.label
color: chartView.series(index).color color: chartView.series(index).color
font.pixelSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
} }
} }
} }
......
...@@ -16,13 +16,12 @@ import QGroundControl.ScreenTools 1.0 ...@@ -16,13 +16,12 @@ import QGroundControl.ScreenTools 1.0
Button { Button {
id: control id: control
height: ScreenTools.defaultFontPixelHeight * 2
autoExclusive: true autoExclusive: true
leftPadding: ScreenTools.defaultFontPixelWidth leftPadding: ScreenTools.defaultFontPixelWidth
rightPadding: leftPadding rightPadding: leftPadding
property real _compIDWidth: ScreenTools.defaultFontPixelWidth * 2.5 property real _compIDWidth: ScreenTools.defaultFontPixelWidth * 3
property real _hzWidth: ScreenTools.defaultFontPixelWidth * 5 property real _hzWidth: ScreenTools.defaultFontPixelWidth * 6
property real _nameWidth: nameLabel.contentWidth property real _nameWidth: nameLabel.contentWidth
background: Rectangle { background: Rectangle {
...@@ -40,22 +39,23 @@ Button { ...@@ -40,22 +39,23 @@ Button {
QGCLabel { QGCLabel {
text: control.compID text: control.compID
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
font.pointSize: ScreenTools.smallFontPointSize verticalAlignment: Text.AlignVCenter
Layout.minimumHeight: ScreenTools.isMobile ? (ScreenTools.defaultFontPixelHeight * 2) : (ScreenTools.defaultFontPixelHeight * 1.5)
Layout.minimumWidth: _compIDWidth Layout.minimumWidth: _compIDWidth
} }
QGCLabel { QGCLabel {
id: nameLabel id: nameLabel
text: control.text text: control.text
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
font.pointSize: ScreenTools.smallFontPointSize
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
} }
QGCLabel { QGCLabel {
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
text: messageHz.toFixed(1) + 'Hz' text: messageHz.toFixed(1) + 'Hz'
font.pointSize: ScreenTools.smallFontPointSize
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
Layout.minimumWidth: _hzWidth Layout.minimumWidth: _hzWidth
Layout.alignment: Qt.AlignVCenter
} }
} }
......
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