commit 60
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -334,17 +334,22 @@ class WidgetManager:
|
||||
def _setup_bottom_bar(self):
|
||||
"""Sets up the bottom bar including containers and widgets based on dialog mode."""
|
||||
self.action_status_frame = ttk.Frame(self.content_frame, style="AccentBottom.TFrame")
|
||||
self.action_status_frame.grid(row=1, column=0, sticky="ew", pady=(5, 10), padx=10)
|
||||
self.action_status_frame.grid(row=1, column=0, sticky="ew", pady=(5, 5), padx=10)
|
||||
self.status_container = ttk.Frame(self.action_status_frame, style="AccentBottom.TFrame")
|
||||
self.left_container = ttk.Frame(self.action_status_frame, style="AccentBottom.TFrame")
|
||||
self.center_container = ttk.Frame(self.action_status_frame, style="AccentBottom.TFrame")
|
||||
self.right_container = ttk.Frame(self.action_status_frame, style="AccentBottom.TFrame")
|
||||
|
||||
self.action_status_frame.grid_columnconfigure(1, weight=1)
|
||||
self.status_container.grid(row=0, column=0, columnspan=3, sticky='ew')
|
||||
self.left_container.grid(row=1, column=0, sticky='w')
|
||||
self.center_container.grid(row=1, column=1, sticky='ew')
|
||||
self.right_container.grid(row=1, column=2, sticky='e')
|
||||
|
||||
self.left_container.grid(row=0, column=0, sticky='w', pady=(10,0))
|
||||
self.center_container.grid(row=0, column=1, sticky='ew', pady=(10,0))
|
||||
self.right_container.grid(row=0, column=2, sticky='e', pady=(10,0))
|
||||
self.separator_color = "#a9a9a9" if self.style_manager.is_dark else "#7c7c7c"
|
||||
self.separator = tk.Frame(self.action_status_frame, height=1, bg=self.separator_color)
|
||||
self.separator.grid(row=1, column=0, columnspan=3, sticky="ew", pady=(4,0))
|
||||
self.status_container.grid(row=2, column=0, columnspan=3, sticky='ew')
|
||||
|
||||
|
||||
# --- Define Widgets ---
|
||||
self.search_status_label = ttk.Label(self.status_container, text="", style="AccentBottom.TLabel")
|
||||
|
@@ -242,8 +242,9 @@ class CustomFileDialog(tk.Toplevel):
|
||||
|
||||
self.search_mode = True
|
||||
if self.dialog_mode == "open":
|
||||
self.widget_manager.status_bar.pack_forget()
|
||||
self.widget_manager.search_entry.pack(side="top", fill="x", in_=self.widget_manager.center_container)
|
||||
self.widget_manager.status_bar.grid_remove()
|
||||
self.widget_manager.search_entry.grid(row=1, column=0, sticky="ew", in_=self.widget_manager.center_container)
|
||||
self.widget_manager.center_container.grid_rowconfigure(1, weight=0)
|
||||
self.widget_manager.search_entry.focus_set()
|
||||
self.widget_manager.search_entry.insert(0, event.char)
|
||||
self.widget_manager.search_entry.bind("<Return>", self.execute_search)
|
||||
@@ -257,8 +258,9 @@ class CustomFileDialog(tk.Toplevel):
|
||||
def hide_search_bar(self, event=None):
|
||||
self.search_mode = False
|
||||
if self.dialog_mode == "open":
|
||||
self.widget_manager.search_entry.pack_forget()
|
||||
self.widget_manager.status_bar.pack(side="top", fill="x", in_=self.widget_manager.center_container)
|
||||
self.widget_manager.search_entry.grid_forget()
|
||||
self.widget_manager.status_bar.grid(row=1, column=0, sticky="ew", in_=self.widget_manager.center_container)
|
||||
self.widget_manager.center_container.grid_rowconfigure(1, weight=0)
|
||||
self.widget_manager.search_entry.delete(0, tk.END)
|
||||
else: # save mode
|
||||
self.widget_manager.filename_entry.delete(0, tk.END)
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user