From a837aecb06c1bb50115db40b1bb46fbf1792470d Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 2 Sep 2021 23:42:39 +0200 Subject: [PATCH] Reduce font size in graphs --- nymea-app/ui/customviews/GenericTypeGraph.qml | 5 ++--- nymea-app/ui/mainviews/EnergyView.qml | 6 +++--- nymea-app/ui/utils/ActionQueue.qml | 8 ++++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/nymea-app/ui/customviews/GenericTypeGraph.qml b/nymea-app/ui/customviews/GenericTypeGraph.qml index b4c8d8e0..2a095495 100644 --- a/nymea-app/ui/customviews/GenericTypeGraph.qml +++ b/nymea-app/ui/customviews/GenericTypeGraph.qml @@ -108,7 +108,6 @@ Item { text: root.stateType.type.toLowerCase() === "bool" ? root.stateType.displayName : 1.0 * Math.round(Types.toUiValue(root.valueState.value, root.stateType.unit) * Math.pow(10, root.roundTo)) / Math.pow(10, root.roundTo) + " " + Types.toUiUnit(root.stateType.unit) - font.pixelSize: app.largeFont } HeaderButton { imageSource: "../images/zoom-out.svg" @@ -139,7 +138,7 @@ Item { min: Math.floor(logsModelNg.minValue - Math.abs(logsModelNg.minValue * .05)) // onMinChanged: applyNiceNumbers(); // onMaxChanged: applyNiceNumbers(); - labelsFont: Style.smallFont + labelsFont: Style.extraSmallFont labelFormat: { if (root.stateType && root.stateType.type.toLowerCase() == "bool") { return "x"; @@ -165,7 +164,7 @@ Item { gridVisible: false color: Qt.rgba(Style.foregroundColor.r, Style.foregroundColor.g, Style.foregroundColor.b, .2) tickCount: chartView.width / 70 - labelsFont: Style.smallFont + labelsFont: Style.extraSmallFont labelsColor: Style.foregroundColor property int timeDiff: (xAxis.max.getTime() - xAxis.min.getTime()) / 1000 diff --git a/nymea-app/ui/mainviews/EnergyView.qml b/nymea-app/ui/mainviews/EnergyView.qml index a77978f0..2bacc889 100644 --- a/nymea-app/ui/mainviews/EnergyView.qml +++ b/nymea-app/ui/mainviews/EnergyView.qml @@ -109,7 +109,7 @@ MainViewBase { Layout.columnSpan: energyGrid.columns Layout.preferredHeight: width * .7 legend.alignment: Qt.AlignBottom - legend.font.pixelSize: app.smallFont + legend.font: Style.extraSmallFont // legend.visible: false legend.labelColor: Style.foregroundColor backgroundColor: Style.tileBackgroundColor @@ -286,7 +286,7 @@ MainViewBase { // This seems to crash occationally // onMinChanged: applyNiceNumbers(); // onMaxChanged: applyNiceNumbers(); - labelsFont.pixelSize: app.smallFont + labelsFont: Style.extraSmallFont labelFormat: "%d" labelsColor: Style.foregroundColor color: Qt.rgba(Style.foregroundColor.r, Style.foregroundColor.g, Style.foregroundColor.b, .2) @@ -298,7 +298,7 @@ MainViewBase { gridVisible: false color: Qt.rgba(Style.foregroundColor.r, Style.foregroundColor.g, Style.foregroundColor.b, .2) tickCount: chartView.width / 70 - labelsFont.pixelSize: app.smallFont + labelsFont: Style.extraSmallFont labelsColor: Style.foregroundColor property int timeDiff: (xAxis.max.getTime() - xAxis.min.getTime()) / 1000 diff --git a/nymea-app/ui/utils/ActionQueue.qml b/nymea-app/ui/utils/ActionQueue.qml index a57506b5..e9a2ad19 100644 --- a/nymea-app/ui/utils/ActionQueue.qml +++ b/nymea-app/ui/utils/ActionQueue.qml @@ -5,6 +5,9 @@ Item { id: root property Thing thing: null + + // either or + property string stateName: "" property StateType stateType: null readonly property var pendingValue: d.queuedValue || d.pendingValue @@ -16,9 +19,10 @@ Item { return; } d.pendingValue = value; - d.pendingCommand = root.thing.executeAction(root.stateType.name, + var stateName = root.stateType == null ? root.stateName : root.stateType.name + d.pendingCommand = root.thing.executeAction(stateName, [{ - paramName: root.stateType.name, + paramName: stateName, value: value }]) d.queuedValue = null