diff --git a/__pycache__/cfd_app_config.cpython-312.pyc b/__pycache__/cfd_app_config.cpython-312.pyc new file mode 100644 index 0000000..a9be0d2 Binary files /dev/null and b/__pycache__/cfd_app_config.cpython-312.pyc differ diff --git a/__pycache__/cfd_ui_setup.cpython-312.pyc b/__pycache__/cfd_ui_setup.cpython-312.pyc new file mode 100644 index 0000000..8824576 Binary files /dev/null and b/__pycache__/cfd_ui_setup.cpython-312.pyc differ diff --git a/__pycache__/custom_file_dialog.cpython-312.pyc b/__pycache__/custom_file_dialog.cpython-312.pyc new file mode 100644 index 0000000..c579d4b Binary files /dev/null and b/__pycache__/custom_file_dialog.cpython-312.pyc differ diff --git a/cfd_ui_setup.py b/cfd_ui_setup.py index 5e2c161..8aa7fa2 100644 --- a/cfd_ui_setup.py +++ b/cfd_ui_setup.py @@ -99,6 +99,13 @@ class StyleManager: style.configure("TButton.Borderless.Round", anchor="w") style.configure("Small.Horizontal.TProgressbar", thickness=8) + style.configure("Bottom.TButton.Borderless.Round", + background=self.bottom_color) + style.map("Bottom.TButton.Borderless.Round", + background=[('active', self.hover_extrastyle)]) + style.layout("Bottom.TButton.Borderless.Round", + style.layout("Header.TButton.Borderless.Round")) + class WidgetManager: def __init__(self, dialog, settings): @@ -148,6 +155,13 @@ class WidgetManager: self.search_button.pack(side="left", padx=5) Tooltip(self.search_button, "Suchen") + self.recursive_search = tk.BooleanVar(value=True) + 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 + 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") @@ -166,6 +180,13 @@ class WidgetManager: self.search_button.pack(side="left") Tooltip(self.search_button, "Suchen") + self.recursive_search = tk.BooleanVar(value=True) + 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 + Tooltip(self.recursive_button, "Rekursive Suche ein/ausschalten") + # Other right-side buttons self.new_folder_button = ttk.Button(right_controls_container, image=self.dialog.icon_manager.get_icon( 'new_folder_small'), command=self.dialog.create_new_folder, style="Header.TButton.Borderless.Round") @@ -195,19 +216,6 @@ class WidgetManager: self.hidden_files_button.pack(side="left", padx=10) Tooltip(self.hidden_files_button, "Versteckte Dateien anzeigen") - self.settings_button = ttk.Button(right_controls_container, image=self.dialog.icon_manager.get_icon( - 'settings-2_small'), command=self.dialog.open_settings_dialog, style="Header.TButton.Borderless.Round") - self.settings_button.pack(side="left", padx=(0, 10)) - Tooltip(self.settings_button, "Einstellungen") - - # Search options frame (initially hidden) - self.search_options_frame = ttk.Frame(top_bar, style='Accent.TFrame') - self.recursive_search = tk.BooleanVar(value=True) - self.recursive_button = ttk.Button(self.search_options_frame, 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) - Tooltip(self.recursive_button, "Rekursive Suche ein/ausschalten") - # Horizontal separator separator_color = "#000000" if self.style_manager.is_dark else "#9c9c9c" tk.Frame(main_frame, height=1, bg=separator_color).grid( @@ -380,6 +388,11 @@ class WidgetManager: self.status_bar = ttk.Label(bottom_controls_frame, text="", anchor="w", style="AccentBottom.TLabel") self.status_bar.grid(row=0, column=1, sticky="ew", 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)) + Tooltip(self.settings_button, "Einstellungen") + if self.dialog.dialog_mode == "save": # Create a container for the top row (entry and save button) top_row = ttk.Frame(action_buttons_frame, style="AccentBottom.TFrame") diff --git a/custom_file_dialog.py b/custom_file_dialog.py index cc79f97..9cdee5b 100644 --- a/custom_file_dialog.py +++ b/custom_file_dialog.py @@ -257,7 +257,7 @@ class CustomFileDialog(tk.Toplevel): "", self.clear_search_placeholder) # Show search options - self.widget_manager.search_options_frame.pack(side="left", padx=2) + self.widget_manager.recursive_button.pack(side="left", padx=5) else: # Exit search mode self.search_mode = False @@ -268,7 +268,7 @@ class CustomFileDialog(tk.Toplevel): self.widget_manager.path_entry.unbind("") # Hide search options - self.widget_manager.search_options_frame.pack_forget() + self.widget_manager.recursive_button.pack_forget() # Return to normal file view self.populate_files() diff --git a/mainwindow.py b/mainwindow.py index c7d103a..65766ee 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -33,7 +33,7 @@ class GlotzMol(tk.Tk): dialog = CustomFileDialog(self, initial_dir=os.path.expanduser("~"), filetypes=[("All Files", "*.*") - ]) + ], dialog_mode="save") # This is the crucial part: wait for the dialog to be closed self.wait_window(dialog) @@ -55,7 +55,7 @@ if __name__ == "__main__": style = ttk.Style(root) root.tk.call('source', f"{theme_path}/water.tcl") try: - root.tk.call('set_theme', 'dark') + root.tk.call('set_theme', 'light') except tk.TclError: pass root.mainloop()