1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

refactor: replace channel macros with ext trait methods

This commit is contained in:
Jake Stanger 2025-05-18 15:17:09 +01:00
parent d5744f597c
commit f929aef2d9
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
50 changed files with 658 additions and 476 deletions

View file

@ -1,4 +1,5 @@
use crate::{glib_recv_mpsc, spawn, try_send};
use crate::channels::{AsyncSenderExt, MpscReceiverExt};
use crate::spawn;
use color_eyre::{Help, Report};
use gtk::ffi::GTK_STYLE_PROVIDER_PRIORITY_USER;
use gtk::prelude::*;
@ -51,7 +52,7 @@ pub fn load_css(style_path: PathBuf, application: Application) {
Ok(event) if matches!(event.kind, EventKind::Modify(ModifyKind::Data(_))) => {
debug!("{event:?}");
if event.paths.first().is_some_and(|p| p == &style_path2) {
try_send!(tx, style_path2.clone());
tx.send_spawn(style_path2.clone());
}
}
Err(e) => error!("Error occurred when watching stylesheet: {:?}", e),
@ -72,7 +73,7 @@ pub fn load_css(style_path: PathBuf, application: Application) {
}
});
glib_recv_mpsc!(rx, path => {
rx.recv_glib(move |path| {
info!("Reloading CSS");
if let Err(err) = provider.load_from_file(&gio::File::for_path(path)) {
error!("{:?}", Report::new(err)