Skip to content

Commit 04fdd2e

Browse files
authored
Move delay indicators before toggle for alignment (#14)
* move delay/warning indicators before toggle for consistent alignment * fix dim-label not clearing on re-enable, update screenshot
1 parent f71595a commit 04fdd2e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

data/screenshot.jpg

-1.34 KB
Loading

src/ui/autostart_row.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ where
4848

4949
let entry_path = entry.path.clone();
5050
let entry_id = entry.id.clone();
51+
let toggle_row = row.clone();
5152

5253
toggle.connect_state_set(move |_, state| {
5354
match crate::operations::set_entry_enabled_by_path(&entry_path, state) {
5455
Ok(_) => {
5556
tracing::info!("Toggled {} to {}", entry_id, state);
57+
if state {
58+
toggle_row.remove_css_class("dim-label");
59+
} else {
60+
toggle_row.add_css_class("dim-label");
61+
}
5662
}
5763
Err(e) => {
5864
tracing::error!("Failed to toggle {}: {}", entry_id, e);
@@ -62,8 +68,6 @@ where
6268
glib::Propagation::Proceed
6369
});
6470

65-
row.add_suffix(&toggle);
66-
6771
let info_box = gtk4::Box::builder()
6872
.orientation(gtk4::Orientation::Horizontal)
6973
.spacing(6)
@@ -116,6 +120,7 @@ where
116120
}
117121

118122
row.add_suffix(&info_box);
123+
row.add_suffix(&toggle);
119124

120125
if entry.effective_state == EffectiveState::Disabled {
121126
row.add_css_class("dim-label");

0 commit comments

Comments
 (0)