-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
78 lines (69 loc) · 2.76 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import PyQt5
from src.StarDelegate import *
# from PySide2.QtCore import *
# from PySide2 import QtGui
# from PySide2.QtGui import QColor
from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import *
from src.driverUi.callMainWindow import MainWindow
# ADDED KEYPRESS EATER TAB BAR
# self.tabBar = QtWidgets.QTabBar()
# self.tabWidget.setTabBar(self.tabBar)
from dotenv import load_dotenv
from pathlib import Path
import os
load_dotenv(dotenv_path=Path('./development.env'))
def setDarkStyleSheet(qApp: QApplication):
qApp.setStyle(QStyleFactory.create("Fusion"))
darkPalette = QtGui.QPalette()
darkPalette.setColor(QtGui.QPalette.Window, QtGui.QColor(53, 53, 53))
darkPalette.setColor(QtGui.QPalette.WindowText, Qt.white)
darkPalette.setColor(QtGui.QPalette.Base, QtGui.QColor(25, 25, 25))
darkPalette.setColor(QtGui.QPalette.AlternateBase, QtGui.QColor(53, 53, 53))
darkPalette.setColor(QtGui.QPalette.ToolTipBase, Qt.white)
darkPalette.setColor(QtGui.QPalette.ToolTipText, Qt.white)
darkPalette.setColor(QtGui.QPalette.Text, Qt.white)
darkPalette.setColor(QtGui.QPalette.Button, QtGui.QColor(53, 53, 53))
darkPalette.setColor(QtGui.QPalette.ButtonText, Qt.white)
darkPalette.setColor(QtGui.QPalette.BrightText, Qt.red)
darkPalette.setColor(QtGui.QPalette.Link, QtGui.QColor(42, 130, 218))
darkPalette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(42, 130, 218))
darkPalette.setColor(QtGui.QPalette.HighlightedText, Qt.black)
qApp.setPalette(darkPalette)
qApp.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }")
if __name__ == "__main__":
app = QApplication(sys.argv)
setDarkStyleSheet(app)
# view = QQuickView()
# url = QUrl("../ui/view.qml")
# view.setSource(url)
# view.show()
DB_PATH = os.getenv("DB_PATH")
win = MainWindow(DB_PATH)
#win.show()
#win.loadDeckList()
# view = QQuickView()
# container = Q Widget.createWindowContainer(view, win)
# view.setSource(QUrl("../ui/view.qml"))
# view.setClearBeforeRendering(True)
# container.setMinimumHeight(430)
# container.setMinimumWidth(800)
# container.setAutoFillBackground(True)
clear = QColor(67,67,0)
clear.setAlpha(0)
# view.setColor(clear)
geom = QRect(60, 80, 880, 880)
win.ui.horizontalLayout_2.setGeometry(geom)
# win.ui.horizontalLayout_2.addWidget(container, alignment=Qt.AlignCenter)
# print(view.Ready)
# print(view.errors())
# view.raise_()
# view.show()
#win.reloadTableList()
# win.nameOfCurrentTable = win.ui.deckList.item(0).test_data(0)
# print(win.nameOfCurrentTable)
# win.loadWordTable(0)
#win.database.closeDatabase()
sys.exit(app.exec_())