Conversation
| return res; | ||
| } | ||
|
|
||
| enum slurp_label_anchor parse_label_anchor(const char *anchor) { |
There was a problem hiding this comment.
"center-top" is equivalent to "top-center" is equivalent to "center" is equivalent to "top-bottom-left-right-center".
It will also happily accept something like "top-nonsenes" and treat it the same as "top" or "not-top" is also the same as "top", or "neotop".
Should this be more strict in what it accepts?
There was a problem hiding this comment.
Also "top-bottom" is the same as "center" (and similarly "left-right")
There was a problem hiding this comment.
I thought this lack of strictness simplifies parsing without any harm/conflict.
The structure of the anchor is the same as used for wlr_layer_surface and I just added center as convenience. As such the same duplications happen, but I don't se an issue there.
render.c
Outdated
| if (anchor & ANCHOR_LEFT && anchor & ANCHOR_RIGHT) { | ||
| // Nothing to do | ||
| } else if (anchor & ANCHOR_LEFT) { | ||
| labelbox.x = box->x + 10; |
There was a problem hiding this comment.
why is the horizonal margin different than the vertical margin?
There was a problem hiding this comment.
I've used the same offset as used for the dimensions.
c149e85 to
4c5e24f
Compare
This introduces the option flags
P, l, Lwhich can be used to display a box with the of the selectable rectangle inside.l, Lare used for the text and background colours.Pis used for the position to anchor the labelbox. The same syntax is used as in wlr_layer_surface with an additional 'center' keyword.