Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Mar 2, 2024
1 parent 6b7b3b6 commit 20ce9e3
Showing 1 changed file with 3 additions and 38 deletions.
41 changes: 3 additions & 38 deletions src/theme/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,12 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {

match settings.color_scheme().await {
Ok(color_scheme) => {
dbg!(color_scheme);
let _ = tx.send(Desktop::ColorScheme(color_scheme)).await;
}
Err(err) => error!("Failed to get the color scheme {err:?}"),
};
// match settings
// .read::<ashpd::zvariant::OwnedValue>("org.freedesktop.appearance", "accent-color")
// .await
// {
// Ok(accent_color) => {
// dbg!(&accent_color);
// // let _ = tx.send(Desktop::Accent(accent_color)).await;
// }
// Err(err) => error!("Failed to get the accent color {err:?}"),
// };
match settings.contrast().await {
Ok(contrast) => {
dbg!(contrast);
let _ = tx.send(Desktop::Contrast(contrast)).await;
}
Err(err) => error!("Failed to get the contrast {err:?}"),
Expand All @@ -51,18 +39,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
if color_scheme_stream.is_none() {
error!("Failed to receive color scheme changes");
}
// Item type is wrong in this version
// updating requires updating to zbus 4
let mut accent_stream = settings
.receive_setting_changed_with_args::<Color>(
"org.freedesktop.appearance",
"accent-color",
)
.await
.ok();
if accent_stream.is_none() {
error!("Failed to receive accent color changes");
}

let mut contrast_stream = settings.receive_contrast_changed().await.ok();
if contrast_stream.is_none() {
error!("Failed to receive contrast changes");
Expand All @@ -75,12 +52,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
}
futures::future::pending().await
};
// let next_accent = async {
// if let Some(s) = accent_stream.as_mut() {
// return s.next().await.and_then(std::result::Result::ok);
// }
// futures::future::pending().await
// };

let next_contrast = async {
if let Some(s) = contrast_stream.as_mut() {
return s.next().await;
Expand All @@ -96,14 +68,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
color_scheme_stream = None;
}
},
// a = next_accent.fuse() => {
// dbg!(a);
// if let Some(a) = a {
// _ = tx.send(Desktop::Accent(a)).await;
// } else {
// accent_stream = None;
// }
// },

c = next_contrast.fuse() => {
if let Some(c) = c {
_ = tx.send(Desktop::Contrast(c)).await;
Expand Down

0 comments on commit 20ce9e3

Please sign in to comment.