Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): use consistent dark mode colors for all systems #752

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
from PySide6.QtCore import QObject, QSettings, Qt, QThread, QThreadPool, QTimer, Signal
from PySide6.QtGui import (
QAction,
QColor,
QDragEnterEvent,
QDragMoveEvent,
QDropEvent,
QFontDatabase,
QGuiApplication,
QIcon,
QMouseEvent,
QPalette,
)
from PySide6.QtUiTools import QUiLoader
from PySide6.QtWidgets import (
Expand Down Expand Up @@ -244,6 +246,18 @@ def start(self) -> None:
app.setStyle("Fusion")
icon_path = Path(__file__).parents[2] / "resources/icon.png"

if QGuiApplication.styleHints().colorScheme() is Qt.ColorScheme.Dark:
pal: QPalette = app.palette()
pal.setColor(QPalette.ColorGroup.Normal, QPalette.ColorRole.Window, QColor("#1e1e1e"))
pal.setColor(QPalette.ColorGroup.Normal, QPalette.ColorRole.Button, QColor("#1e1e1e"))
pal.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Window, QColor("#232323"))
pal.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Button, QColor("#232323"))
pal.setColor(
QPalette.ColorGroup.Inactive, QPalette.ColorRole.ButtonText, QColor("#666666")
)

app.setPalette(pal)

# Handle OS signals
self.setup_signals()
# allow to process input from console, eg. SIGTERM
Expand Down