diff --git a/vodkeeper.py b/vodkeeper.py index 97c8409..e7ede04 100644 --- a/vodkeeper.py +++ b/vodkeeper.py @@ -1,5 +1,5 @@ import tkinter as tk -from tkinter import ttk, filedialog, messagebox, scrolledtext +from tkinter import ttk, filedialog, messagebox import threading import subprocess import os @@ -114,6 +114,19 @@ class VodKeeper: style.map('Treeview', background=[('selected', self.colors['select_bg'])], foreground=[('selected', self.colors['select_fg'])]) + # Configure Scrollbar + style.configure('Vertical.TScrollbar', background=self.colors['frame_bg'], + troughcolor=self.colors['entry_bg'], borderwidth=1, + arrowcolor=self.colors['fg'], darkcolor=self.colors['frame_bg'], + lightcolor=self.colors['frame_bg']) + style.map('Vertical.TScrollbar', background=[('active', self.colors['select_bg'])]) + + style.configure('Horizontal.TScrollbar', background=self.colors['frame_bg'], + troughcolor=self.colors['entry_bg'], borderwidth=1, + arrowcolor=self.colors['fg'], darkcolor=self.colors['frame_bg'], + lightcolor=self.colors['frame_bg']) + style.map('Horizontal.TScrollbar', background=[('active', self.colors['select_bg'])]) + def setup_ui(self): # Create notebook for tabs self.notebook = ttk.Notebook(self.root) @@ -155,13 +168,24 @@ class VodKeeper: # File list spanning full width ttk.Label(file_frame, text="Available Files:").grid(row=1, column=0, sticky='w', pady=(10,2)) - self.file_listbox = tk.Listbox(file_frame, + # Create frame for listbox with scrollbar + listbox_frame = ttk.Frame(file_frame) + listbox_frame.grid(row=2, column=0, columnspan=3, sticky='nsew', pady=2) + listbox_frame.rowconfigure(0, weight=1) + listbox_frame.columnconfigure(0, weight=1) + + self.file_listbox = tk.Listbox(listbox_frame, bg=self.colors['entry_bg'], fg=self.colors['entry_fg'], selectbackground=self.colors['select_bg'], selectforeground=self.colors['select_fg']) - self.file_listbox.grid(row=2, column=0, columnspan=3, sticky='nsew', pady=2) + self.file_listbox.grid(row=0, column=0, sticky='nsew') self.file_listbox.bind('<>', self.on_file_select) + # Add scrollbar to listbox + listbox_scrollbar = ttk.Scrollbar(listbox_frame, orient='vertical', command=self.file_listbox.yview) + listbox_scrollbar.grid(row=0, column=1, sticky='ns') + self.file_listbox.config(yscrollcommand=listbox_scrollbar.set) + # Refresh button ttk.Button(file_frame, text="Refresh Files", command=self.refresh_files).grid(row=3, column=0, pady=5) @@ -171,11 +195,21 @@ class VodKeeper: info_frame.rowconfigure(0, weight=1) info_frame.columnconfigure(0, weight=1) - self.file_info_text = scrolledtext.ScrolledText(info_frame, - bg=self.colors['text_bg'], fg=self.colors['text_fg'], - insertbackground=self.colors['text_fg']) + # Create Text widget with matching scrollbar style + self.file_info_text = tk.Text(info_frame, + bg=self.colors['text_bg'], fg=self.colors['text_fg'], + insertbackground=self.colors['text_fg'], wrap='word') self.file_info_text.grid(row=0, column=0, sticky='nsew') + # Add matching scrollbar to file info + info_scrollbar = ttk.Scrollbar(info_frame, orient='vertical', command=self.file_info_text.yview) + info_scrollbar.grid(row=0, column=1, sticky='ns') + self.file_info_text.config(yscrollcommand=info_scrollbar.set) + + # Configure the info frame columns + info_frame.columnconfigure(0, weight=1) + info_frame.columnconfigure(1, weight=0) + # Encoding settings settings_frame = ttk.LabelFrame(input_frame, text="Encoding Settings", padding=10) settings_frame.pack(fill='x', padx=10, pady=5) @@ -265,10 +299,21 @@ class VodKeeper: log_frame = ttk.LabelFrame(render_frame, text="FFmpeg Output", padding=10) log_frame.pack(fill='both', expand=True, padx=10, pady=5) - self.log_text = scrolledtext.ScrolledText(log_frame, height=10, - bg=self.colors['text_bg'], fg=self.colors['text_fg'], - insertbackground=self.colors['text_fg']) - self.log_text.pack(fill='both', expand=True) + # Create frame for log text with consistent scrollbar + log_text_frame = ttk.Frame(log_frame) + log_text_frame.pack(fill='both', expand=True) + log_text_frame.rowconfigure(0, weight=1) + log_text_frame.columnconfigure(0, weight=1) + + self.log_text = tk.Text(log_text_frame, + bg=self.colors['text_bg'], fg=self.colors['text_fg'], + insertbackground=self.colors['text_fg'], wrap='word') + self.log_text.grid(row=0, column=0, sticky='nsew') + + # Add matching scrollbar + log_scrollbar = ttk.Scrollbar(log_text_frame, orient='vertical', command=self.log_text.yview) + log_scrollbar.grid(row=0, column=1, sticky='ns') + self.log_text.config(yscrollcommand=log_scrollbar.set) def setup_qc_tab(self): qc_frame = ttk.Frame(self.notebook) @@ -323,10 +368,21 @@ class VodKeeper: results_frame = ttk.LabelFrame(qc_frame, text="QC Results", padding=10) results_frame.pack(fill='x', padx=10, pady=5) - self.qc_results_text = scrolledtext.ScrolledText(results_frame, height=6, - bg=self.colors['text_bg'], fg=self.colors['text_fg'], - insertbackground=self.colors['text_fg']) - self.qc_results_text.pack(fill='both', expand=True) + # Create frame for QC results with consistent scrollbar + qc_text_frame = ttk.Frame(results_frame) + qc_text_frame.pack(fill='both', expand=True) + qc_text_frame.rowconfigure(0, weight=1) + qc_text_frame.columnconfigure(0, weight=1) + + self.qc_results_text = tk.Text(qc_text_frame, + bg=self.colors['text_bg'], fg=self.colors['text_fg'], + insertbackground=self.colors['text_fg'], wrap='word') + self.qc_results_text.grid(row=0, column=0, sticky='nsew') + + # Add matching scrollbar + qc_scrollbar = ttk.Scrollbar(qc_text_frame, orient='vertical', command=self.qc_results_text.yview) + qc_scrollbar.grid(row=0, column=1, sticky='ns') + self.qc_results_text.config(yscrollcommand=qc_scrollbar.set) def browse_input(self): # Use current path if it exists, otherwise use a reasonable default