diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..ee75b64 --- /dev/null +++ b/Pipfile @@ -0,0 +1,13 @@ +[[source]] +url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" +verify_ssl = true +name = "pip_conf_index_global" + +[packages] +pyqt5 = "*" +pyqt-fluent-widgets = {extras = ["full"], version = "*"} + +[dev-packages] + +[requires] +python_version = "3.11" diff --git a/interface/main.py b/interface/main.py new file mode 100644 index 0000000..cba95d2 --- /dev/null +++ b/interface/main.py @@ -0,0 +1,11 @@ +from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLayout, QWidget + +class MainWidget(QWidget): + def __init__(self, title="主页"): + super().__init__() + self.name = "11" + layout = QVBoxLayout() + button = QPushButton(title) + layout.addWidget(button) + self.setLayout(layout) + self.setWindowTitle(title) \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..3400376 --- /dev/null +++ b/main.py @@ -0,0 +1,35 @@ +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() \ No newline at end of file