]> git.mdlowis.com Git - proto/labwc.git/commitdiff
theme: derive titlebar height from its objects
authorJohan Malm <jgm323@gmail.com>
Sun, 29 Sep 2024 17:25:23 +0000 (18:25 +0100)
committerJohan Malm <jgm323@gmail.com>
Tue, 8 Oct 2024 19:04:05 +0000 (20:04 +0100)
...including the new window.button.height

src/theme.c

index eb8803bda96ff61570502ae54ee9fdfcad42646d..13bfe0aeb5e037ccbf57b6e1712d1b7e568cf32e 100644 (file)
@@ -1466,11 +1466,22 @@ fill_colors_with_osd_theme(struct theme *theme, float colors[3][4])
        memcpy(colors[2], theme->osd_bg_color, sizeof(colors[2]));
 }
 
+static int
+get_titlebar_height(struct theme *theme)
+{
+       int h = MAX(font_height(&rc.font_activewindow),
+               font_height(&rc.font_inactivewindow));
+       if (h < theme->window_button_height) {
+               h = theme->window_button_height;
+       }
+       h += 2 * theme->padding_height;
+       return h;
+}
+
 static void
 post_processing(struct theme *theme)
 {
-       int h = MAX(font_height(&rc.font_activewindow), font_height(&rc.font_inactivewindow));
-       theme->title_height = h + 2 * theme->padding_height;
+       theme->title_height = get_titlebar_height(theme);
 
        theme->menu_item_height = font_height(&rc.font_menuitem)
                + 2 * theme->menu_item_padding_y;