forked from Hahn-Schickard/AutoFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoFlow.py
53 lines (43 loc) · 1.89 KB
/
AutoFlow.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
47
48
49
50
51
52
53
'''Copyright [2022] Hahn-Schickard-Gesellschaft fuer angewandte Forschung e.V.,
Daniel Konegen + Marcus Rueb
SPDX-License-Identifier: GPL-3.0
============================================================================'''
"""This is the start file to run the AutoFlow GUI
In this file we import the libarys and define the GUI with all the layouts.
Typical usage example:
python AutoFlow.py
"""
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from src.gui_event import MainWindow
app = QApplication(sys.argv)
# Force the style to be the same on all OSs:
app.setStyle("Fusion")
# Now use a palette to switch to dark colors:
palette = QPalette()
palette.setColor(QPalette.Window, QColor(53, 53, 53))
palette.setColor(QPalette.WindowText, Qt.white)
palette.setColor(QPalette.Base, QColor(25, 25, 25))
palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))
palette.setColor(QPalette.ToolTipBase, Qt.white)
palette.setColor(QPalette.ToolTipText, Qt.white)
palette.setColor(QPalette.Text, Qt.white)
palette.setColor(QPalette.Button, QColor(53, 53, 53))
palette.setColor(QPalette.ButtonText, Qt.white)
palette.setColor(QPalette.BrightText, Qt.red)
palette.setColor(QPalette.Link, QColor(42, 130, 218))
palette.setColor(QPalette.Highlight, QColor(42, 130, 218))
palette.setColor(QPalette.HighlightedText, Qt.black)
app.setPalette(palette)
app.setStyleSheet("QPushButton:pressed { background-color: rgb(10, 100, 200) }"
"QPushButton:checked { background-color: rgb(10, 100, 200) }"
"QPushButton::hover { background-color : rgb(10, 100, 200)} ")
screen_width = app.primaryScreen().size().width()
screen_height = app.primaryScreen().size().height()
print("screen_width:{}; screen_height:{}".format(screen_width, screen_height))
w = MainWindow(screen_width, screen_height)
w.show()
w.setFixedSize(w.size())
sys.exit(app.exec_())