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