Conversation
There was a problem hiding this comment.
Sorry this is so late. If you're still up for it, I'd like to merge this. But first, please use strtol instead of atoi for parsing the numbers, atoi has undefined behaviour, if the string doesn't have the right format.
EDIT: I just noticed, please also define geom_format_to_pixels in bar.hpp. Also, we recently had a PR that changed this particular section to accept floats, so you will need to rebase and actually use strtof
patrick96
left a comment
There was a problem hiding this comment.
I'm right now writing unit tests for this. I have just noticed that we recently merged our PR that converted all uses of atoi to strtol (#1202), and this has now again caused a merge conflict.
Please resolve this again (sorry!), but I think you can just use your whole main.cpp when resolving.
Also while writing the tests, I noticed that geom_format_to_pixels returns a double but uses strtof, this causes precision issues in the unit test (not in any real world application though), so please switch strtod for consistency (or return a float, both are fine)
|
Do you no longer want to work on this? |
|
I have now pulled your changes onto my own branch, added my tests and merged the whole thing. Thanks for the implementation |


This allows for the
width,height,offset-x, andoffset-yconfiguration options to be set in one of the following formats:This allows for pixel offsets on percent values. For example, with i3-gaps, you can line up the bar so that it is flush with the windows on the screen. This change does not require any configuration changes, but simply adds an optional offset.