Skip to content

Commit

Permalink
fix: Evaluate slideshow status from cosmic-bg
Browse files Browse the repository at this point in the history
Closes: #169
  • Loading branch information
joshuamegnauth54 authored and mmstick committed Apr 12, 2024
1 parent 0e3f629 commit 051bce2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cosmic-settings/src/pages/desktop/wallpaper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,18 @@ pub fn settings() -> Section<crate::pages::Message> {
let mut children = Vec::with_capacity(3);

let mut show_slideshow_toggle = true;
let mut slideshow_enabled = false;
// Slideshow is enabled if the background path from cosmic-bg is a directory
let mut slideshow_enabled = page
.config_output()
.and_then(|output| page.wallpaper_service_config.entry(output))
.map(|entry| {
if let Source::Path(path) = &entry.source {
path.is_dir()
} else {
false
}
})
.unwrap_or(false);

children.push(crate::widget::display_container(
match page.selection.active {
Expand Down

0 comments on commit 051bce2

Please sign in to comment.