Skip to content

Commit

Permalink
Show per-phase unit in overview ac widget
Browse files Browse the repository at this point in the history
Small AC widgets now display total power.
Fixes #1264
  • Loading branch information
DanielMcInnes committed Jun 25, 2024
1 parent e1a56e0 commit 74f22d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
1 change: 0 additions & 1 deletion components/ThreePhaseDisplay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Flow {
: 0
dataObject: model
font.pixelSize: phaseLabel.font.pixelSize
unitVisible: root.widgetSize >= VenusOS.OverviewWidget_Size_M
valueColor: phaseDelegate.textColor
unitColor: valueColor == Theme.color_font_primary
? Theme.color_font_secondary
Expand Down
22 changes: 14 additions & 8 deletions components/widgets/AcWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@ OverviewWidget {
active: root.phaseCount > 1
states: [
State {
name: "small"
when: root.size === VenusOS.OverviewWidget_Size_XS || root.size === VenusOS.OverviewWidget_Size_S
name: "extrasmall"
when: root.size === VenusOS.OverviewWidget_Size_XS
PropertyChanges {
target: root.quantityLabel
visible: !!quantityLabel.dataObject && extraContentLoader.status !== Loader.Ready
visible: !!quantityLabel.dataObject && extraContentLoader.status !== Loader.Ready // hide the total power
font.pixelSize: Theme.font_overviewPage_widget_quantityLabel_minimumSize
}
PropertyChanges {
target: root
secondaryTitle: extraContentLoader.status === Loader.Ready
? "(%1)".arg(Units.defaultUnitString(Global.systemSettings.electricalQuantity))
: ""
target: extraContentLoader
anchors.bottomMargin: root.verticalMargin / 3
}
},
State {
name: "small"
when: root.size === VenusOS.OverviewWidget_Size_S
PropertyChanges {
target: root.quantityLabel
font.pixelSize: Theme.font_overviewPage_widget_quantityLabel_minimumSize
}
PropertyChanges {
target: extraContentLoader
Expand All @@ -58,7 +64,7 @@ OverviewWidget {
}
},
State {
name: "medium-or-larger"
name: "large"
when: root.size === VenusOS.OverviewWidget_Size_L || root.size === VenusOS.OverviewWidget_Size_XL
PropertyChanges {
target: root.quantityLabel
Expand Down

0 comments on commit 74f22d0

Please sign in to comment.