-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Enhance battery indicator visuals with new SVGs and color coding #11881
Merged
Merged
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
dc2148c
Enhance battery indicator visuals
Paschalis feb382c
Added colorYellow and colorYellowGreen to QGCPalette and updated Batt…
Paschalis ae4249a
Update color definitions for improved visibility for light theme
Paschalis c6ab475
Apply battery colors only in dark theme
Paschalis c7be67c
Update qgcimages.qrc to include new battery icons.
Paschalis e047024
Add battery configuration settings for dark and light themes.
Paschalis 7bda84d
Implement logic for configurable battery thresholds.
Paschalis cf43592
Add header definitions for battery indicator settings.
Paschalis 0b8cfbc
Improve battery indicator with dark theme support and configurable co…
Paschalis fb186df
Fix SVG file namespace issues in TelemRSSI.svg.
Paschalis 5138b77
Add new battery configuration icons for light and dark themes (Batter…
Paschalis 81ee7db
Modify palette, battery indicator, and update images.
Paschalis 4f78b5a
Remove unnecessary battery images.
Paschalis 012cbb4
Add BatteryEMERGENCY.svg image.
Paschalis 7563664
Update ChangeLog with new battery display feature.
Paschalis 0f5c193
Updated BatteryIndicatorSettings and UI for dynamic visibility and va…
Paschalis 0461be3
Merge branch 'master' into master
Paschalis fc5d511
Merge branch 'mavlink:master' into master
Paschalis c2ce804
feat: Update battery indicator settings and visibility logic
Paschalis 3a33e93
Merge branch 'master' into master
Paschalis 80806a3
Adjusted spacing in BatteryIndicator.qml for better code readability
Paschalis fd10395
Merge branch 'master' into master
Paschalis 27d3eb3
Merge branch 'mavlink:master' into master
Paschalis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
{ | ||
"version": 1, | ||
"fileType": "FactMetaData", | ||
"QGC.MetaData.Facts": | ||
[ | ||
{ | ||
"name": "display", | ||
"shortDesc": "Select values to display in indicator", | ||
"enumStrings": "Percentage,Voltage,Percentage and Voltage", | ||
"enumValues": "0,1,2", | ||
"type": "uint32", | ||
"default": false | ||
} | ||
] | ||
"version": 1, | ||
"fileType": "FactMetaData", | ||
"QGC.MetaData.Facts": [ | ||
{ | ||
"name": "display", | ||
"shortDesc": "Select values to display in indicator", | ||
"enumStrings": "Percentage,Voltage,Percentage and Voltage", | ||
"enumValues": "0,1,2", | ||
"type": "uint32", | ||
"default": false | ||
}, | ||
{ | ||
"name": "threshold1", | ||
"shortDesc": "Battery level threshold 1", | ||
"type": "uint32", | ||
"default": 80, | ||
"units": "%" | ||
}, | ||
{ | ||
"name": "threshold2", | ||
"shortDesc": "Battery level threshold 2", | ||
"type": "uint32", | ||
"default": 60, | ||
"units": "%" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So all f this is incorrect with respect to how settings groups.facts work:
QGroundControl.settingsManager.batteryIndicatorSettings.visible
for visibility which should control whether to show the battery indicator panel. And thenQGroundControl.settingsManager.batteryIndicatorSettings.threshold1.visible
for the thresholds.DECLARE_SETTINGSFACT_NO_FUNC
. Look at AppSettings.cc for examples. Then in that code you connect to the rawValueChanged signal. And in you signal handler that is where you do the validation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I streamlined the visibility management by utilizing existing properties in QGroundControl.settingsManager.batteryIndicatorSettings and removed redundant properties. Additionally, I implemented validation for threshold settings using DECLARE_SETTINGSFACT_NO_FUNC
and confirmed the correct storage of new threshold values after verifying defaults from the JSON file.
Thanks!