Skip to content

Commit 1b0dd4f

Browse files
committed
chore: use space_none for panel config spacing
1 parent da9742c commit 1b0dd4f

File tree

1 file changed

+4
-10
lines changed
  • cosmic-settings/src/pages/desktop/appearance

1 file changed

+4
-10
lines changed

cosmic-settings/src/pages/desktop/appearance/mod.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ impl Page {
585585

586586
#[cfg(feature = "wayland")]
587587
fn update_panel_spacing(density: Density) {
588+
let spacing: cosmic::cosmic_theme::Spacing = density.into();
589+
let space_none = spacing.space_none;
588590
let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok();
589591
let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok();
590592
let mut panel_config = panel_config_helper.as_ref().and_then(|config_helper| {
@@ -598,11 +600,7 @@ impl Page {
598600

599601
if let Some(panel_config_helper) = panel_config_helper.as_ref() {
600602
if let Some(panel_config) = panel_config.as_mut() {
601-
let spacing = match density {
602-
Density::Compact => 0,
603-
_ => 4,
604-
};
605-
let update = panel_config.set_spacing(panel_config_helper, spacing);
603+
let update = panel_config.set_spacing(panel_config_helper, space_none as u32);
606604
if let Err(err) = update {
607605
tracing::error!(?err, "Error updating panel spacing");
608606
}
@@ -611,11 +609,7 @@ impl Page {
611609

612610
if let Some(dock_config_helper) = dock_config_helper.as_ref() {
613611
if let Some(dock_config) = dock_config.as_mut() {
614-
let spacing = match density {
615-
Density::Compact => 0,
616-
_ => 4,
617-
};
618-
let update = dock_config.set_spacing(dock_config_helper, spacing);
612+
let update = dock_config.set_spacing(dock_config_helper, space_none as u32);
619613
if let Err(err) = update {
620614
tracing::error!(?err, "Error updating dock spacing");
621615
}

0 commit comments

Comments
 (0)