Skip to content

Commit 174b062

Browse files
committed
fix(appearance): sync UI state with theme config on import and reset
1 parent 0020132 commit 174b062

File tree

2 files changed

+18
-3
lines changed
  • cosmic-settings/src/pages

2 files changed

+18
-3
lines changed

cosmic-settings/src/pages/bluetooth/mod.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,14 +940,22 @@ fn available_devices() -> Section<crate::pages::Message> {
940940
];
941941

942942
if device.enabled == Active::Disabled {
943-
items.push(widget::button::text(&descriptions[device_connect]).on_press(Message::ConnectDevice(path.clone())).into(), )
943+
items.push(
944+
widget::button::text(&descriptions[device_connect])
945+
.on_press(Message::ConnectDevice(path.clone()))
946+
.into(),
947+
)
944948
}
945949

946950
if device.enabled == Active::Enabling || device.enabled == Active::Enabled {
947-
items.push(text(&descriptions[device_connecting]).class(theme::Text::Color(color!(128, 128, 128))).into(), );
951+
items.push(
952+
text(&descriptions[device_connecting])
953+
.class(theme::Text::Color(color!(128, 128, 128)))
954+
.into(),
955+
);
948956
}
949957

950-
Some(widget::mouse_area(settings::item_row(items)).into(), )
958+
Some(widget::mouse_area(settings::item_row(items)).into())
951959
})
952960
.fold(section, settings::Section::add)
953961
.apply(Element::from)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ impl Page {
327327
} else {
328328
ThemeBuilder::light()
329329
};
330+
331+
self.roundness = builder.corner_radii.into();
332+
self.density = Density::Standard;
333+
330334
self.theme_manager.set_active_hint(builder.active_hint);
331335

332336
self.theme_manager
@@ -483,6 +487,9 @@ impl Page {
483487
tracing::error!(?err, "Error setting dark mode");
484488
}
485489

490+
self.roundness = builder.corner_radii.into();
491+
self.density = Density::Standard;
492+
486493
self.theme_manager
487494
.selected_customizer_mut()
488495
.set_builder(*builder.clone())

0 commit comments

Comments
 (0)