feat: dark/light theme toggle (Catppuccin Frappé ↔ Latte)
- app/config/theme.py: palette definitions for both themes + apply_qss() helper used by both main.py (startup) and MainWindow (live toggle) - resources/style_light.qss: complete Catppuccin Latte QSS - View menu: ☀️/🌙 Switch Theme action (Ctrl+Shift+T) toggles live - Preferences → Appearance: Color theme dropdown persists choice - SQLHighlighter: _build_rules() reads get_palette(); update_theme() rebuilds rules and rehighlights all open editors on switch - SqlCompleter: popup stylesheet reads get_palette() via _apply_popup_style(); update_theme() called on switch - EditableTableModel: dirty/delete cell colors read get_palette() live - ResultTableModel: NULL_COLOR property reads get_palette() live - TableViewer: apply_settings() refreshes frozen-view border + repaints Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,15 +9,13 @@ from PyQt6.QtGui import QFont
|
||||
|
||||
from app.utils.logger import setup_logging, install_qt_message_handler, get_logger
|
||||
from app.main_window import MainWindow
|
||||
from app.config.theme import apply_qss
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
def load_stylesheet(app: QApplication) -> None:
|
||||
style_path = os.path.join(os.path.dirname(__file__), "resources", "style.qss")
|
||||
if os.path.exists(style_path):
|
||||
with open(style_path, "r", encoding="utf-8") as f:
|
||||
app.setStyleSheet(f.read())
|
||||
apply_qss(app) # reads theme from settings, falls back to dark
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user