commit 52

This commit is contained in:
2025-08-03 23:34:04 +02:00
parent 6f8b0b290c
commit 6f9a7c922c
2 changed files with 64 additions and 37 deletions

View File

@@ -122,9 +122,11 @@ class WidgetManager:
main_frame.grid_columnconfigure(0, weight=1)
# Top bar for navigation and path
top_bar = ttk.Frame(main_frame, style='Accent.TFrame', padding=(0, 5, 0, 5))
top_bar = ttk.Frame(
main_frame, style='Accent.TFrame', padding=(0, 5, 0, 5))
top_bar.grid(row=0, column=0, columnspan=2, sticky="ew")
top_bar.grid_columnconfigure(2, weight=1) # Make path entry column expandable
# Make path entry column expandable
top_bar.grid_columnconfigure(2, weight=1)
# Left navigation buttons
left_nav_container = ttk.Frame(top_bar, style='Accent.TFrame')
@@ -159,13 +161,14 @@ class WidgetManager:
self.recursive_button = ttk.Button(search_container_left, image=self.dialog.icon_manager.get_icon(
'recursive_small'), command=self.dialog.toggle_recursive_search, style="Header.TButton.Active.Round")
self.recursive_button.pack(side="left", padx=2)
self.recursive_button.pack_forget() # Initially hidden
self.recursive_button.pack_forget() # Initially hidden
Tooltip(self.recursive_button, "Rekursive Suche ein/ausschalten")
# Path entry
self.path_entry = ttk.Entry(top_bar)
self.path_entry.grid(row=0, column=2, sticky="ew")
self.path_entry.bind("<Return>", lambda e: self.dialog.navigate_to(self.path_entry.get()))
self.path_entry.bind(
"<Return>", lambda e: self.dialog.navigate_to(self.path_entry.get()))
# Right-side controls
right_controls_container = ttk.Frame(top_bar, style='Accent.TFrame')
@@ -173,7 +176,8 @@ class WidgetManager:
# Search button (right position)
if search_icon_pos == 'right':
search_container_right = ttk.Frame(right_controls_container, style='Accent.TFrame')
search_container_right = ttk.Frame(
right_controls_container, style='Accent.TFrame')
search_container_right.pack(side="left", padx=5)
self.search_button = ttk.Button(search_container_right, image=self.dialog.icon_manager.get_icon(
'search_small'), command=self.dialog.toggle_search_mode, style="Header.TButton.Borderless.Round")
@@ -184,7 +188,7 @@ class WidgetManager:
self.recursive_button = ttk.Button(search_container_right, image=self.dialog.icon_manager.get_icon(
'recursive_small'), command=self.dialog.toggle_recursive_search, style="Header.TButton.Active.Round")
self.recursive_button.pack(side="left", padx=2)
self.recursive_button.pack_forget() # Initially hidden
self.recursive_button.pack_forget() # Initially hidden
Tooltip(self.recursive_button, "Rekursive Suche ein/ausschalten")
# Other right-side buttons
@@ -198,7 +202,8 @@ class WidgetManager:
self.new_file_button.pack(side="left", padx=5)
Tooltip(self.new_file_button, "Neues Dokument erstellen")
view_switch = ttk.Frame(right_controls_container, padding=(5, 0), style='Accent.TFrame')
view_switch = ttk.Frame(right_controls_container,
padding=(5, 0), style='Accent.TFrame')
view_switch.pack(side="left")
self.icon_view_button = ttk.Button(view_switch, image=self.dialog.icon_manager.get_icon(
@@ -382,55 +387,77 @@ class WidgetManager:
action_buttons_col = 0 if button_box_pos == 'left' else 2
action_buttons_sticky = "w" if button_box_pos == 'left' else "e"
action_buttons_frame = ttk.Frame(bottom_controls_frame, style="AccentBottom.TFrame")
action_buttons_frame.grid(row=0, column=action_buttons_col, rowspan=2, sticky="nsew", pady=(5, 10))
action_buttons_frame = ttk.Frame(
bottom_controls_frame, style="AccentBottom.TFrame")
action_buttons_frame.grid(
row=0, column=action_buttons_col, rowspan=2, sticky="nsew", pady=(5, 10))
self.status_bar = ttk.Label(bottom_controls_frame, text="", anchor="w", style="AccentBottom.TLabel")
self.status_bar = ttk.Label(
bottom_controls_frame, text="", anchor="w", style="AccentBottom.TLabel")
status_bar_col = 1 if button_box_pos == 'left' else 1
status_bar_sticky = "w" if button_box_pos == 'left' else "e"
self.status_bar.grid(row=0, column=status_bar_col, sticky=status_bar_sticky, padx=10)
self.status_bar.grid(row=0, column=status_bar_col,
sticky=status_bar_sticky, padx=10)
self.settings_button = ttk.Button(bottom_controls_frame, image=self.dialog.icon_manager.get_icon(
'settings-2_small'), command=self.dialog.open_settings_dialog, style="Bottom.TButton.Borderless.Round")
self.settings_button.grid(row=0, column=3, sticky="ne", padx=(0, 10), pady=(5,0))
self.settings_button.grid(
row=0, column=3, sticky="ne", padx=(0, 10), pady=(5, 0))
Tooltip(self.settings_button, "Einstellungen")
if self.dialog.dialog_mode == "save":
self.filename_entry = ttk.Entry(action_buttons_frame)
save_button = ttk.Button(action_buttons_frame, text="Speichern", command=self.dialog.on_save)
cancel_button = ttk.Button(action_buttons_frame, text="Abbrechen", command=self.dialog.on_cancel)
self.filter_combobox = ttk.Combobox(action_buttons_frame, values=[ft[0] for ft in self.dialog.filetypes], state="readonly")
save_button = ttk.Button(
action_buttons_frame, text="Speichern", command=self.dialog.on_save)
cancel_button = ttk.Button(
action_buttons_frame, text="Abbrechen", command=self.dialog.on_cancel)
self.filter_combobox = ttk.Combobox(action_buttons_frame, values=[
ft[0] for ft in self.dialog.filetypes], state="readonly")
if button_box_pos == 'left':
action_buttons_frame.grid_columnconfigure(0, weight=1)
self.filename_entry.grid(row=0, column=0, sticky="ew", padx=(10,5))
save_button.grid(row=0, column=1, sticky="e", padx=(0,10))
cancel_button.grid(row=1, column=0, sticky="w", padx=(10,5), pady=(5,0))
self.filter_combobox.grid(row=1, column=1, sticky="w", padx=(0,10), pady=(5,0))
else: # right
self.filename_entry.grid(
row=0, column=0, sticky="ew", padx=(10, 5))
save_button.grid(row=0, column=1, sticky="e", padx=(0, 10))
cancel_button.grid(row=1, column=0, sticky="w",
padx=(10, 5), pady=(5, 0))
self.filter_combobox.grid(
row=1, column=1, sticky="w", padx=(0, 10), pady=(5, 0))
else: # right
action_buttons_frame.grid_columnconfigure(1, weight=1)
save_button.grid(row=0, column=0, sticky="w", padx=(10,5))
self.filename_entry.grid(row=0, column=1, sticky="ew", padx=(0,10))
self.filter_combobox.grid(row=1, column=0, sticky="e", padx=(10,5), pady=(5,0))
cancel_button.grid(row=1, column=1, sticky="e", padx=(0,10), pady=(5,0))
save_button.grid(row=0, column=0, sticky="w", padx=(10, 5))
self.filename_entry.grid(
row=0, column=1, sticky="ew", padx=(0, 10))
self.filter_combobox.grid(
row=1, column=0, sticky="e", padx=(10, 5), pady=(5, 0))
cancel_button.grid(row=1, column=1, sticky="e",
padx=(0, 10), pady=(5, 0))
self.filter_combobox.bind("<<ComboboxSelected>>", self.dialog.on_filter_change)
self.filter_combobox.bind(
"<<ComboboxSelected>>", self.dialog.on_filter_change)
self.filter_combobox.set(self.dialog.filetypes[0][0])
else: # Open mode
open_button = ttk.Button(action_buttons_frame, text="Öffnen", command=self.dialog.on_open)
cancel_button = ttk.Button(action_buttons_frame, text="Abbrechen", command=self.dialog.on_cancel)
self.filter_combobox = ttk.Combobox(action_buttons_frame, values=[ft[0] for ft in self.dialog.filetypes], state="readonly")
open_button = ttk.Button(
action_buttons_frame, text="Öffnen", command=self.dialog.on_open)
cancel_button = ttk.Button(
action_buttons_frame, text="Abbrechen", command=self.dialog.on_cancel)
self.filter_combobox = ttk.Combobox(action_buttons_frame, values=[
ft[0] for ft in self.dialog.filetypes], state="readonly")
if button_box_pos == 'left':
open_button.grid(row=0, column=0, sticky="w", padx=(10,5))
cancel_button.grid(row=1, column=0, sticky="w", padx=(10,5), pady=(5,0))
self.filter_combobox.grid(row=1, column=1, sticky="w", padx=(0,10), pady=(5,0))
else: # right
open_button.grid(row=0, column=1, sticky="e", padx=(10,5))
cancel_button.grid(row=1, column=1, sticky="e", padx=(0,10), pady=(5,0))
self.filter_combobox.grid(row=1, column=0, sticky="e", padx=(10,5), pady=(5,0))
open_button.grid(row=0, column=0, sticky="w", padx=(10, 5))
cancel_button.grid(row=1, column=0, sticky="w",
padx=(10, 5), pady=(5, 0))
self.filter_combobox.grid(
row=1, column=1, sticky="w", padx=(0, 10), pady=(5, 0))
else: # right
open_button.grid(row=0, column=1, sticky="e", padx=(10, 5))
cancel_button.grid(row=1, column=1, sticky="e",
padx=(10, 5), pady=(5, 0))
self.filter_combobox.grid(
row=1, column=0, sticky="w", padx=(0, 0), pady=(5, 0))
self.filter_combobox.bind("<<ComboboxSelected>>", self.dialog.on_filter_change)
self.filter_combobox.bind(
"<<ComboboxSelected>>", self.dialog.on_filter_change)
self.filter_combobox.set(self.dialog.filetypes[0][0])