1
0
Fork 0
forked from wry/wry

add window gaps

This commit is contained in:
atagen 2026-04-05 20:04:13 +10:00
parent 769d12a525
commit 750bf06ce9
9 changed files with 144 additions and 13 deletions

View file

@ -223,6 +223,7 @@ pub struct Theme {
pub bar_font: Option<String>,
pub bar_position: Option<BarPosition>,
pub bar_separator_width: Option<i32>,
pub gap: Option<i32>,
}
#[derive(Debug, Clone)]

View file

@ -63,7 +63,7 @@ impl Parser for ThemeParser<'_> {
font,
title_font,
),
(bar_font, bar_position_val, bar_separator_width),
(bar_font, bar_position_val, bar_separator_width, gap),
) = ext.extract((
(
opt(val("attention-requested-bg-color")),
@ -93,6 +93,7 @@ impl Parser for ThemeParser<'_> {
recover(opt(str("bar-font"))),
recover(opt(str("bar-position"))),
recover(opt(s32("bar-separator-width"))),
recover(opt(s32("gap"))),
),
))?;
macro_rules! color {
@ -146,6 +147,7 @@ impl Parser for ThemeParser<'_> {
bar_font: bar_font.map(|f| f.value.to_string()),
bar_position,
bar_separator_width: bar_separator_width.despan(),
gap: gap.despan(),
})
}
}

View file

@ -1003,6 +1003,7 @@ impl State {
size!(TITLE_HEIGHT, title_height);
size!(BAR_HEIGHT, bar_height);
size!(BAR_SEPARATOR_WIDTH, bar_separator_width);
size!(GAP, gap);
macro_rules! font {
($fun:ident, $field:ident) => {
if let Some(font) = &theme.$field {