Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated appearance gap min #806

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions 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 Expand Up @@ -1983,7 +2002,7 @@ pub fn window_management() -> Section<crate::pages::Message> {
page.theme_builder.gaps.1.to_string(),
page.theme_builder.gaps.1,
1,
page.theme.active_hint,
page.theme_builder.active_hint,
500,
Message::GapSize,
)),
Expand Down
Loading