1
0
Fork 0
forked from wry/wry

theme: add separate bar_height setting

This commit is contained in:
Julian Orth 2025-09-17 17:19:19 +02:00
parent 3933eba30c
commit 01f9c094ee
12 changed files with 97 additions and 36 deletions

View file

@ -195,6 +195,7 @@ pub struct Theme {
pub highlight_color: Option<Color>,
pub border_width: Option<i32>,
pub title_height: Option<i32>,
pub bar_height: Option<i32>,
pub font: Option<String>,
}

View file

@ -58,6 +58,7 @@ impl Parser for ThemeParser<'_> {
highlight_color,
border_width,
title_height,
bar_height,
font,
),
) = ext.extract((
@ -81,6 +82,7 @@ impl Parser for ThemeParser<'_> {
opt(val("highlight-color")),
recover(opt(s32("border-width"))),
recover(opt(s32("title-height"))),
recover(opt(s32("bar-height"))),
recover(opt(str("font"))),
),
))?;
@ -116,6 +118,7 @@ impl Parser for ThemeParser<'_> {
highlight_color: color!(highlight_color),
border_width: border_width.despan(),
title_height: title_height.despan(),
bar_height: bar_height.despan(),
font: font.map(|f| f.value.to_string()),
})
}

View file

@ -893,6 +893,7 @@ impl State {
}
size!(BORDER_WIDTH, border_width);
size!(TITLE_HEIGHT, title_height);
size!(BAR_HEIGHT, bar_height);
if let Some(font) = &theme.font {
set_font(font);
}