Feat: Implement user's proposed gui.py changes, add footer, and refine theme JSON files
This commit is contained in:
18
gui.py
18
gui.py
@@ -6,6 +6,7 @@ import sys
|
||||
import threading
|
||||
import time
|
||||
import converter
|
||||
import webbrowser
|
||||
import downloader
|
||||
import utils
|
||||
import config
|
||||
@@ -22,6 +23,20 @@ class VideoConverterGUI:
|
||||
customtkinter.set_appearance_mode("Dark") # Modes: "System", "Dark", "Light"
|
||||
customtkinter.set_default_color_theme(os.path.join(os.path.dirname(__file__), "custom_theme_dark.json"))
|
||||
|
||||
# --- Footer Frame ---
|
||||
self.footer_frame = customtkinter.CTkFrame(master, fg_color="transparent")
|
||||
self.footer_frame.pack(side="bottom", fill="x", padx=10, pady=(5, 10))
|
||||
|
||||
self.nickname_label = customtkinter.CTkLabel(self.footer_frame, text="by ramforth")
|
||||
self.nickname_label.pack(side="left", padx=(10, 0))
|
||||
|
||||
self.gitea_link = customtkinter.CTkLabel(self.footer_frame, text="https://gitea.ramforth.net/ramforth", text_color="#4077d1", cursor="hand2")
|
||||
self.gitea_link.pack(side="right", padx=(0, 10))
|
||||
self.gitea_link.bind("<Button-1>", lambda e: self.open_link("https://gitea.ramforth.net/ramforth"))
|
||||
# Add underline font
|
||||
underline_font = customtkinter.CTkFont(family="sans-serif", size=12, underline=True)
|
||||
self.gitea_link.configure(font=underline_font)
|
||||
|
||||
# --- Pack bottom elements first ---
|
||||
# This makes them stick to the bottom
|
||||
self.status_var = customtkinter.StringVar(value="Ready") # Give it a default value
|
||||
@@ -87,6 +102,9 @@ class VideoConverterGUI:
|
||||
self.cancel_button = customtkinter.CTkButton(master, text="Cancel", command=self.cancel_conversion, state="disabled")
|
||||
self.cancel_button.pack(pady=5)
|
||||
|
||||
def open_link(self, url):
|
||||
"""Opens the given URL in a web browser."""
|
||||
webbrowser.open_new(url)
|
||||
|
||||
def toggle_mode(self):
|
||||
# Check if the switch is on (1) or off (0)
|
||||
|
||||
Reference in New Issue
Block a user