fix(ui): 对win10主题进一步适配

This commit is contained in:
DLmaster
2025-04-09 11:22:50 +08:00
parent bbeab360bc
commit d7e502e22f
3 changed files with 23 additions and 72 deletions

48
.gitignore vendored
View File

@@ -1,48 +0,0 @@
.idea/AUTO_MAA.iml
.idea/inspectionProfiles/profiles_settings.xml
.idea/misc.xml
.idea/vcs.xml
.idea/modules.xml
.idea/workspace.xml
app/__pycache__/__init__.cpython-312.pyc
app/core/__pycache__/__init__.cpython-312.pyc
app/core/__pycache__/main_info_bar.cpython-312.pyc
app/core/__pycache__/config.cpython-312.pyc
app/core/__pycache__/task_manager.cpython-312.pyc
app/core/__pycache__/timer.cpython-312.pyc
app/models/__pycache__/__init__.cpython-312.pyc
testPython/.idea/workspace.xml
testPython/.idea/testPython.iml
testPython/.idea/vcs.xml
testPython/.idea/misc.xml
testPython/.idea/modules.xml
testPython/.idea/inspectionProfiles/profiles_settings.xml
debug/AUTO_MAA.log
data/key/verifysalt.txt
resources/notice.json
data/key/private_key.bin
data/key/public_key.pem
data/key/PASSWORDsalt.txt
data/key/AES_password_verify.bin
data/gameid.txt
data/data.db
config/QueueConfig/调度队列_1.json
config/MaaConfig/脚本_1/user_data.db
config/MaaConfig/脚本_1/config.json
config/config.json
app/utils/__pycache__/downloader.cpython-312.pyc
app/utils/__pycache__/__init__.cpython-312.pyc
app/ui/__pycache__/Widget.cpython-312.pyc
app/ui/__pycache__/setting.cpython-312.pyc
app/ui/__pycache__/queue_manager.cpython-312.pyc
app/ui/__pycache__/member_manager.cpython-312.pyc
app/ui/__pycache__/main_window.cpython-312.pyc
app/ui/__pycache__/history.cpython-312.pyc
app/ui/__pycache__/home.cpython-312.pyc
app/ui/__pycache__/__init__.cpython-312.pyc
app/services/__pycache__/system.cpython-312.pyc
app/services/__pycache__/security.cpython-312.pyc
app/services/__pycache__/notification.cpython-312.pyc
app/services/__pycache__/__init__.cpython-312.pyc
app/models/__pycache__/MAA.cpython-312.pyc
app/ui/__pycache__/dispatch_center.cpython-312.pyc

View File

@@ -42,7 +42,7 @@ from qfluentwidgets import (
MSFluentWindow,
NavigationItemPosition,
qconfig,
FluentBackgroundTheme
FluentBackgroundTheme,
)
from PySide6.QtGui import QIcon, QCloseEvent
from PySide6.QtCore import Qt, QTimer
@@ -70,13 +70,7 @@ class AUTO_MAA(MSFluentWindow):
self.setWindowTitle("AUTO_MAA")
setTheme(Theme.AUTO, lazy=True)
if isDarkTheme():
self.setStyleSheet("""
CardWidget {background-color: #313131;}
FluentBackgroundTheme {background-color: #313131;}
""")
else:
self.setStyleSheet("""background-color: #ffffff;""")
self.switch_theme()
self.splashScreen = SplashScreen(self.windowIcon(), self)
self.show_ui("显示主窗口", if_quick=True)
@@ -215,30 +209,32 @@ class AUTO_MAA(MSFluentWindow):
self.themeListener.systemThemeChanged.connect(self.switch_theme)
self.themeListener.start()
def switch_theme(self):
#切换主题
def switch_theme(self) -> None:
"""切换主题"""
setTheme(Theme.AUTO, lazy=True)
QTimer.singleShot(300, lambda: setTheme(Theme.AUTO, lazy=True))
# 云母特效不兼容Win10,如果True则通过云母进行主题转换,False则根据当前主题设置背景颜色
# 云母特效启用时需要增加重试机制
if sys.platform != 'win32' or sys.getwindowsversion().build < 22000:
#根据当前主题设置背景颜色
if isDarkTheme():
self.setStyleSheet("""
CardWidget {background-color: #313131;}
HeaderCardWidget {background-color: #313131;}
background-color: #313131;
""")
else:
self.setStyleSheet("background-color: #ffffff;")
else:
print(sys.platform)
# 云母特效启用时需要增加重试机制
# 云母特效不兼容Win10,如果True则通过云母进行主题转换,False则根据当前主题设置背景颜色
if self.isMicaEffectEnabled():
QTimer.singleShot(
300,
lambda: self.windowEffect.setMicaEffect(self.winId(), isDarkTheme()),
)
else:
# 根据当前主题设置背景颜色
if isDarkTheme():
self.setStyleSheet(
"""
CardWidget {background-color: #313131;}
HeaderCardWidget {background-color: #313131;}
background-color: #313131;
"""
)
else:
self.setStyleSheet("background-color: #ffffff;")
def start_up_task(self) -> None:
"""启动时任务"""

View File

@@ -4,6 +4,9 @@
"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.2.5.8":{
"修复BUG": [
"对win10主题进一步适配"
],
"程序优化": [
"loguru开始捕获子线程异常",
"通知服务添加校验项"