cargo: Remove gtk-macros dependency

Using the crate is depreacted. Replaced spawn! macro
with our own spawn function
This commit is contained in:
Sophie Herold 2023-04-06 21:14:27 +02:00 • committed by Christopher Davis
parent ca672552be
commit 8b3cfd000a
8 changed files with 21 additions and 20 deletions

View file

@ -198,3 +198,10 @@ pub fn contrast_ratio(color1: &gdk::RGBA, color2: &gdk::RGBA) -> f32 {
(l1 + 0.05) / (l2 + 0.05)
}
pub fn spawn<R: 'static, F: std::future::Future<Output = R> + 'static>(
f: F,
) -> glib::JoinHandle<R> {
let ctx = glib::MainContext::default();
ctx.spawn_local(f)
}