Feat: Implement user's proposed gui.py changes for improved UI/UX and functionality

This commit is contained in:
Ramforth
2025-11-03 00:24:53 +01:00
parent 710f77f403
commit 4f61d86e2a

17
gui.py
View File

@@ -15,7 +15,8 @@ class VideoConverterGUI:
self.master = master
master.title("Video Converter")
# Set a default size to prevent the narrow window
master.geometry("450x700")
# You can change the "widthxheight" here.
master.geometry("600x750")
# --- Set Dark Mode by Default ---
customtkinter.set_appearance_mode("Dark") # Modes: "System", "Dark", "Light"
@@ -40,11 +41,11 @@ class VideoConverterGUI:
self.toggle_mode() # Ensure initial mode is set based on switch state
# --- Main Widgets ---
self.label = customtkinter.CTkLabel(master, text="Select video file or enter URL:")
self.label = customtkinter.CTkLabel(master, text="Select video file or enter URL:", fg_color="transparent")
self.label.pack(pady=(10, 5)) # (top_padding, bottom_padding)
self.filepath_label = customtkinter.CTkLabel(master, text="No file selected")
# fill="x" makes it expand to show the full path
# Use a fg_color to make the label background visible
self.filepath_label = customtkinter.CTkLabel(master, text="No file selected", fg_color=("gray75", "gray25"))
self.filepath_label.pack(pady=5, padx=20, fill="x")
self.browse_button = customtkinter.CTkButton(master, text="Browse", command=self.browse_file)
@@ -57,27 +58,27 @@ class VideoConverterGUI:
self.url_entry = customtkinter.CTkEntry(master, placeholder_text="https://...")
self.url_entry.pack(pady=5, padx=20, fill="x")
self.quality_label = customtkinter.CTkLabel(master, text="Quality:")
self.quality_label = customtkinter.CTkLabel(master, text="Quality:", fg_color="transparent")
self.quality_label.pack(pady=(15, 5))
self.quality_var = customtkinter.StringVar(master, value="medium")
self.quality_menu = customtkinter.CTkOptionMenu(master, variable=self.quality_var, values=["low", "medium", "high", "archive"])
self.quality_menu.pack(pady=5)
self.cookies_label = customtkinter.CTkLabel(master, text="Cookies from Browser:")
self.cookies_label = customtkinter.CTkLabel(master, text="Cookies from Browser:", fg_color="transparent")
self.cookies_label.pack(pady=(15, 5))
self.cookies_var = customtkinter.StringVar(master, value="none")
self.cookies_menu = customtkinter.CTkOptionMenu(master, variable=self.cookies_var, values=["none", "brave", "chrome", "chromium", "edge", "firefox", "opera", "safari", "vivaldi", "whale"])
self.cookies_menu.pack(pady=5)
self.output_dir_label = customtkinter.CTkLabel(master, text="Output Directory:")
self.output_dir_label = customtkinter.CTkLabel(master, text="Output Directory:", fg_color="transparent")
self.output_dir_label.pack(pady=(15, 5))
self.output_dir_button = customtkinter.CTkButton(master, text="Select Directory", command=self.select_output_dir)
self.output_dir_button.pack(pady=5)
self.output_dir_path_label = customtkinter.CTkLabel(master, text="No directory selected")
self.output_dir_path_label = customtkinter.CTkLabel(master, text="No directory selected", fg_color=("gray75", "gray25"))
self.output_dir_path_label.pack(pady=5, padx=20, fill="x")
self.convert_button = customtkinter.CTkButton(master, text="Convert", command=self.convert)