mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-19 18:26:56 +02:00
feat(themes): update bar on komorebi.json reload
This commit ensures that whenever komorebi.json is updated, komorebi-bar will try to apply whichever theme is set in that file by the user (if one is set). Similarly, if a theme is not set in komorebi.bar.json, komorebi-bar will load the theme set in komorebi.json (if one is set). A new configuration "bar_accent" has been added to the KomorebiTheme struct to make this process as uniform as possible.
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::widget::WidgetConfig;
|
||||
use eframe::egui::Pos2;
|
||||
use eframe::egui::TextBuffer;
|
||||
use eframe::egui::Vec2;
|
||||
use komorebi_client::KomorebiTheme;
|
||||
use komorebi_client::Rect;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
@@ -107,3 +108,22 @@ pub enum KomobarTheme {
|
||||
accent: Option<komorebi_themes::Base16Value>,
|
||||
},
|
||||
}
|
||||
|
||||
impl From<KomorebiTheme> for KomobarTheme {
|
||||
fn from(value: KomorebiTheme) -> Self {
|
||||
match value {
|
||||
KomorebiTheme::Catppuccin {
|
||||
name, bar_accent, ..
|
||||
} => Self::Catppuccin {
|
||||
name,
|
||||
accent: bar_accent,
|
||||
},
|
||||
KomorebiTheme::Base16 {
|
||||
name, bar_accent, ..
|
||||
} => Self::Base16 {
|
||||
name,
|
||||
accent: bar_accent,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user