add animated icon in Backup Content
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
import os
|
||||
|
||||
from shared_libs.animated_icon import AnimatedIcon
|
||||
from pbp_app_config import Msg
|
||||
from pyimage_ui.system_backup_content_frame import SystemBackupContentFrame
|
||||
from pyimage_ui.user_backup_content_frame import UserBackupContentFrame
|
||||
@@ -54,6 +54,20 @@ class BackupContentFrame(ttk.Frame):
|
||||
ttk.Separator(top_nav_frame, orient=tk.VERTICAL).pack(
|
||||
side=tk.LEFT, fill=tk.Y, padx=2)
|
||||
|
||||
# Deletion Status UI
|
||||
self.deletion_status_frame = ttk.Frame(header_frame)
|
||||
self.deletion_status_frame.pack(side=tk.LEFT, padx=15)
|
||||
|
||||
bg_color = self.winfo_toplevel().style.lookup('TFrame', 'background')
|
||||
self.deletion_animated_icon = AnimatedIcon(
|
||||
self.deletion_status_frame, width=20, height=20, use_pillow=True, bg=bg_color, animation_type="blink")
|
||||
self.deletion_animated_icon.pack(side=tk.LEFT, padx=5)
|
||||
self.deletion_animated_icon.stop("DISABLE")
|
||||
|
||||
self.deletion_status_label = ttk.Label(
|
||||
self.deletion_status_frame, text="", font=("Ubuntu", 10, "bold"))
|
||||
self.deletion_status_label.pack(side=tk.LEFT, padx=5)
|
||||
|
||||
content_container = ttk.Frame(self)
|
||||
content_container.grid(row=1, column=0, sticky="nsew")
|
||||
content_container.grid_rowconfigure(0, weight=1)
|
||||
@@ -190,3 +204,17 @@ class BackupContentFrame(ttk.Frame):
|
||||
config_key = "last_encrypted_backup_content_view" if self.viewing_encrypted else "last_backup_content_view"
|
||||
last_view = self.app.config_manager.get_setting(config_key, 0)
|
||||
self._switch_view(last_view)
|
||||
|
||||
def hide(self):
|
||||
self.grid_remove()
|
||||
|
||||
def show_deletion_status(self, text: str):
|
||||
app_logger.log(f"Showing deletion status: {text}")
|
||||
self.deletion_status_label.config(text=text)
|
||||
self.deletion_animated_icon.start()
|
||||
self.deletion_status_frame.pack(side=tk.LEFT, padx=15)
|
||||
|
||||
def hide_deletion_status(self):
|
||||
app_logger.log("Hiding deletion status.")
|
||||
self.deletion_animated_icon.stop("DISABLE")
|
||||
self.deletion_status_frame.pack_forget()
|
||||
|
||||
Reference in New Issue
Block a user