mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
Refactor title height to use 'titlebar.height' from themerc
This commit is contained in:
parent
0acdf041b8
commit
47a80fc4f2
4 changed files with 18 additions and 8 deletions
11
src/theme.c
11
src/theme.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue