fix: Use globals instead of thread-locals
Better support for multi-threaded applications, especially cosmic-comp rendering in parallel on multiple threads, each potentially accessing global configurations such as the active theme, icon_theme and more...
This commit is contained in:
parent
f655710d55
commit
b40839638a
16 changed files with 183 additions and 216 deletions
|
|
@ -177,11 +177,7 @@ fn padded_control<'a, Message>(
|
|||
}
|
||||
|
||||
fn menu_control_padding() -> Padding {
|
||||
crate::theme::THEME
|
||||
.with(|t| {
|
||||
let t = t.borrow();
|
||||
let cosmic = t.cosmic();
|
||||
[cosmic.space_xxs(), cosmic.space_m()]
|
||||
})
|
||||
.into()
|
||||
let guard = crate::theme::THEME.lock().unwrap();
|
||||
let cosmic = guard.cosmic();
|
||||
[cosmic.space_xxs(), cosmic.space_m()].into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue