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
feat(ramp): Allow specifying ramp weights #2505
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2505 +/- ##
==========================================
+ Coverage 10.07% 10.10% +0.02%
==========================================
Files 147 147
Lines 10229 10235 +6
==========================================
+ Hits 1031 1034 +3
- Misses 9198 9201 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Nice work!
I imagined this being done by calculating which ramp element to use depending on the percentage and the different weights. But your solution is so much less complex 😄
Please also mention this in the Added
section of the changelog: https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md#changelog
*Add test for ramp weights *[drawtypes/ramp] Implement ramp weights Simply clone `label_t` weight no. of times in the icon list This helps us not to change any of the calculations. *Fix silly bug Forgot to add a hyphen for the `weight` parameter. Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> *doc: add #1750 to CHANGELOG
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.
Looks good now :)
Thanks a lot for contributing 🎉
Use std::make_shared.
What type of PR is this? (check all applicable)
Description
Adding weight attribute in ramps for more gradient-like behaviour.
It defines the size of the interval of the ramp stage.
Related Issues & Documents
Fixes #1750
Documentation (check all applicable)
We need to document the fact that ramps can have their weights specified for a particular stage