mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Adding support for dark themed OSes (#926)
This commit is contained in:
parent
cf9033497d
commit
6bd3e672fd
3 changed files with 33 additions and 1 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import sys
|
||||
import darkdetect
|
||||
|
||||
from PyQt6.QtGui import QFont
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
from PyQt6.QtGui import QPalette, QColor
|
||||
|
||||
from buzz.__version__ import VERSION
|
||||
from buzz.db.dao.transcription_dao import TranscriptionDAO
|
||||
|
|
@ -33,6 +35,21 @@ class Application(QApplication):
|
|||
else:
|
||||
self.setFont(QFont(self.font().family(), font_size))
|
||||
|
||||
if darkdetect.isDark():
|
||||
palette = QPalette()
|
||||
palette.setColor(QPalette.ColorRole.Window, QColor("#121212"))
|
||||
palette.setColor(QPalette.ColorRole.WindowText, QColor("#ffffff"))
|
||||
palette.setColor(QPalette.ColorRole.Base, QColor("#1e1e1e"))
|
||||
palette.setColor(QPalette.ColorRole.AlternateBase, QColor("#2e2e2e"))
|
||||
palette.setColor(QPalette.ColorRole.ToolTipBase, QColor("#ffffff"))
|
||||
palette.setColor(QPalette.ColorRole.ToolTipText, QColor("#000000"))
|
||||
palette.setColor(QPalette.ColorRole.Text, QColor("#ffffff"))
|
||||
palette.setColor(QPalette.ColorRole.Button, QColor("#1e1e1e"))
|
||||
palette.setColor(QPalette.ColorRole.ButtonText, QColor("#ffffff"))
|
||||
palette.setColor(QPalette.ColorRole.BrightText, QColor("#ff0000"))
|
||||
palette.setColor(QPalette.ColorRole.HighlightedText, QColor("#000000"))
|
||||
|
||||
self.setPalette(palette)
|
||||
|
||||
db = setup_app_db()
|
||||
transcription_service = TranscriptionService(
|
||||
|
|
|
|||
16
poetry.lock
generated
16
poetry.lock
generated
|
|
@ -676,6 +676,20 @@ files = [
|
|||
{file = "ctypesgen-1.1.1.tar.gz", hash = "sha256:deaa2d64a95d90196a2e8a689cf9b952be6f3366f81e835245354bf9dbac92f6"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darkdetect"
|
||||
version = "0.8.0"
|
||||
description = "Detect OS Dark Mode from Python"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "darkdetect-0.8.0-py3-none-any.whl", hash = "sha256:a7509ccf517eaad92b31c214f593dbcf138ea8a43b2935406bbd565e15527a85"},
|
||||
{file = "darkdetect-0.8.0.tar.gz", hash = "sha256:b5428e1170263eb5dea44c25dc3895edd75e6f52300986353cd63533fe7df8b1"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
macos-listener = ["pyobjc-framework-Cocoa"]
|
||||
|
||||
[[package]]
|
||||
name = "dataclasses-json"
|
||||
version = "0.6.4"
|
||||
|
|
@ -3516,4 +3530,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.9,<3.13"
|
||||
content-hash = "bb0944efb1fbeca98ac9f3527d4600b8b9554661957acab4f97ffc0759cfc27c"
|
||||
content-hash = "8e4b07997e2b82970dac25e00a7e8f0f1ed1dd041208f49307391987aeff182a"
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ torchaudio = [
|
|||
{version = "2.2.1", source = "pypi", markers = "sys_platform != 'win32' and sys_platform != 'msys'"},
|
||||
{version = "2.2.1+cu121", source = "torch", markers = "sys_platform == 'win32' or sys_platform == 'msys'"},
|
||||
]
|
||||
darkdetect = "^0.8.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
autopep8 = "^1.7.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue