diff --git a/__pycache__/custom_file_dialog.cpython-312.pyc b/__pycache__/custom_file_dialog.cpython-312.pyc index bbec16d..4c53955 100644 Binary files a/__pycache__/custom_file_dialog.cpython-312.pyc and b/__pycache__/custom_file_dialog.cpython-312.pyc differ diff --git a/custom_file_dialog.py b/custom_file_dialog.py index 7c04e15..3138fbc 100644 --- a/custom_file_dialog.py +++ b/custom_file_dialog.py @@ -53,7 +53,7 @@ class Tooltip: def leave(self, event=None): self.unschedule(); self.hide_tooltip() def schedule(self): self.unschedule( - ); self.id = self.widget.after(500, self.show_tooltip) + ); self.id = self.widget.after(250, self.show_tooltip) def unschedule(self): id = self.id @@ -192,12 +192,12 @@ class CustomFileDialog(tk.Toplevel): self.icon_bg_color = base_bg # Main background for content self.accent_color = "#e0e0e0" # Light Color for Header and round buttons in Header - self.header = "#ffffff" + self.header = "#d9d9d9" # Hover Color for Buttons in header and Sidebar self.hover_extrastyle = "#f5f5f5" self.hover_extrastyle2 = "#494949" # Hover Color for Buttons in Sidebar self.sidebar_color = "#e7e7e7" - self.bottom_color = "#d9d9d9" + self.bottom_color = "#cecece" self.freespace_background = self.sidebar_color self.color_foreground = "#000000" @@ -301,7 +301,7 @@ class CustomFileDialog(tk.Toplevel): Tooltip(self.hidden_files_button, "Versteckte Dateien anzeigen") # Horizontal separator - separator_color = "#000000" if self.is_dark else "#d9d9d9" + separator_color = "#000000" if self.is_dark else "#9c9c9c" tk.Frame(main_frame, height=1, bg=separator_color).grid( row=1, column=0, columnspan=2, sticky="ew") @@ -309,7 +309,8 @@ class CustomFileDialog(tk.Toplevel): sidebar_frame = ttk.Frame( main_frame, style="Sidebar.TFrame", padding=(0, 0, 0, 15)) sidebar_frame.grid(row=2, column=0, sticky="nsw") - sidebar_frame.grid_rowconfigure(2, weight=1) # Only the devices frame row expands + # Only the devices frame row expands + sidebar_frame.grid_rowconfigure(2, weight=1) sidebar_buttons_frame = ttk.Frame( sidebar_frame, style="Sidebar.TFrame", padding=(0, 15, 0, 0)) @@ -334,8 +335,10 @@ class CustomFileDialog(tk.Toplevel): compound="left", command=lambda p=config['path']: self.navigate_to(p), style="Dark.TButton.Borderless") btn.pack(fill="x", pady=1) - ttk.Separator(sidebar_frame, orient='horizontal').grid( - row=1, column=0, sticky='ew', pady=10, padx=20) + # Horizontal separator + separator_color = "#a9a9a9" if self.is_dark else "#7c7c7c" + tk.Frame(sidebar_frame, height=1, bg=separator_color).grid( + row=1, column=0, sticky="ew", padx=20, pady=15) # Mounted devices mounted_devices_frame = ttk.Frame( @@ -350,8 +353,8 @@ class CustomFileDialog(tk.Toplevel): compound="left", command=lambda p=mount_point: self.navigate_to(p), style="Dark.TButton.Borderless") btn.pack(fill="x", pady=1) - ttk.Separator(sidebar_frame, orient='horizontal').grid( - row=3, column=0, sticky='ew', pady=10, padx=20) + tk.Frame(sidebar_frame, height=1, bg=separator_color).grid( + row=3, column=0, sticky="ew", padx=20, pady=15) storage_frame = ttk.Frame(sidebar_frame, style="Sidebar.TFrame") storage_frame.grid(row=4, column=0, sticky="ew", padx=10) @@ -764,21 +767,21 @@ class CustomFileDialog(tk.Toplevel): # Process main device if it has a mountpoint if block_device.get('mountpoint') and \ block_device.get('type') not in ['loop', 'rom'] and \ - block_device.get('mountpoint') != '/': # Exclude root mountpoint itself - + block_device.get('mountpoint') != '/': # Exclude root mountpoint itself + # Exclude non-removable partitions of the root disk if block_device.get('name').startswith(root_disk_name) and not block_device.get('rm', False): - pass # Skip this device + pass # Skip this device else: name = block_device.get('name') mountpoint = block_device.get('mountpoint') label = block_device.get('label') - size = block_device.get('size') + # size = block_device.get('size') removable = block_device.get('rm', False) display_name = label if label else name - if size: - display_name += f" ({size})" + # if size: + # display_name += f" ({size})" devices.append((display_name, mountpoint, removable)) # Process children (partitions) @@ -786,22 +789,23 @@ class CustomFileDialog(tk.Toplevel): for child_device in block_device['children']: if child_device.get('mountpoint') and \ child_device.get('type') not in ['loop', 'rom'] and \ - child_device.get('mountpoint') != '/': # Exclude root mountpoint itself - + child_device.get('mountpoint') != '/': # Exclude root mountpoint itself + # Exclude non-removable partitions of the root disk if block_device.get('name') == root_disk_name and not child_device.get('rm', False): - pass # Skip this partition + pass # Skip this partition else: name = child_device.get('name') mountpoint = child_device.get('mountpoint') label = child_device.get('label') - size = child_device.get('size') + # size = child_device.get('size') removable = child_device.get('rm', False) display_name = label if label else name - if size: - display_name += f" ({size})" - devices.append((display_name, mountpoint, removable)) + # if size: + # display_name += f" ({size})" + devices.append( + (display_name, mountpoint, removable)) except Exception as e: print(f"Error getting mounted devices: {e}") diff --git a/mainwindow.py b/mainwindow.py index 0610908..1bd756d 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -58,7 +58,7 @@ if __name__ == "__main__": style = ttk.Style(root) root.tk.call('source', f"{theme_path}/water.tcl") try: - root.tk.call('set_theme', 'light') + root.tk.call('set_theme', 'dark') except tk.TclError: pass root.mainloop()