Reduce font size in graphs

This commit is contained in:
Michael Zanetti 2021-09-02 23:42:39 +02:00
parent 180e374d71
commit a837aecb06
3 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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