Skip to content

Commit

Permalink
fix: apply the roundness to the panel after reset to system defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 authored and mmstick committed May 3, 2024
1 parent a5fafed commit a7d8d73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cosmic-settings/src/pages/desktop/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ impl Page {
tracing::error!("Failed to get the theme config.");
}

Self::update_panel_radii(self.roundness);

self.reload_theme_mode();
Command::none()
}
Expand Down
16 changes: 12 additions & 4 deletions cosmic-settings/src/pages/desktop/panel/inner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use cosmic::{
cctk::sctk::reexports::client::{backend::ObjectId, protocol::wl_output::WlOutput, Proxy},
cosmic_config::{self, Config, CosmicConfigEntry},
cosmic_theme::{CornerRadii, ThemeBuilder, ThemeMode},
cosmic_config::{self, CosmicConfigEntry},
iced::Length,
theme,
widget::{
Expand Down Expand Up @@ -398,13 +397,22 @@ impl PageInner {
Message::ResetPanel => {
if let Some((default, config)) = self
.system_default
.as_ref()
.as_mut()
.zip(self.config_helper.as_ref())
{
self.panel_config = self.system_default.clone();
if default.anchor_gap || !default.expand_to_edges {
let radii = cosmic::theme::system_preference()
.cosmic()
.corner_radii
.radius_xl[0] as u32;
default.border_radius = radii;
} else {
default.border_radius = 0;
}
if let Err(err) = default.write_entry(config) {
tracing::error!(?err, "Error resetting panel config.");
}
self.panel_config = self.system_default.clone();
} else {
tracing::error!("Panel config default is missing.");
}
Expand Down

0 comments on commit a7d8d73

Please sign in to comment.