From 45fd15c65f3e790cb70a811d5779e509f31deccc Mon Sep 17 00:00:00 2001 From: Rex Date: Wed, 10 Dec 2025 09:50:47 -0800 Subject: [PATCH] Redesign UI with modern dark theme and improved UX - Implement modern dark color scheme (Tokyo Night inspired) - Add custom styled widgets: ModernButton, ModernSpinbox, CardFrame - Create compact, no-scroll layout for all controls - Add labeled time inputs (Hours, Min, Sec, Ms) for clarity - Make preset buttons additive (adjust values instead of replacing) - Add syntax highlighting for timestamps in preview - Add line numbers to preview panel - Include status bar with keyboard shortcut hints - Add tooltips to all buttons - Improve sync dialog with proper sizing and "Calculate" button - Add keyboard shortcuts (Cmd+O, Cmd+S, Cmd+Shift+A) - Show subtitle count in status bar after file load - Add Reset button to restore original content before saving --- subtitle_sync.py | 1198 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 984 insertions(+), 214 deletions(-) diff --git a/subtitle_sync.py b/subtitle_sync.py index ad9dec8..abad8da 100644 --- a/subtitle_sync.py +++ b/subtitle_sync.py @@ -5,155 +5,822 @@ import os +# ============================================================================ +# MODERN COLOR SCHEME +# ============================================================================ +class Colors: + """Modern dark theme color palette""" + # Background colors + BG_DARK = "#1a1b26" # Main background + BG_MEDIUM = "#24283b" # Panel background + BG_LIGHT = "#2f3549" # Input/card background + BG_HOVER = "#3d4259" # Hover state + + # Accent colors + ACCENT_PRIMARY = "#7aa2f7" # Primary blue + ACCENT_SUCCESS = "#9ece6a" # Green for success + ACCENT_WARNING = "#e0af68" # Orange/yellow for warnings + ACCENT_ERROR = "#f7768e" # Red for errors + ACCENT_PURPLE = "#bb9af7" # Purple accent + + # Text colors + TEXT_PRIMARY = "#c0caf5" # Main text + TEXT_SECONDARY = "#565f89" # Muted text + TEXT_BRIGHT = "#ffffff" # Bright text + + # Border colors + BORDER = "#3d4259" + BORDER_FOCUS = "#7aa2f7" + + # Timestamp highlighting + TIMESTAMP_BG = "#2d3250" + TIMESTAMP_FG = "#7dcfff" + + +# ============================================================================ +# CUSTOM TOOLTIP CLASS +# ============================================================================ +class Tooltip: + """Modern tooltip implementation""" + def __init__(self, widget, text, delay=500): + self.widget = widget + self.text = text + self.delay = delay + self.tooltip_window = None + self.scheduled_id = None + + widget.bind('', self.schedule_show) + widget.bind('', self.hide) + widget.bind('