commit 50
This commit is contained in:
BIN
__pycache__/cfd_app_config.cpython-312.pyc
Normal file
BIN
__pycache__/cfd_app_config.cpython-312.pyc
Normal file
Binary file not shown.
BIN
__pycache__/cfd_ui_setup.cpython-312.pyc
Normal file
BIN
__pycache__/cfd_ui_setup.cpython-312.pyc
Normal file
Binary file not shown.
BIN
__pycache__/custom_file_dialog.cpython-312.pyc
Normal file
BIN
__pycache__/custom_file_dialog.cpython-312.pyc
Normal file
Binary file not shown.
@@ -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")
|
||||
|
@@ -257,7 +257,7 @@ class CustomFileDialog(tk.Toplevel):
|
||||
"<FocusIn>", 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("<FocusIn>")
|
||||
|
||||
# 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()
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user