fix(ui): 修复软件窗口相关问题

- 修复软件窗口最大化异常问题
- 修复异常操作导致窗口离开屏幕后难以复原的问题
- 修正剩余理智关卡文案
- 主窗口显示版本号
This commit is contained in:
DLmaster361
2025-05-04 03:14:14 +08:00
parent 989ee73549
commit 17ec962a22
5 changed files with 79 additions and 32 deletions

View File

@@ -614,7 +614,7 @@ class MaaUserConfig(QConfig):
class AppConfig(GlobalConfig):
VERSION = "4.3.6.1"
VERSION = "4.3.6.2"
gameid_refreshed = Signal()
PASSWORD_refreshed = Signal()

View File

@@ -26,7 +26,7 @@ v4.3
"""
from loguru import logger
from PySide6.QtWidgets import QSystemTrayIcon
from PySide6.QtWidgets import QApplication, QSystemTrayIcon
from qfluentwidgets import (
qconfig,
Action,
@@ -62,7 +62,15 @@ class AUTO_MAA(MSFluentWindow):
super().__init__()
self.setWindowIcon(QIcon(str(Config.app_path / "resources/icons/AUTO_MAA.ico")))
self.setWindowTitle("AUTO_MAA")
version_numb = list(map(int, Config.VERSION.split(".")))
version_text = (
f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
if version_numb[3] == 0
else f"v{'.'.join(str(_) for _ in version_numb[0:3])}-beta.{version_numb[3]}"
)
self.setWindowTitle(f"AUTO_MAA - {version_text}")
self.switch_theme()
@@ -180,6 +188,8 @@ class AUTO_MAA(MSFluentWindow):
self.tray.setContextMenu(self.tray_menu)
self.tray.activated.connect(self.on_tray_activated)
self.set_min_method()
Config.user_info_changed.connect(self.member_manager.refresh_dashboard)
TaskManager.create_gui.connect(self.dispatch_center.add_board)
TaskManager.connect_gui.connect(self.dispatch_center.connect_main_board)
@@ -347,27 +357,37 @@ class AUTO_MAA(MSFluentWindow):
if mode == "显示主窗口":
# 配置主窗口
size = list(
map(
int,
Config.get(Config.ui_size).split("x"),
if not self.window().isVisible():
size = list(
map(
int,
Config.get(Config.ui_size).split("x"),
)
)
)
location = list(
map(
int,
Config.get(Config.ui_location).split("x"),
location = list(
map(
int,
Config.get(Config.ui_location).split("x"),
)
)
)
self.window().setGeometry(location[0], location[1], size[0], size[1])
self.window().show()
if self.window().isMaximized():
self.window().showNormal()
self.window().setGeometry(location[0], location[1], size[0], size[1])
self.window().show()
if not if_quick:
if Config.get(Config.ui_maximized):
self.titleBar.maxBtn.click()
self.show_ui("配置托盘")
if not any(
self.window().geometry().intersects(screen.availableGeometry())
for screen in QApplication.screens()
):
self.window().showNormal()
self.window().setGeometry(100, 100, 1200, 700)
self.window().raise_()
self.window().activateWindow()
if not if_quick:
if Config.get(Config.ui_maximized):
self.window().showMaximized()
self.set_min_method()
self.show_ui("配置托盘")
elif mode == "配置托盘":
@@ -389,6 +409,7 @@ class AUTO_MAA(MSFluentWindow):
Config.ui_location,
f"{self.geometry().x()}x{self.geometry().y()}",
)
Config.set(Config.ui_maximized, self.window().isMaximized())
Config.save()

View File

@@ -1207,14 +1207,24 @@ class MemberManager(QWidget):
int(name[3:]) - 1,
9,
QTableWidgetItem(
Config.gameid_dict["ALL"]["text"][
Config.gameid_dict["ALL"]["value"].index(
config.get(config.Info_GameId_Remain)
"不使用"
if config.get(config.Info_GameId_Remain) == "-"
else (
(
Config.gameid_dict["ALL"]["text"][
Config.gameid_dict["ALL"][
"value"
].index(
config.get(
config.Info_GameId_Remain
)
)
]
)
]
if config.get(config.Info_GameId_Remain)
in Config.gameid_dict["ALL"]["value"]
else config.get(config.Info_GameId_Remain)
if config.get(config.Info_GameId_Remain)
in Config.gameid_dict["ALL"]["value"]
else config.get(config.Info_GameId_Remain)
)
),
)
self.dashboard.setCellWidget(
@@ -1403,7 +1413,10 @@ class MemberManager(QWidget):
title="剩余理智关卡",
content="按下回车以添加自定义关卡号",
value=Config.gameid_dict["ALL"]["value"],
texts=Config.gameid_dict["ALL"]["text"],
texts=[
"不使用" if _ == "当前/上次" else _
for _ in Config.gameid_dict["ALL"]["text"]
],
qconfig=self.config,
configItem=self.config.Info_GameId_Remain,
parent=self,
@@ -1513,7 +1526,10 @@ class MemberManager(QWidget):
)
self.card_GameId_Remain.reLoadOptions(
Config.gameid_dict["ALL"]["value"],
Config.gameid_dict["ALL"]["text"],
[
"不使用" if _ == "当前/上次" else _
for _ in Config.gameid_dict["ALL"]["text"]
],
)
def refresh_password(self):

View File

@@ -998,9 +998,9 @@ class OtherSettingCard(HeaderCardWidget):
)
self.card_UserDocs = HyperlinkCard(
url="https://clozya.github.io/AUTOMAA_docs",
text="访问",
text="查看指南",
icon=FluentIcon.PAGE_RIGHT,
title="AUTO_MAA官方文档站",
title="用户指南",
content="访问AUTO_MAA的官方文档站获取使用指南和项目相关信息",
parent=self,
)

View File

@@ -1,8 +1,18 @@
{
"main_version": "4.3.6.1",
"main_version": "4.3.6.2",
"updater_version": "1.0.0.0",
"announcement": "\n## 新增功能\n- 屏蔽MuMu模拟器开屏广告功能上线\n- 更新器支持多线程下载\n- 添加强制关闭ADB与模拟器等增强任务项\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n- 修复密码显示按钮动画异常\n- 修复`检测到MAA未能实际执行任务`报错被异常屏蔽\n- 修复MAA超时判定异常失效\n## 程序优化\n- 关机等电源操作添加100s倒计时\n- 人工排查弹窗方法优化\n- 人工排查时自动屏蔽静默操作\n- 公告样式优化",
"version_info": {
"4.3.6.2": {
"修复BUG": [
"修复软件窗口最大化异常问题",
"修复异常操作导致窗口离开屏幕后难以复原的问题",
"修正剩余理智关卡文案"
],
"程序优化": [
"主窗口显示版本号"
]
},
"4.3.6.1": {
"新增功能": [
"单次自动代理任务中,已完成的子任务在重复执行时不再启用"