@@ -32,6 +32,7 @@ class ThemeView(BaseItemView):
3232 def __init__ (self , system_service : SystemService , ** kwargs ):
3333 self .jamesdsp_switch = None
3434 self .contrast_switch = None
35+ self ._system_service = system_service # Store reference for ICC callbacks
3536
3637 self .jamesdsp_available = system_service .check_jamesdsp_availability ()
3738 self .contrast_available = system_service .check_enhanced_contrast_availability ()
@@ -183,6 +184,8 @@ def _create_contrast_card(self, parent_box):
183184 self .contrast_switch = Gtk .Switch (
184185 valign = Gtk .Align .CENTER , active = self .default_contrast_state
185186 )
187+ # Connect callback to apply ICC profile immediately when switch state changes
188+ self .contrast_switch .connect ("notify::active" , self ._on_contrast_switch_toggled )
186189 content .append (self .contrast_switch )
187190
188191 controller = Gtk .GestureClick .new ()
@@ -262,3 +265,9 @@ def is_contrast_enabled(self) -> bool:
262265 if self .contrast_switch :
263266 return self .contrast_switch .get_active ()
264267 return False
268+
269+ def _on_contrast_switch_toggled (self , switch , param ):
270+ """Called immediately when the ICC profile switch state changes."""
271+ enabled = switch .get_active ()
272+ logger .info (f"ICC profile switch toggled: { 'enabled' if enabled else 'disabled' } " )
273+ self ._system_service .apply_icc_profile_settings (enabled )
0 commit comments