From 1367daf1b7e92aa2f8677420cc4dea9f6e291e2e Mon Sep 17 00:00:00 2001 From: DLmaster Date: Fri, 21 Feb 2025 15:54:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E6=B7=BB=E5=8A=A0=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E4=B8=B4=E6=97=B6=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ui/history.py | 5 +--- app/ui/home.py | 52 ++++++++++++++++++++++++++++++++++++++++ app/ui/main_window.py | 25 +++++++++++++------ app/ui/member_manager.py | 5 +--- app/ui/queue_manager.py | 5 +--- app/ui/setting.py | 5 +--- main.py | 1 + resources/version.json | 4 ++-- 8 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 app/ui/home.py diff --git a/app/ui/history.py b/app/ui/history.py index f4d7bf3..6ed57b3 100644 --- a/app/ui/history.py +++ b/app/ui/history.py @@ -52,10 +52,7 @@ from .Widget import StatefulItemCard, QuantifiedItemCard class History(QWidget): - def __init__( - self, - parent=None, - ): + def __init__(self, parent=None): super().__init__(parent) self.setObjectName("历史记录") diff --git a/app/ui/home.py b/app/ui/home.py new file mode 100644 index 0000000..7e17c8a --- /dev/null +++ b/app/ui/home.py @@ -0,0 +1,52 @@ +# +# Copyright © <2024> + +# This file is part of AUTO_MAA. + +# AUTO_MAA is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. + +# AUTO_MAA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with AUTO_MAA. If not, see . + +# DLmaster_361@163.com + +""" +AUTO_MAA +AUTO_MAA主界面 +v4.2 +作者:DLmaster_361 +""" + +from loguru import logger +from PySide6.QtWidgets import ( + QFrame, + QVBoxLayout, +) +from qfluentwidgets import TitleLabel +from qframelesswindow.webengine import FramelessWebEngineView +from PySide6.QtCore import QUrl + + +class Home(QFrame): + + def __init__(self, parent=None): + super().__init__(parent=parent) + self.setObjectName("主界面") + + # self.webView = FramelessWebEngineView(self) + # self.webView.load(QUrl("https://github.com/DLmaster361/AUTO_MAA")) + self.Lable = TitleLabel(" 正在施工中~") + + self.vBoxLayout = QVBoxLayout(self) + self.vBoxLayout.setContentsMargins(0, 0, 0, 0) + # self.vBoxLayout.addWidget(self.webView) + self.vBoxLayout.addWidget(self.Lable) + self.vBoxLayout.addStretch(1) diff --git a/app/ui/main_window.py b/app/ui/main_window.py index a367f43..080176b 100644 --- a/app/ui/main_window.py +++ b/app/ui/main_window.py @@ -51,11 +51,12 @@ import shutil from app.core import Config, TaskManager, MainTimer, MainInfoBar from app.services import Notify, Crypto, System -from .setting import Setting +from .home import Home from .member_manager import MemberManager from .queue_manager import QueueManager from .dispatch_center import DispatchCenter from .history import History +from .setting import Setting class AUTO_MAA(MSFluentWindow): @@ -75,18 +76,19 @@ class AUTO_MAA(MSFluentWindow): System.main_window = self.window() # 创建主窗口 - self.setting = Setting(self) + self.home = Home(self) self.member_manager = MemberManager(self) self.queue_manager = QueueManager(self) self.dispatch_center = DispatchCenter(self) self.history = History(self) + self.setting = Setting(self) self.addSubInterface( - self.setting, - FluentIcon.SETTING, - "设置", - FluentIcon.SETTING, - NavigationItemPosition.BOTTOM, + self.home, + FluentIcon.HOME, + "主页", + FluentIcon.HOME, + NavigationItemPosition.TOP, ) self.addSubInterface( self.member_manager, @@ -116,6 +118,13 @@ class AUTO_MAA(MSFluentWindow): FluentIcon.HISTORY, NavigationItemPosition.BOTTOM, ) + self.addSubInterface( + self.setting, + FluentIcon.SETTING, + "设置", + FluentIcon.SETTING, + NavigationItemPosition.BOTTOM, + ) self.stackedWidget.currentChanged.connect( lambda index: (self.member_manager.refresh() if index == 1 else None) ) @@ -347,6 +356,8 @@ class AUTO_MAA(MSFluentWindow): ) self.window().setGeometry(location[0], location[1], size[0], size[1]) self.window().show() + self.window().raise_() + self.window().activateWindow() if not if_quick: if Config.global_config.get(Config.global_config.ui_maximized): self.window().showMaximized() diff --git a/app/ui/member_manager.py b/app/ui/member_manager.py index a3eab6c..09e8dd1 100644 --- a/app/ui/member_manager.py +++ b/app/ui/member_manager.py @@ -72,10 +72,7 @@ from .Widget import ( class MemberManager(QWidget): - def __init__( - self, - parent=None, - ): + def __init__(self, parent=None): super().__init__(parent) self.setObjectName("脚本管理") diff --git a/app/ui/queue_manager.py b/app/ui/queue_manager.py index 4004220..4e82a93 100644 --- a/app/ui/queue_manager.py +++ b/app/ui/queue_manager.py @@ -60,10 +60,7 @@ from .Widget import ( class QueueManager(QWidget): - def __init__( - self, - parent=None, - ): + def __init__(self, parent=None): super().__init__(parent) self.setObjectName("调度队列") diff --git a/app/ui/setting.py b/app/ui/setting.py index dc8eb4f..c0341b7 100644 --- a/app/ui/setting.py +++ b/app/ui/setting.py @@ -58,10 +58,7 @@ from .Widget import LineEditMessageBox, LineEditSettingCard, PasswordLineEditSet class Setting(QWidget): - def __init__( - self, - parent=None, - ): + def __init__(self, parent=None): super().__init__(parent) self.setObjectName("设置") diff --git a/main.py b/main.py index ddc8e64..badf293 100644 --- a/main.py +++ b/main.py @@ -45,6 +45,7 @@ def main(): window = AUTO_MAA() window.show_ui("显示主窗口") + window.setMicaEffectEnabled(True) window.start_up_task() sys.exit(application.exec()) diff --git a/resources/version.json b/resources/version.json index 167e750..87830a1 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,7 +1,7 @@ { - "main_version": "4.2.4.2", + "main_version": "4.2.4.3", "updater_version": "1.1.2.0", - "announcement": "\n## 新增功能\n- 历史记录统计功能上线\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新", + "announcement": "\n## 新增功能\n- 历史记录统计功能上线\n- 添加软件主页\n## 修复BUG\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新", "proxy_list": [ "", "https://gitproxy.click/",