In the entry window, the buttons were set up and a frameless style was applied. Between the button was added still separators as a horizontal to make the look better

This commit is contained in:
2025-09-11 23:39:02 +02:00
parent d6ead1694c
commit eff7569d71
3 changed files with 73 additions and 47 deletions

View File

@@ -234,7 +234,7 @@ class Msg:
"animation_settings_title": _("Animation Settings"),
"backup_animation_label": _("Backup/Restore Animation:"),
"calc_animation_label": _("Size Calculation Animation:"),
"advanced_settings_warning": _("WARNING: Changing these settings is recommended for experienced users only. Incorrect configurations can lead to an unreliable backup.\n\nThe backup destination is always excluded for security reasons and cannot be changed here."),
"advanced_settings_warning": _("WARNING: Changing these settings is recommended for experienced users only. Incorrect configurations can lead to an unreliable backup.\nThe backup destination is always excluded for security reasons and cannot be changed here."),
"exclude_system_folders": _("Exclude system folders"),
"in_backup": _("In Backup"),
"name": _("Name"),

View File

@@ -436,7 +436,7 @@ class MainApplication(tk.Tk):
def _setup_settings_frame(self):
self.settings_frame = SettingsFrame(
self.content_frame, self.navigation, self.actions, self.backup_manager.encryption_manager, self.image_manager, self.config_manager, padding=10)
self.content_frame, self.navigation, self.actions, self.backup_manager.encryption_manager, self.image_manager, self.config_manager, padding=(0, 10))
self.settings_frame.grid(row=2, column=0, sticky="nsew")
self.settings_frame.grid_remove()
@@ -585,7 +585,8 @@ class MainApplication(tk.Tk):
pass # App is already destroyed
def _update_info_label(self, text, color="black"):
self.info_label.config(text=text, foreground=color, font=("Helvetica", 14))
self.info_label.config(
text=text, foreground=color, font=("Helvetica", 14))
def _process_queue(self):
try:
@@ -654,10 +655,12 @@ class MainApplication(tk.Tk):
self.start_cancel_button.config(
text=Msg.STR["start"])
if status == 'success':
self._update_info_label(Msg.STR["incremental_size_success"], color="#0078d7")
self._update_info_label(
Msg.STR["incremental_size_success"], color="#0078d7")
self.current_file_label.config(text="")
else:
self._update_info_label(Msg.STR["incremental_size_failed"], color="#D32F2F")
self._update_info_label(
Msg.STR["incremental_size_failed"], color="#D32F2F")
self.current_file_label.config(text="")
elif isinstance(message, tuple) and len(message) == 2:
@@ -710,9 +713,11 @@ class MainApplication(tk.Tk):
self.next_backup_content_view = 'user'
if status == 'success':
self._update_info_label(Msg.STR["backup_finished_successfully"])
self._update_info_label(
Msg.STR["backup_finished_successfully"])
elif status == 'warning':
self._update_info_label(Msg.STR["backup_finished_with_warnings"])
self._update_info_label(
Msg.STR["backup_finished_with_warnings"])
elif status == 'error':
self._update_info_label(Msg.STR["backup_failed"])
elif status == 'cancelled':

View File

@@ -24,10 +24,65 @@ class SettingsFrame(ttk.Frame):
self.pbp_app_config = AppConfig()
self.user_exclude_patterns = []
# --- Action Buttons ---
self.button_frame = ttk.Frame(self)
self.button_frame.pack(fill=tk.X, padx=10)
ttk.Separator(self.button_frame, orient=tk.HORIZONTAL).pack(
fill=tk.X, pady=(0, 5))
self.show_hidden_button = ttk.Button(
self.button_frame, command=self._toggle_hidden_files_view, style="Gray.Toolbutton")
self.show_hidden_button.pack(side=tk.LEFT)
self.unhide_icon = self.image_manager.get_icon(
'hide')
self.hide_icon = self.image_manager.get_icon(
'unhide')
self.show_hidden_button.config(image=self.unhide_icon)
ttk.Separator(self.button_frame, orient=tk.VERTICAL).pack(
side=tk.LEFT, ipady=15, padx=5)
add_to_exclude_button = ttk.Button(
self.button_frame, text=Msg.STR["add_to_exclude_list"], command=self._add_to_exclude_list, style="Gray.Toolbutton")
add_to_exclude_button.pack(side=tk.LEFT, padx=5)
ttk.Separator(self.button_frame, orient=tk.VERTICAL).pack(
side=tk.LEFT, ipady=15, padx=5)
advanced_button = ttk.Button(
self.button_frame, text=Msg.STR["advanced"], command=self._open_advanced_settings, style="Gray.Toolbutton")
advanced_button.pack(side=tk.LEFT, padx=5)
ttk.Separator(self.button_frame, orient=tk.VERTICAL).pack(
side=tk.LEFT, ipady=15, padx=5)
# Right-aligned buttons
hard_reset_button = ttk.Button(
self.button_frame, text=Msg.STR["hard_reset"], command=self._toggle_hard_reset_view, style="Gray.Toolbutton")
hard_reset_button.pack(side=tk.LEFT, padx=5)
ttk.Separator(self.button_frame, orient=tk.VERTICAL).pack(
side=tk.LEFT, ipady=15, padx=5)
reset_button = ttk.Button(
self.button_frame, text=Msg.STR["default_settings"], command=self.actions.reset_to_default_settings, style="Gray.Toolbutton")
reset_button.pack(side=tk.LEFT)
# --- Container for Treeviews ---
self.trees_container = ttk.Frame(self)
self.trees_container.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
# --- Bottom Buttons ---
self.bottom_button_frame = ttk.Frame(self)
self.bottom_button_frame.pack(pady=10)
apply_button = ttk.Button(
self.bottom_button_frame, text=Msg.STR["apply"], command=self._apply_changes)
apply_button.pack(side=tk.LEFT, padx=5)
cancel_button = ttk.Button(self.bottom_button_frame, text=Msg.STR["cancel"],
command=lambda: self.navigation.toggle_mode("backup", 0))
cancel_button.pack(side=tk.LEFT, padx=5)
# --- Treeview for file/folder exclusion ---
self.tree_frame = ttk.LabelFrame(
self.trees_container, text=Msg.STR["user_defined_folder_settings"], padding=10)
@@ -85,43 +140,6 @@ class SettingsFrame(ttk.Frame):
hard_reset_button_frame, text=Msg.STR["cancel"], command=self._toggle_hard_reset_view)
cancel_hard_reset_button.pack(side=tk.LEFT, padx=5)
# --- Action Buttons ---
self.button_frame = ttk.Frame(self)
self.button_frame.pack(fill=tk.X, padx=10, pady=10)
self.show_hidden_button = ttk.Button(
self.button_frame, command=self._toggle_hidden_files_view, style="TButton.Borderless.Round")
self.show_hidden_button.pack(side=tk.LEFT)
self.unhide_icon = self.image_manager.get_icon(
'hide')
self.hide_icon = self.image_manager.get_icon(
'unhide')
self.show_hidden_button.config(image=self.unhide_icon)
add_to_exclude_button = ttk.Button(
self.button_frame, text=Msg.STR["add_to_exclude_list"], command=self._add_to_exclude_list)
add_to_exclude_button.pack(side=tk.LEFT, padx=5)
apply_button = ttk.Button(
self.button_frame, text=Msg.STR["apply"], command=self._apply_changes)
apply_button.pack(side=tk.LEFT, padx=5)
cancel_button = ttk.Button(self.button_frame, text=Msg.STR["cancel"],
command=lambda: self.navigation.toggle_mode("backup", 0))
cancel_button.pack(side=tk.LEFT, padx=5)
advanced_button = ttk.Button(
self.button_frame, text=Msg.STR["advanced"], command=self._open_advanced_settings)
advanced_button.pack(side=tk.LEFT, padx=5)
hard_reset_button = ttk.Button(
self.button_frame, text=Msg.STR["hard_reset"], command=self._toggle_hard_reset_view)
hard_reset_button.pack(side=tk.RIGHT, padx=5)
reset_button = ttk.Button(
self.button_frame, text=Msg.STR["default_settings"], command=self.actions.reset_to_default_settings)
reset_button.pack(side=tk.RIGHT)
self.hidden_files_visible = False
self.hard_reset_visible = False
# To hold the instance of AdvancedSettingsFrame
@@ -153,13 +171,15 @@ class SettingsFrame(ttk.Frame):
if self.hard_reset_visible:
self.trees_container.pack_forget()
self.button_frame.pack_forget()
self.bottom_button_frame.pack_forget()
self.hard_reset_frame.pack(
fill=tk.BOTH, expand=True, padx=10, pady=5)
else:
self.hard_reset_frame.pack_forget()
self.button_frame.pack(fill=tk.X, padx=10)
self.trees_container.pack(
fill=tk.BOTH, expand=True, padx=10, pady=5)
self.button_frame.pack(fill=tk.X, padx=10, pady=10)
self.bottom_button_frame.pack(pady=10)
def _add_to_exclude_list(self) -> bool:
result = MessageDialog("ask", Msg.STR["exclude_dialog_text"], title=Msg.STR["add_to_exclude_list"], buttons=[
@@ -322,6 +342,7 @@ class SettingsFrame(ttk.Frame):
# Hide main settings UI elements
self.trees_container.pack_forget() # Hide the container for treeviews
self.button_frame.pack_forget()
self.bottom_button_frame.pack_forget()
# Create AdvancedSettingsFrame if not already created
if not self.advanced_settings_frame_instance:
@@ -342,9 +363,9 @@ class SettingsFrame(ttk.Frame):
# Show main settings UI elements
# Re-pack the container for treeviews
self.button_frame.pack(fill=tk.X, padx=10)
self.trees_container.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)
# Re-pack the button frame
self.button_frame.pack(fill=tk.X, padx=10, pady=10)
self.bottom_button_frame.pack(pady=10)
def _toggle_hidden_files_view(self):
self.hidden_files_visible = not self.hidden_files_visible