replace tooltip animation with exist tooltip, redundancy reduced, search optimized, add new icons copy and stair (for path folllow)
This commit is contained in:
@@ -201,8 +201,9 @@ class SearchManager:
|
||||
|
||||
def show_search_results_treeview(self) -> None:
|
||||
"""Displays the search results in a dedicated Treeview."""
|
||||
for widget in self.dialog.widget_manager.file_list_frame.winfo_children():
|
||||
widget.destroy()
|
||||
if self.dialog.widget_manager.file_list_frame.winfo_exists():
|
||||
for widget in self.dialog.widget_manager.file_list_frame.winfo_children():
|
||||
widget.destroy()
|
||||
|
||||
tree_frame = ttk.Frame(self.dialog.widget_manager.file_list_frame)
|
||||
tree_frame.pack(fill='both', expand=True)
|
||||
@@ -280,14 +281,25 @@ class SearchManager:
|
||||
|
||||
def on_search_double_click(event: tk.Event) -> None:
|
||||
selection = search_tree.selection()
|
||||
if selection:
|
||||
item = search_tree.item(selection[0])
|
||||
filename = item['text'].strip()
|
||||
directory = item['values'][0]
|
||||
if not selection:
|
||||
return
|
||||
|
||||
item = search_tree.item(selection[0])
|
||||
filename = item['text'].strip()
|
||||
directory = item['values'][0]
|
||||
full_path = os.path.join(directory, filename)
|
||||
|
||||
if not os.path.exists(full_path):
|
||||
return # Item no longer exists
|
||||
|
||||
if os.path.isdir(full_path):
|
||||
# For directories, navigate into them
|
||||
self.hide_search_bar()
|
||||
self.dialog.navigation_manager.navigate_to(
|
||||
directory, file_to_select=filename)
|
||||
self.dialog.navigation_manager.navigate_to(full_path)
|
||||
else:
|
||||
# For files, select it and close the dialog
|
||||
self.dialog.selected_file = full_path
|
||||
self.dialog.destroy()
|
||||
|
||||
search_tree.bind("<Double-1>", on_search_double_click)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user