fix treeview anchor center

This commit is contained in:
2025-08-27 08:53:57 +02:00
parent 3a295ce70a
commit bd947bd80e
4 changed files with 13 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import re
from app_config import Msg
class BackupContentFrame(ttk.Frame):
def __init__(self, master, backup_manager, **kwargs):
super().__init__(master, **kwargs)
@@ -21,11 +22,14 @@ class BackupContentFrame(ttk.Frame):
columns = ("name", "date", "size")
self.content_tree = ttk.Treeview(
self.content_frame, columns=columns, show="headings")
self.content_tree.heading("name", text=Msg.STR["name"])
self.content_tree.heading("date", text=Msg.STR["date"])
self.content_tree.heading("size", text=Msg.STR["size"])
self.content_tree.heading(
"name", text=Msg.STR["name"])
self.content_tree.heading(
"date", text=Msg.STR["date"])
self.content_tree.heading(
"size", text=Msg.STR["size"])
for col in columns:
self.content_tree.column(col, width=150)
self.content_tree.column(col, width=150, anchor="center")
self.content_tree.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
list_button_frame = ttk.Frame(self.content_frame)
@@ -59,8 +63,8 @@ class BackupContentFrame(ttk.Frame):
match = re.match(r"(\d{4}-\d{2}-\d{2})", backup_name)
if match:
backup_date = match.group(1)
backup_size = ""
backup_size = ""
self.content_tree.insert("", "end", values=(
backup_name, backup_date, backup_size

View File

@@ -26,7 +26,7 @@ class SchedulerFrame(ttk.Frame):
self.jobs_tree.heading("destination", text=Msg.STR["destination"])
self.jobs_tree.heading("sources", text=Msg.STR["sources"])
for col in columns:
self.jobs_tree.column(col, width=100)
self.jobs_tree.column(col, width=100, anchor="center")
self.jobs_tree.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
self._load_scheduled_jobs()
@@ -149,7 +149,7 @@ class SchedulerFrame(ttk.Frame):
if job_type == "user":
command += f" --sources "
for s in job_sources:
command += f'\"{s}\" ' # This line has an issue with escaping
command += f'\"{s}\" ' # This line has an issue with escaping
comment = f"{self.backup_manager.app_tag}; type:{job_type}; freq:{job_frequency}; dest:{dest}"
if job_type == "user":
@@ -174,7 +174,7 @@ class SchedulerFrame(ttk.Frame):
for job in jobs:
self.jobs_tree.insert("", "end", values=(
job["active"], job["type"], job["frequency"], job["destination"], ", ".join(
job["sources"])
job["sources"])
), iid=job["id"])
def _remove_selected_job(self):