update iced

This commit is contained in:
Ashley Wulber 2024-10-30 22:51:08 -04:00 committed by Ashley Wulber
parent 11faa567f3
commit 5b5cd77e7c
45 changed files with 2360 additions and 1537 deletions

View file

@ -1,13 +1,12 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
use std::ops::Sub;
use crate::subscriptions::freedesktop_proxy::NotificationsProxy;
use cosmic::{
iced::{
futures::{self, SinkExt},
subscription,
},
iced_futures::Subscription,
iced::futures::{self, SinkExt},
iced_futures::{stream, Subscription},
};
use tokio::sync::mpsc::{channel, Receiver, Sender};
use tracing::{error, warn};
@ -35,10 +34,9 @@ pub enum Output {
pub fn proxy() -> Subscription<Output> {
struct SomeWorker;
subscription::channel(
Subscription::run_with_id(
std::any::TypeId::of::<SomeWorker>(),
50,
|mut output| async move {
stream::channel(50, |mut output| async move {
let mut state = State::Ready;
loop {
@ -103,6 +101,6 @@ pub fn proxy() -> Subscription<Output> {
}
}
}
},
}),
)
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::{
iced::{futures, subscription},
iced::{futures, stream},
iced_futures::Subscription,
};
use cosmic_notifications_util::Notification;
@ -27,10 +27,9 @@ pub enum State {
pub fn notifications(proxy: NotificationsAppletProxy<'static>) -> Subscription<Notification> {
struct SomeWorker;
subscription::channel(
Subscription::run_with_id(
std::any::TypeId::of::<SomeWorker>(),
50,
|mut output| async move {
stream::channel(50, |mut output| async move {
let mut state = State::WaitingForNotificationEvent(0);
loop {
@ -76,7 +75,7 @@ pub fn notifications(proxy: NotificationsAppletProxy<'static>) -> Subscription<N
}
}
}
},
}),
)
}