commit 30
This commit is contained in:
Binary file not shown.
@@ -352,9 +352,15 @@ class CustomFileDialog(tk.Toplevel):
|
|||||||
btn = ttk.Button(mounted_devices_frame, text=f" {device_name}", image=icon,
|
btn = ttk.Button(mounted_devices_frame, text=f" {device_name}", image=icon,
|
||||||
compound="left", command=lambda p=mount_point: self.navigate_to(p), style="Dark.TButton.Borderless")
|
compound="left", command=lambda p=mount_point: self.navigate_to(p), style="Dark.TButton.Borderless")
|
||||||
btn.pack(fill="x", pady=1)
|
btn.pack(fill="x", pady=1)
|
||||||
self.device_bar = ttk.Progressbar(
|
try:
|
||||||
mounted_devices_frame, orient="horizontal", length=100, mode="determinate", style='Small.Horizontal.TProgressbar')
|
total, used, _ = shutil.disk_usage(mount_point)
|
||||||
self.device_bar.pack(fill="x", pady=(2, 5), padx=15)
|
progress_bar = ttk.Progressbar(
|
||||||
|
mounted_devices_frame, orient="horizontal", length=100, mode="determinate", style='Small.Horizontal.TProgressbar')
|
||||||
|
progress_bar.pack(fill="x", pady=(2, 8), padx=25)
|
||||||
|
progress_bar['value'] = (used / total) * 100
|
||||||
|
except (FileNotFoundError, PermissionError):
|
||||||
|
# In case of errors (e.g., unreadable drive), just skip the progress bar
|
||||||
|
pass
|
||||||
|
|
||||||
tk.Frame(sidebar_frame, height=1, bg=separator_color).grid(
|
tk.Frame(sidebar_frame, height=1, bg=separator_color).grid(
|
||||||
row=3, column=0, sticky="ew", padx=20, pady=15)
|
row=3, column=0, sticky="ew", padx=20, pady=15)
|
||||||
|
|||||||
Reference in New Issue
Block a user