@@ -32,7 +32,6 @@ def __init__(self, main_window, **kwargs):
3232 # Dictionaries to map UI widgets to their corresponding shell scripts
3333 self .switch_scripts = {}
3434 self .status_indicators = {}
35- self ._search_mode = False
3635
3736 def create_scrolled_content (self ):
3837 """Cria a estrutura básica de scroll e box vertical."""
@@ -49,10 +48,8 @@ def create_scrolled_content(self):
4948 return self .content_box
5049
5150 def set_search_mode (self , enabled ):
52- """Adjust margins for search mode (compact) or normal mode."""
53- if not hasattr (self , "content_box" ):
54- return
55- self ._search_mode = enabled
51+ """Placeholder method for search mode compatibility."""
52+ pass
5653
5754 def on_reload_clicked (self , widget ):
5855 """Callback for the reload button. Triggers a full UI state sync."""
@@ -228,17 +225,18 @@ def sync_all_switches(self):
228225 switch .handler_block_by_func (self .on_switch_changed )
229226
230227 if status == "true_disabled" :
231- # State: Enabled but cannot be changed.
232- row .set_sensitive (False )
233- row .set_tooltip_text (message )
234- switch .set_active (True )
228+ # State: Enabled but cannot be changed - hide it from interface.
229+ row .set_visible (False )
230+ row ._hidden_no_support = True
235231 elif status is None :
236- row .set_sensitive (False )
237- row .set_tooltip_text (message )
232+ # Feature not supported - hide it from interface.
238233 row .set_visible (False )
234+ row ._hidden_no_support = True
239235 else :
240236 row .set_sensitive (True )
237+ row .set_visible (True )
241238 row .set_tooltip_text (None )
239+ row ._hidden_no_support = False
242240 switch .handler_block_by_func (self .on_switch_changed )
243241 switch .set_active (status )
244242 switch .handler_unblock_by_func (self .on_switch_changed )
@@ -261,12 +259,14 @@ def sync_all_switches(self):
261259 indicator .remove_css_class ("status-unavailable" )
262260
263261 if status is None :
264- row . set_sensitive ( False )
265- row .set_tooltip_text ( message )
266- indicator . add_css_class ( "status-unavailable" )
262+ # Feature not supported - hide it from interface.
263+ row .set_visible ( False )
264+ row . _hidden_no_support = True
267265 else :
268266 row .set_sensitive (True )
267+ row .set_visible (True )
269268 row .set_tooltip_text (None )
269+ row ._hidden_no_support = False
270270 if status :
271271 indicator .add_css_class ("status-on" )
272272 else :
@@ -333,6 +333,11 @@ def get_matching_rows(self, search_text):
333333 row = listbox .get_first_child ()
334334 while row :
335335 if isinstance (row , (Adw .PreferencesRow , Gtk .ListBoxRow )):
336+ # Skip rows hidden due to lack of support
337+ if getattr (row , "_hidden_no_support" , False ):
338+ row = row .get_next_sibling ()
339+ continue
340+
336341 text = self ._get_row_text (row ).lower ()
337342 if search_text in text :
338343 matching .append ((row , child ))
@@ -369,6 +374,11 @@ def _filter_group(self, group, search_text, hide_group_headers=False):
369374 row = listbox .get_first_child ()
370375 while row :
371376 if isinstance (row , (Adw .PreferencesRow , Gtk .ListBoxRow )):
377+ # Skip rows hidden due to lack of support
378+ if getattr (row , "_hidden_no_support" , False ):
379+ row = row .get_next_sibling ()
380+ continue
381+
372382 if not search_text :
373383 row .set_visible (True )
374384 visible_count += 1
0 commit comments