]> git.mdlowis.com Git - proto/labwc.git/commit
ssd: limit icon size to ~85% of window_button_width
authorJohn Lindgren <john@jlindgren.net>
Thu, 3 Oct 2024 11:31:29 +0000 (07:31 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 3 Oct 2024 20:17:21 +0000 (21:17 +0100)
commitdb3aab77fef5ba4ad98e53cc9e1c2908751dedc3
tree686112972be7a0ec22ad22d836ccc8e98c17eee4
parentf34740894900cb41d7a8e0c86f67927746334a17
ssd: limit icon size to ~85% of window_button_width

This ensures that the icon doesn't push right up to the window edge
(or left-aligned title) when using a large font or narrow button width.
In the default config (with 10pt font), it makes no difference since
the limiting factor on the icon size is the titlebar height anyway.

I spent way too much time over-thinking how to compute the padding.
I think 2px on each side is reasonable (and it should be equal on each
side), so window_button_width/10 (rounded down) should be fine.
Eventually the padding should probably be configurable anyway.
src/ssd/ssd-titlebar.c