fix(bar): apply roundings on komorebi.json change

Group roundings were getting lost when applying the theme after a
`komorebi.json` change/save trigger. Now we reapply these groupings on
the `apply_theme` to make sure they are always correct.
This commit is contained in:
alex-ds13
2024-12-19 16:39:35 -08:00
committed by جاد
parent eda91dcd1d
commit 0e2a55b300
2 changed files with 47 additions and 17 deletions
+5
View File
@@ -2,6 +2,7 @@ use crate::bar::apply_theme;
use crate::config::DisplayFormat;
use crate::config::KomobarTheme;
use crate::komorebi_layout::KomorebiLayout;
use crate::render::Grouping;
use crate::render::RenderConfig;
use crate::selected_frame::SelectableFrame;
use crate::ui::CustomUi;
@@ -497,6 +498,7 @@ impl KomorebiNotificationState {
rx_gui: Receiver<komorebi_client::Notification>,
bg_color: Rc<RefCell<Color32>>,
transparency_alpha: Option<u8>,
grouping: Option<Grouping>,
default_theme: Option<KomobarTheme>,
) {
match rx_gui.try_recv() {
@@ -520,6 +522,7 @@ impl KomorebiNotificationState {
KomobarTheme::from(theme),
bg_color.clone(),
transparency_alpha,
grouping,
);
tracing::info!("applied theme from updated komorebi.json");
} else if let Some(default_theme) = default_theme {
@@ -528,6 +531,7 @@ impl KomorebiNotificationState {
default_theme,
bg_color.clone(),
transparency_alpha,
grouping,
);
tracing::info!("removed theme from updated komorebi.json and applied default theme");
} else {
@@ -541,6 +545,7 @@ impl KomorebiNotificationState {
KomobarTheme::from(theme),
bg_color,
transparency_alpha,
grouping,
);
tracing::info!("applied theme from komorebi socket message");
}