Skip to content

Commit

Permalink
refactor: only apply updates if there is a change in the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Oct 11, 2023
1 parent 0ce44d0 commit 4df82c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ pub fn watch_theme(handle: LoopHandle<'_, State>) -> Result<(), cosmic_config::E

if theme.theme_type != new_theme.theme_type {
*theme = new_theme;
let gaps = theme.cosmic().gaps;
state.common.shell.set_gaps((gaps.0 as u8, gaps.1 as u8));
drop(theme);
state.common.shell.workspaces.spaces().for_each(|s| {
s.mapped().for_each(|m| {
m.set_theme();
m.force_redraw();
})
});
}
let gaps = theme.cosmic().gaps;
state.common.shell.set_gaps((gaps.0 as u8, gaps.1 as u8));
drop(theme);
state.common.shell.workspaces.spaces().for_each(|s| {
s.mapped().for_each(|m| {
m.set_theme();
m.force_redraw();
})
});
}) {
tracing::error!("{e}");
};
Expand Down

0 comments on commit 4df82c3

Please sign in to comment.