forked from wonderworks-software/PyFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launcher.py
46 lines (38 loc) · 1.56 KB
/
launcher.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
40
41
42
43
44
45
46
from Qt.QtWidgets import QApplication
from Qt import QtGui
from Qt import QtCore
import sys
import os
from PyFlow.App import PyFlow
FILE_DIR = os.path.abspath(os.path.dirname(__file__))
SETTINGS_PATH = os.path.join(FILE_DIR, "PyFlow", "appConfig.ini")
STYLE_PATH = os.path.join(FILE_DIR, "PyFlow", "style.css")
app = QApplication(sys.argv)
dark_palette = app.palette()
dark_palette.setColor(QtGui.QPalette.Window, QtGui.QColor(53, 53, 53))
dark_palette.setColor(QtGui.QPalette.WindowText, QtCore.Qt.white)
dark_palette.setColor(QtGui.QPalette.Base, QtGui.QColor(25, 25, 25))
dark_palette.setColor(QtGui.QPalette.AlternateBase, QtGui.QColor(53, 53, 53))
dark_palette.setColor(QtGui.QPalette.ToolTipBase, QtCore.Qt.white)
dark_palette.setColor(QtGui.QPalette.ToolTipText, QtCore.Qt.white)
dark_palette.setColor(QtGui.QPalette.Text, QtCore.Qt.black)
dark_palette.setColor(QtGui.QPalette.Button, QtGui.QColor(53, 53, 53))
dark_palette.setColor(QtGui.QPalette.ButtonText, QtCore.Qt.black)
dark_palette.setColor(QtGui.QPalette.BrightText, QtCore.Qt.red)
dark_palette.setColor(QtGui.QPalette.Link, QtGui.QColor(42, 130, 218))
dark_palette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(42, 130, 218))
dark_palette.setColor(QtGui.QPalette.HighlightedText, QtCore.Qt.black)
app.setPalette(dark_palette)
try:
with open(STYLE_PATH, 'r') as f:
styleString = f.read()
app.setStyleSheet(styleString)
except Exception as e:
print(e)
instance = PyFlow.instance()
app.setActiveWindow(instance)
instance.show()
try:
sys.exit(app.exec_())
except Exception as e:
print(e)