1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-08-02 06:09:36 +08:00

feat(gui): 引入全局设置窗口 ALSettingsWidget

- 新增 ALSettingsWidget,左侧导航+右侧内容的设置面板
- 合并外观主题、界面风格、自定义QSS为单页布局
- 深浅色主题通过 Qt.ColorScheme 官方 API 实现
- 界面风格变更检测基于当前运行的 QStyle 比对
- 使用 qtawesome 提供矢量导航图标
- 风格变更时弹出重启确认对话框
- ALAutoScriptEditDialog 中重置/复制按钮改用 qtawesome 图标
- 外观初始化迁移至 boot.AppInitializer
- 菜单栏新增工具→全局设置入口
- GLOBAL 配置扩展 appearance 段(theme/style/custom_qss)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 17:56:21 +08:00
parent c337904010
commit 05b93799d4
10 changed files with 906 additions and 9 deletions
+18 -2
View File
@@ -10,10 +10,13 @@ See the LICENSE file for details.
import os
from PySide6.QtCore import QStandardPaths, QDir
from PySide6.QtWidgets import QApplication
from managers.log.LogManager import instance as logInstance
from gui.ALSettingsWidget import _applyTheme
from interfaces.ConfigProvider import CfgKey
from managers.config.ConfigManager import instance as configInstance
from managers.driver.WebDriverManager import instance as webdriverInstance
from managers.log.LogManager import instance as logInstance
def _initializeLogManager(
@@ -64,13 +67,25 @@ def _initializeWebDriverManager(
webdriverInstance(driver_dir)
return True
def _initializeAppearance(
):
app = QApplication.instance()
if not app:
return
cfg = configInstance()
saved_style = cfg.get(CfgKey.GLOBAL.APPEARANCE.STYLE, "Fusion")
saved_theme = cfg.get(CfgKey.GLOBAL.APPEARANCE.THEME, "system")
app.setStyle(saved_style)
_applyTheme(saved_theme)
def initializeApp(
) -> bool:
"""
Initialize the application components
Order:
LogManager -> ConfigManager -> WebDriverManager
LogManager -> ConfigManager -> WebDriverManager -> Appearance
"""
if not _initializeLogManager():
@@ -79,4 +94,5 @@ def initializeApp(
return False
if not _initializeWebDriverManager():
return False
_initializeAppearance()
return True