Refactor title height to use 'titlebar.height' from themerc

This commit is contained in:
Moises Lima 2023-10-02 12:44:30 -03:00 committed by Johan Malm
parent 0acdf041b8
commit 47a80fc4f2
4 changed files with 18 additions and 8 deletions

View file

@ -213,6 +213,7 @@ theme_builtin(struct theme *theme)
{
theme->border_width = 1;
theme->padding_height = 3;
theme->title_height = INT_MIN;
theme->menu_overlap_x = 0;
theme->menu_overlap_y = 0;
@ -291,6 +292,9 @@ entry(struct theme *theme, const char *key, const char *value)
if (match_glob(key, "padding.height")) {
theme->padding_height = atoi(value);
}
if (match_glob(key, "titlebar.height")) {
theme->title_height = atoi(value);
}
if (match_glob(key, "menu.items.padding.x")) {
theme->menu_item_padding_x = atoi(value);
}
@ -750,8 +754,11 @@ create_corners(struct theme *theme)
static void
post_processing(struct theme *theme)
{
theme->title_height = font_height(&rc.font_activewindow)
+ 2 * theme->padding_height;
int h = font_height(&rc.font_activewindow);
if (theme->title_height < h) {
theme->title_height = h + 2 * theme->padding_height;
}
theme->osd_window_switcher_item_height = font_height(&rc.font_osd)
+ 2 * theme->osd_window_switcher_item_padding_y
+ 2 * theme->osd_window_switcher_item_active_border_width;