1616from .widgets import DisplayWidget , ControlButtonsWidget , PreviewWidget , VideoControlsWidget
1717from .widgets import MultiSelectPopUpWidget , DataSelectionPopup , MessageBoxPopup , GetNumberBetweenRangePopup , RootSelectionPopup , ExportVideoPopup , ExportSelectionPopup , ProgressBarPopup , SettingsPopupWidget
1818from .enums import VCModes , VCState
19- from .utils import image_utils , set_appearance_mode_and_theme , file_reader , is_window_in_background
19+ from .utils import image_utils , set_appearance_mode_and_theme , file_reader , is_window_in_background , set_tkinter_widgets_appearance_mode
2020from .configurations import read_config , parse_config , config_info
2121
2222
@@ -43,6 +43,7 @@ def __init__(self, root=None, preview_folder=None, config_path="visual_compariso
4343 self .configurations = parse_config (read_config (config_path ))
4444
4545 set_appearance_mode_and_theme (self .configurations ["Appearance" ]["mode" ], self .configurations ["Appearance" ]["theme" ])
46+ set_tkinter_widgets_appearance_mode (self )
4647
4748 self .root = root
4849 self .preview_folder = preview_folder
@@ -163,6 +164,7 @@ def on_change_settings(self):
163164 self .configurations = new_config
164165 self .bind_keys_to_buttons (prev_config )
165166 set_appearance_mode_and_theme (new_config ["Appearance" ]["mode" ], new_config ["Appearance" ]["theme" ])
167+ set_tkinter_widgets_appearance_mode (self )
166168
167169 def on_change_dir (self ):
168170 self .on_pause (paused = True )
@@ -276,11 +278,30 @@ def on_filter_files(self):
276278
277279 # Get data from popup
278280 popup = DataSelectionPopup (self .content_handler .data , column_titles = titles , text_width = text_width , ctk_corner_radius = self .configurations ["Display" ]["ctk_corner_radius" ])
279- is_cancelled , rows = popup .get_input ()
281+ is_cancelled , ( action , data ) = popup .get_input ()
280282
281283 if is_cancelled :
282284 return
283285
286+ if action not in ["search" , "filter" ]:
287+ raise NotImplementedError (f"Unknown action: { action } " )
288+
289+ if action == "search" :
290+ search_name = data
291+
292+ # Index returned by search index is for displayed items, so we need to find which items are displayed
293+ try :
294+ selected_index = self .content_handler .current_files .index (search_name )
295+ except ValueError :
296+ msg_popup = MessageBoxPopup (f"Unable to change to '{ search_name } ', item not in current view" , self .configurations ["Display" ]["ctk_corner_radius" ])
297+ msg_popup .wait ()
298+ return
299+
300+ self .on_specify_index (selected_index )
301+ return
302+
303+ # Filter action
304+ rows = data
284305 if len (rows ) == 0 :
285306 msg_popup = MessageBoxPopup ("No items selected. Ignoring selection" , self .configurations ["Display" ]["ctk_corner_radius" ])
286307 msg_popup .wait ()
0 commit comments