From 00b8b2bb964637da3a4201cb0dabe4e4a23c2050 Mon Sep 17 00:00:00 2001 From: Bryan Hyland Date: Fri, 6 Dec 2024 18:41:29 -0800 Subject: [PATCH] Updated active hint and gap size update logic --- .../src/pages/desktop/appearance/mod.rs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index bdf97c5..2b5167f 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -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); } } @@ -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