diff --git a/cosmic-applet-a11y/src/app.rs b/cosmic-applet-a11y/src/app.rs index b70f9b43..34b89322 100644 --- a/cosmic-applet-a11y/src/app.rs +++ b/cosmic-applet-a11y/src/app.rs @@ -11,14 +11,12 @@ use cosmic::{ token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, }, cctk::sctk::reexports::calloop, - cosmic_theme::Spacing, iced::{ platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, window, Length, Subscription, }, iced_runtime::core::layout::Limits, - theme, - widget::{container, text}, + widget::container, Element, Task, }; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; @@ -185,10 +183,6 @@ impl cosmic::Application for CosmicA11yApplet { } fn view_window(&self, _id: window::Id) -> Element { - let Spacing { - space_xxs, space_s, .. - } = theme::active().cosmic().spacing; - let toggle = padded_control( anim!( //toggler diff --git a/cosmic-applet-a11y/src/backend/mod.rs b/cosmic-applet-a11y/src/backend/mod.rs index e93170a7..7b80a14a 100644 --- a/cosmic-applet-a11y/src/backend/mod.rs +++ b/cosmic-applet-a11y/src/backend/mod.rs @@ -11,9 +11,9 @@ use cosmic::{ iced_futures::stream, }; use cosmic_dbus_a11y::*; -use std::{fmt::Debug, hash::Hash}; +use std::fmt::Debug; use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender}; -use zbus::{Connection, Result}; +use zbus::Connection; #[derive(Debug, Clone)] pub enum Update { diff --git a/cosmic-applet-bluetooth/src/bluetooth.rs b/cosmic-applet-bluetooth/src/bluetooth.rs index a7560271..ba5cdfdd 100644 --- a/cosmic-applet-bluetooth/src/bluetooth.rs +++ b/cosmic-applet-bluetooth/src/bluetooth.rs @@ -158,8 +158,6 @@ async fn start_listening( #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub enum BluerRequest { SetBluetoothEnabled(bool), - SetPairable(bool), - SetDiscoverable(bool), PairDevice(Address), ConnectDevice(Address), DisconnectDevice(Address), @@ -189,8 +187,6 @@ pub enum BluerEvent { pub struct BluerState { pub devices: Vec, pub bluetooth_enabled: bool, - pub discoverable: bool, - pub pairable: bool, } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] @@ -335,7 +331,6 @@ pub struct BluerSessionState { _session: Session, _agent_handle: AgentHandle, pub adapter: Adapter, - pub devices: Arc>>, pub rx: Option>, pub req_tx: Sender, tx: Sender, @@ -527,7 +522,6 @@ impl BluerSessionState { _agent_handle, _session: session, adapter, - devices: Arc::new(Mutex::new(devices)), rx: Some(rx), req_tx, tx, @@ -554,8 +548,6 @@ impl BluerSessionState { let state = BluerState { devices: build_device_list(&adapter_clone).await, bluetooth_enabled: status, - discoverable: adapter_clone.is_discoverable().await.unwrap_or_default(), - pairable: adapter_clone.is_pairable().await.unwrap_or_default(), }; if state.bluetooth_enabled { for d in &state.devices { @@ -609,11 +601,6 @@ impl BluerSessionState { .is_powered() .await .unwrap_or_default(), - discoverable: adapter_clone - .is_discoverable() - .await - .unwrap_or_default(), - pairable: adapter_clone.is_pairable().await.unwrap_or_default(), })) .await; // reset timeout @@ -701,25 +688,11 @@ impl BluerSessionState { } } BluerRequest::StateUpdate => {} - BluerRequest::SetPairable(enabled) => { - let res = adapter_clone.set_pairable(*enabled).await; - if let Err(e) = res { - err_msg = Some(e.to_string()); - } - } - BluerRequest::SetDiscoverable(enabled) => { - let res = adapter_clone.set_discoverable(*enabled).await; - if let Err(e) = res { - err_msg = Some(e.to_string()); - } - } }; let state = BluerState { devices: build_device_list(&adapter_clone).await, bluetooth_enabled: adapter_clone.is_powered().await.unwrap_or_default(), - discoverable: adapter_clone.is_discoverable().await.unwrap_or_default(), - pairable: adapter_clone.is_pairable().await.unwrap_or_default(), }; let _ = tx_clone @@ -746,8 +719,6 @@ impl BluerSessionState { devices: build_device_list(&self.adapter).await, // TODO is this a proper way of checking if bluetooth is enabled? bluetooth_enabled: self.adapter.is_powered().await.unwrap_or_default(), - discoverable: self.adapter.is_discoverable().await.unwrap_or_default(), - pairable: self.adapter.is_pairable().await.unwrap_or_default(), } } } diff --git a/cosmic-applet-tiling/src/window.rs b/cosmic-applet-tiling/src/window.rs index 76832772..b68c6206 100644 --- a/cosmic-applet-tiling/src/window.rs +++ b/cosmic-applet-tiling/src/window.rs @@ -20,7 +20,7 @@ use cosmic::{ widget::{ container, divider, segmented_button::{self, Entity, SingleSelectModel}, - segmented_control, spin_button, text, + segmented_control, text, }, Element, };