Init Animations: animate toggler widgets (#96)

This commit is contained in:
Brock 2023-06-07 13:43:49 -06:00 committed by GitHub
parent 8119b29aca
commit 3ec06bef80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 251 additions and 153 deletions

View file

@ -1,11 +1,11 @@
use super::{NetworkManagerEvent, NetworkManagerState};
use cosmic::iced::{self, subscription};
use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::StreamExt;
use log::error;
use std::fmt::Debug;
use std::hash::Hash;
use zbus::Connection;
use futures::StreamExt;
pub fn devices_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
id: I,
@ -50,10 +50,7 @@ async fn start_listening<I: Copy + Debug>(
let new_state = NetworkManagerState::new(&conn).await.unwrap_or_default();
(
Some((
id,
NetworkManagerEvent::WirelessAccessPoints(new_state),
)),
Some((id, NetworkManagerEvent::WirelessAccessPoints(new_state))),
State::Continue(conn),
)
}

View file

@ -15,7 +15,7 @@ use cosmic_dbus_networkmanager::{
};
use futures::{
channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
FutureExt, StreamExt,
StreamExt,
};
use tokio::{process::Command, time::timeout};
use zbus::{
@ -141,7 +141,7 @@ async fn start_listening<I: Copy + Debug>(
Some(NetworkManagerRequest::SetWiFi(enabled)) => {
let success = network_manager.set_wireless_enabled(enabled).await.is_ok();
let response = NetworkManagerEvent::RequestResponse {
req: NetworkManagerRequest::SetAirplaneMode(enabled),
req: NetworkManagerRequest::SetWiFi(enabled),
success,
state: NetworkManagerState::new(&conn).await.unwrap_or_default(),
};
@ -624,6 +624,7 @@ impl NetworkManagerState {
Ok(_self)
}
#[allow(dead_code)]
pub fn clear(&mut self) {
self.active_conns = Vec::new();
self.known_access_points = Vec::new();