35 lines
890 B
Python
35 lines
890 B
Python
|
import sys
|
||
|
from PyQt5.QtWidgets import QApplication
|
||
|
from qfluentwidgets import FluentWindow, Theme, setTheme
|
||
|
from interface.main import MainWidget
|
||
|
from qfluentwidgets import FluentIcon as FIF
|
||
|
|
||
|
class MainWindow(FluentWindow):
|
||
|
def __init__(self):
|
||
|
super().__init__()
|
||
|
self.setWindowTitle("HoYoCenter")
|
||
|
setTheme(Theme.DARK)
|
||
|
self.id2obj = {"main": MainWidget()}
|
||
|
self.init_ui()
|
||
|
|
||
|
def init_ui(self):
|
||
|
self.init_menu()
|
||
|
|
||
|
def init_menu(self):
|
||
|
self.navigationInterface.setExpandWidth(150)
|
||
|
for name, obj in self.id2obj.items():
|
||
|
obj.setObjectName(name)
|
||
|
self.addSubInterface(obj, FIF.HOME, name)
|
||
|
|
||
|
def create_app():
|
||
|
app = QApplication(sys.argv)
|
||
|
window = MainWindow()
|
||
|
window.show()
|
||
|
return app
|
||
|
|
||
|
def main():
|
||
|
app = create_app()
|
||
|
sys.exit(app.exec_())
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|