Skip to content

Commit

Permalink
Fix three phase bar gauge background color for overview widget
Browse files Browse the repository at this point in the history
Overview widgets in Dark mode already use the darkOk color as
their background color.  So, we need a different blue to use
as the gauge background color in this case.
  • Loading branch information
chriadam committed Jun 4, 2024
1 parent 320a52d commit c0af932
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/ThreePhaseBarGauge.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Flow {
property bool inputMode
property int orientation: Qt.Vertical
property bool animationEnabled
property bool inOverviewWidget

readonly property real _longEdgeLength: orientation === Qt.Vertical ? height : width
readonly property real _delegateLength: (_longEdgeLength - (spacing * (phaseRepeater.count - 1))) / phaseRepeater.count
Expand Down Expand Up @@ -67,7 +68,9 @@ Flow {
id: cheapGauge
CheapBarGauge {
foregroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_green : Theme.statusColorValue(valueStatus)
backgroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_darkGreen : Theme.statusColorValue(valueStatus, true)
backgroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_darkGreen
: root.inOverviewWidget && valueStatus === Theme.Ok ? Theme.color_darkishBlue
: Theme.statusColorValue(valueStatus, true)
valueType: root.valueType
value: valueRange.valueAsRatio
orientation: root.orientation
Expand All @@ -79,7 +82,9 @@ Flow {
id: prettyGauge
BarGauge {
foregroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_green : Theme.statusColorValue(valueStatus)
backgroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_darkGreen : Theme.statusColorValue(valueStatus, true)
backgroundColor: Theme.color_darkOk,gaugeLoader.feedingToGrid ? Theme.color_darkGreen
: root.inOverviewWidget && valueStatus === Theme.Ok ? Theme.color_darkishBlue
: Theme.statusColorValue(valueStatus, true)
valueType: root.valueType
value: valueRange.valueAsRatio
orientation: root.orientation
Expand Down
1 change: 1 addition & 0 deletions components/widgets/AcInputWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ AcWidget {
maximumValue: Global.acInputs.activeInputInfo.maximumCurrent
inputMode: true
animationEnabled: root.animationEnabled
inOverviewWidget: true
}
}

Expand Down
1 change: 1 addition & 0 deletions components/widgets/InverterChargerWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ OverviewWidget {
phaseModelProperty: "current"
maximumValue: Global.system.ac.consumption.maximumCurrent
animationEnabled: root.animationEnabled
inOverviewWidget: true
}
}
}
1 change: 1 addition & 0 deletions themes/color/Dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"color_dimRed": "#592220",
"color_dimGreen": "#508135",
"color_dimGray": "#7B7A76",
"color_darkishBlue": "#1B3B5C",
"color_darkBlue": "#11263B",
"color_darkOrange": "#482D0E",
"color_darkRed": "#491C1B",
Expand Down
1 change: 1 addition & 0 deletions themes/color/Light.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"color_dimRed": "#F0C3BF",
"color_dimGreen": "#9BCB7E",
"color_dimGray": "#7B7A76",
"color_darkishBlue": "#C0D4E6",
"color_darkBlue": "#C0D4E6",
"color_darkOrange": "#F7DBB9",
"color_darkRed": "#F8CAC6",
Expand Down

0 comments on commit c0af932

Please sign in to comment.