File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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) ;
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" ) ;
You can’t perform that action at this time.
0 commit comments