1
0
Fork 0
forked from wry/wry

seat: add framework to select toplevels

This commit is contained in:
Julian Orth 2024-04-18 13:43:44 +02:00
parent e4e090d3a2
commit 17a0dfed5e
31 changed files with 603 additions and 131 deletions

View file

@ -139,6 +139,7 @@ pub struct Theme {
pub separator_color: Option<Color>,
pub unfocused_title_bg_color: Option<Color>,
pub unfocused_title_text_color: Option<Color>,
pub highlight_color: Option<Color>,
pub border_width: Option<i32>,
pub title_height: Option<i32>,
pub font: Option<String>,

View file

@ -55,6 +55,7 @@ impl Parser for ThemeParser<'_> {
separator_color,
unfocused_title_bg_color,
unfocused_title_text_color,
highlight_color,
border_width,
title_height,
font,
@ -77,6 +78,7 @@ impl Parser for ThemeParser<'_> {
opt(val("separator-color")),
opt(val("unfocused-title-bg-color")),
opt(val("unfocused-title-text-color")),
opt(val("highlight-color")),
recover(opt(s32("border-width"))),
recover(opt(s32("title-height"))),
recover(opt(str("font"))),
@ -111,6 +113,7 @@ impl Parser for ThemeParser<'_> {
separator_color: color!(separator_color),
unfocused_title_bg_color: color!(unfocused_title_bg_color),
unfocused_title_text_color: color!(unfocused_title_text_color),
highlight_color: color!(highlight_color),
border_width: border_width.despan(),
title_height: title_height.despan(),
font: font.map(|f| f.value.to_string()),

View file

@ -665,6 +665,7 @@ impl State {
color!(SEPARATOR_COLOR, separator_color);
color!(UNFOCUSED_TITLE_BACKGROUND_COLOR, unfocused_title_bg_color);
color!(UNFOCUSED_TITLE_TEXT_COLOR, unfocused_title_text_color);
color!(HIGHLIGHT_COLOR, highlight_color);
macro_rules! size {
($sized:ident, $field:ident) => {
if let Some(size) = theme.$field {