-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
53 lines (43 loc) · 1.79 KB
/
Copy pathapp.py
File metadata and controls
53 lines (43 loc) · 1.79 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import sys
import os
if os.environ.get("XDG_SESSION_TYPE") == "wayland" \
and not os.environ.get("QT_QPA_PLATFORM"):
os.environ["QT_QPA_PLATFORM"] = "xcb"
from PyQt5.QtWidgets import QApplication # noqa: E402
from PyQt5.QtGui import QIcon, QPalette, QColor
from PyQt5.QtCore import QSettings
from SRM_core.utils import resource_path
from SRM_gui.main_window import MainWindow
def make_dark_palette():
p = QPalette()
p.setColor(QPalette.Window, QColor("#2b2b2b"))
p.setColor(QPalette.WindowText, QColor("#e0e0e0"))
p.setColor(QPalette.Base, QColor("#1e1e1e"))
p.setColor(QPalette.AlternateBase, QColor("#323232"))
p.setColor(QPalette.ToolTipBase, QColor("#3c3c3c"))
p.setColor(QPalette.ToolTipText, QColor("#e0e0e0"))
p.setColor(QPalette.Text, QColor("#e0e0e0"))
p.setColor(QPalette.Button, QColor("#3c3c3c"))
p.setColor(QPalette.ButtonText, QColor("#e0e0e0"))
p.setColor(QPalette.BrightText, QColor("#ff4444"))
p.setColor(QPalette.Link, QColor("#56a8f5"))
p.setColor(QPalette.Highlight, QColor("#2979ff"))
p.setColor(QPalette.HighlightedText, QColor("#ffffff"))
p.setColor(QPalette.Disabled, QPalette.Text, QColor("#777777"))
p.setColor(QPalette.Disabled, QPalette.ButtonText, QColor("#777777"))
return p
def main():
app = QApplication(sys.argv)
app.setStyle('Fusion')
app.setDesktopFileName("SRM")
icon = QIcon(resource_path(os.path.join('resources', 'icon.ico')))
icon.addFile(resource_path(os.path.join('resources', 'icon.png')))
app.setWindowIcon(icon)
settings = QSettings("SRM", "StationResponseManager")
if settings.value("theme", "light") == "dark":
app.setPalette(make_dark_palette())
window = MainWindow()
window.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()