-
-
Notifications
You must be signed in to change notification settings - Fork 723
add units support (POINT, PIXEL, SPACE) for polybar #2394
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
Conversation
|
Awesome! Thanks for putting in all this effort 🥳 The unit tests don't compile yet, probably because the dispatch test still uses the old offsets. I have some time to review this, this afternoon. I'm very excited about this, this will likely be the biggest change in the next version (unless we can get #1752 in, but I think that would take too long). |
f7c8c8f to
9883b90
Compare
|
Thanks for fixing up the tests. I had a go at fixing them but ran into weirdness I didn't understand. If there's anything else you'd like me to change please holla |
|
Yeah, the tests took some time because the equality operator for I'm writing up the review right now, there are only a few things left, I think. |
patrick96
left a comment
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 went through all my reviews in the old PR and tried to address them here. I also ran clang-format over all changed files.
There are still some things that need to be done:
- We need to decide whether we want to allow negative spacing
- We (I) need to address the weirdness in
base.inl: #1671 (comment) - We need to go through all config options that use extents or percentage_with_offset and see how they deal with negative values (and if they're even allowed)
- add a size_with_unit struct - add a geometry_format_values struct - move dpi initialisation from renderer.cpp to bar.cpp - add a string to size_with_unit converter - add point support (with pt) - add pixel support (with px)
The old names didn't really capture the purpose of the structs and function. space_type -> spacing_type space_size -> spacing_val size_type -> extent_type geometry -> extent_val geometry_format_values -> percentage_with_offset
No longer needed. The convert<spacing_val> function in config.cpp already does all the work for us and always setting the type to pixel was wrong. In addition, line-size should not be of type spacing_val but extent_val.
We can't just blindly add the x difference to the width because for example the width should increase if x < width and the increase keeps x < width. Similarly, we can't just add the offset to the width.
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2394 +/- ##
==========================================
+ Coverage 10.13% 10.24% +0.10%
==========================================
Files 147 148 +1
Lines 10181 10290 +109
==========================================
+ Hits 1032 1054 +22
- Misses 9149 9236 +87
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Is it possible for non-write access users to even see a merge conflict? I wanted to help out but there doesn’t seem to be a way to see the conflicts. |
|
@mainrs If you don't see them, I guess non-members can't see them in the UI. If you really want to see the conflicts, you can clone frebib's repo locally and try to merge into upstream master. However, the merge conflicts are not a blocker here. There are some decisions I have to make with regards to semantics, as I mentioned in my review: #2394 (review) I appreciate your initiative though :) There are a bunch of issues tagged with "help wanted" that are worth looking at.
The last one will probably touch quite a few components and may require a lot more time than the other three. |
This is an almost direct rebase of #1671
Fixes #1651, #951, #1700 and #1265
What type of PR is this? (check all applicable)
Disclaimer: I merely rebased this from the original PR. I changed as little as possible to make it work. I expect there will be plenty of style and similar comments in the review, which I intend to fix before this is merged. Created as a draft to collect feedback before final round of reviewing
Checklist:
unit.hppbase.inl: Add units support for polybar #1651 #951 #1671 (comment)