theme: add window.titlebar.padding.{width,height}

...to replace padding.{width,height} to minimize breaking changes with the
visual appearance of the titlebar.

With the diverging labwc specification for the titlebar (listed below)
we have to choose between (a) not supporting the padding.{width,height}
option which exist in many extant Openbox themes to keep titlebar height
(almost) the same; or (b) making the allocated button areas much smaller
and not keeping the default hover going all the way to the edges. All in
all it just seems a lot simpler and cleaner to break this link to the
openbox spec.

Examples of previous change driving the requirement for this change:

- SVG and PNG support which often results in large icons with hover
  effects.
- Theme option window.button.{height,width}
- Larger default areas for icons (26x26)

In way of an example, Numix theme sets a padding.height of 6 which would
have resulted in a titlebar 12px taller without this change.
This commit is contained in:
Johan Malm 2024-10-08 17:52:57 +01:00
parent 383fb20bf4
commit e16e78e7a4
6 changed files with 36 additions and 29 deletions

View file

@ -46,8 +46,8 @@ struct theme {
* the space between title bar border and
* buttons on the left/right/top
*/
int padding_width;
int padding_height;
int window_titlebar_padding_width;
int window_titlebar_padding_height;
int title_height;
int menu_overlap_x;
@ -156,7 +156,10 @@ struct theme {
struct lab_data_buffer *shadow_corner_bottom_inactive;
struct lab_data_buffer *shadow_edge_inactive;
/* not set in rc.xml/themerc, but derived from font & padding_height */
/*
* Not set in rc.xml/themerc, but derived from the tallest titlebar
* object plus 2 * window_titlebar_padding_height
*/
int osd_window_switcher_item_height;
/* magnifier */