feat: theme integration
refactor: only apply updates if there is a change in the theme refactor: include theme in state cleanup: theme integration
This commit is contained in:
parent
c16b86d1bf
commit
abbe94e6e1
24 changed files with 409 additions and 139 deletions
|
|
@ -114,6 +114,7 @@ impl CosmicWindow {
|
|||
pub fn new(
|
||||
window: impl Into<CosmicSurface>,
|
||||
handle: LoopHandle<'static, crate::state::State>,
|
||||
theme: cosmic::Theme,
|
||||
) -> CosmicWindow {
|
||||
let window = window.into();
|
||||
let width = window.geometry().size.w;
|
||||
|
|
@ -129,6 +130,7 @@ impl CosmicWindow {
|
|||
},
|
||||
(width, SSD_HEIGHT),
|
||||
handle,
|
||||
theme,
|
||||
))
|
||||
}
|
||||
|
||||
|
|
@ -213,6 +215,14 @@ impl CosmicWindow {
|
|||
popup_elements.into_iter().map(C::from).collect(),
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn set_theme(&self, theme: cosmic::Theme) {
|
||||
self.0.set_theme(theme);
|
||||
}
|
||||
|
||||
pub(crate) fn force_redraw(&self) {
|
||||
self.0.force_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue