Skip to content

Commit

Permalink
Updated active hint and gap size update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bhh32 authored and wash2 committed Dec 9, 2024
1 parent 18ff986 commit 00b8b2b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cosmic-settings/src/pages/desktop/appearance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,20 @@ impl Page {
.set_active_hint(config, active_hint)
.unwrap_or_default()
{
// Update the gap if it's less than the active hint
if active_hint > self.theme_builder.gaps.1 {
let mut gaps = self.theme_builder.gaps;
gaps.1 = active_hint;
if self
.theme_builder
.set_gaps(config, gaps)
.unwrap_or_default()
{
self.theme_config_write("gaps", gaps);
}
}

// Update the active_hint in the config
self.theme_config_write("active_hint", active_hint);
}
}
Expand All @@ -576,7 +590,12 @@ impl Page {

let mut gaps = self.theme_builder.gaps;

gaps.1 = gap;
// Ensure that the gap is never less than what the active hint size is.
gaps.1 = if gap < self.theme_builder.active_hint {
self.theme_builder.active_hint
} else {
gap
};

if self
.theme_builder
Expand Down

0 comments on commit 00b8b2b

Please sign in to comment.