-
Notifications
You must be signed in to change notification settings - Fork 0
/
dark_style.py
39 lines (34 loc) · 1.58 KB
/
dark_style.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from PyQt5.QtWidgets import QStyleFactory
from PyQt5.QtWidgets import QApplication, QDesktopWidget
from PyQt5 import QtWidgets, Qt
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
def dark_style(app):
# set a dark theme to the app!
app.setStyle('fusion')
dark_palette = QPalette()
dark_palette.setColor(QPalette.Window, QColor(0, 0, 0))
dark_palette.setColor(QPalette.WindowText, Qt.white)
dark_palette.setColor(QPalette.Base, QColor(25, 25, 25))
dark_palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))
dark_palette.setColor(QPalette.ToolTipBase, Qt.white)
dark_palette.setColor(QPalette.ToolTipText, Qt.white)
dark_palette.setColor(QPalette.Text, Qt.white)
dark_palette.setColor(QPalette.Button, QColor(53, 53, 53))
dark_palette.setColor(
QPalette.Disabled, QPalette.Button, QColor(30, 30, 30))
dark_palette.setColor(QPalette.ButtonText, Qt.white)
dark_palette.setColor(
QPalette.Disabled, QPalette.ButtonText, QColor(100, 100, 100))
dark_palette.setColor(QPalette.BrightText, Qt.red)
dark_palette.setColor(QPalette.Link, QColor(42, 130, 218))
dark_palette.setColor(QPalette.Highlight, QColor(42, 130, 218))
dark_palette.setColor(
QPalette.Disabled, QPalette.Highlight, QColor(100, 100, 100))
dark_palette.setColor(QPalette.HighlightedText, Qt.black)
app.setPalette(dark_palette)
app.setStyleSheet(
"QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }")
# end of dark theme