Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SystemBatteryDeviceModel and SystemBatteryDelegate #1958

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blammit
Copy link
Contributor

@blammit blammit commented Mar 6, 2025

Do some refactoring to avoid duplicating model/delegate code between BatteryListPage and PageSettingsBatteries.

blammit added 2 commits March 6, 2025 15:55
This type refers to the battery that is currently active according to
com.victronenergy.system/ActiveBatteryService, so rename the type to
make this more clear.
This avoids duplicating code between BatteryListPage and
PageSettingsBatteries.
This avoids duplicating code between BatteryListPage and
PageSettingsBatteries.
@blammit blammit force-pushed the blam/battery-refactor branch from 4e907dd to 80554fc Compare March 6, 2025 06:35
width: parent.width
height: Theme.geometry_batteryListPage_item_height

Column {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing Positioners and Layouts - I assume this is intentional

source: "qrc:/images/icon_arrow_32.svg"
rotation: 180
color: pressArea.containsPress ? Theme.color_listItem_down_forwardIcon : Theme.color_listItem_forwardIcon
opacity: pressArea.enabled ? 1 : 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assume visible isn't used here because it would interfere with the layout?


const batteryList = value
let batteryUids = []
let i
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move let i into the respective for loops

}
footer: SettingsColumn {
width: parent ? parent.width : 0
topPadding: Theme.geometry_gradientList_spacing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the container not have a spacing property for this purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants