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:
Victoria Brekenfeld 2024-08-02 20:00:16 +02:00 committed by Michael Murphy
parent f655710d55
commit b40839638a
16 changed files with 183 additions and 216 deletions

View file

@ -423,7 +423,7 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
renderer.with_layer(parent_bounds, |renderer| {
let selection_background = theme.selection_background();
let c_rad = THEME.with(|t| t.borrow().cosmic().corner_radii);
let c_rad = THEME.lock().unwrap().cosmic().corner_radii;
// NOTE: Workaround to round the border of the unselected, unhovered image.
if !self.selected && !is_mouse_over {