From 38489191f561ca5e37db3145134b6581a7e8bf15 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Sat, 30 May 2026 21:11:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(gui):=20=E5=B0=86=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E8=87=B3=20.ui=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ThemeComboBox 移入 ALEttingsWidget.ui,由 setupUi 创建 - QssPathEdit/ApplyQssButton 的隐藏改为 .ui 的 visible=false - BrowseQssButton/ResetQssButton/CustomQssHintLabel 文本直接在 .ui 中定义 - ALSettingsWidget.modifyUi 移除冗余的程序化 UI 修改 - 移除 ThemeStatusLabel 别名,直接使用 QssStatusLabel --- src/gui/ALSettingsWidget.py | 14 ++--------- src/gui/resources/ui/ALSettingsWidget.ui | 30 ++++++++++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gui/ALSettingsWidget.py b/src/gui/ALSettingsWidget.py index 44b58a6..bf4e9ef 100644 --- a/src/gui/ALSettingsWidget.py +++ b/src/gui/ALSettingsWidget.py @@ -24,7 +24,6 @@ from PySide6.QtGui import ( ) from PySide6.QtWidgets import ( QApplication, - QComboBox, QFileDialog, QMessageBox, QStyleFactory, @@ -143,15 +142,6 @@ class ALSettingsWidget(QWidget, Ui_ALSettingsWidget): self.NavigationList.setCurrentRow(0) self.populateStyles() self.setNavigationIcons() - self.QssPathEdit.hide() - self.ApplyQssButton.hide() - self.ResetQssButton.setText("重置主题") - self.CustomQssHintLabel.setText("选择一个主题,或导入新的主题文件:") - self.ThemeComboBox = QComboBox(self.CustomQssGroupBox) - self.ThemeComboBox.setObjectName("ThemeComboBox") - self.ThemeComboBox.setMinimumSize(160, 25) - self.QssPathLayout.insertWidget(0, self.ThemeComboBox) - self.ThemeStatusLabel = self.QssStatusLabel def setNavigationIcons( self @@ -247,9 +237,9 @@ class ALSettingsWidget(QWidget, Ui_ALSettingsWidget): name = self.ThemeComboBox.currentText() if name: - self.ThemeStatusLabel.setText(f"已加载主题:{name}") + self.QssStatusLabel.setText(f"已加载主题:{name}") else: - self.ThemeStatusLabel.setText("当前使用程序默认外观。") + self.QssStatusLabel.setText("当前使用程序默认外观。") def collectSettings( self diff --git a/src/gui/resources/ui/ALSettingsWidget.ui b/src/gui/resources/ui/ALSettingsWidget.ui index 7db0631..78ddea1 100644 --- a/src/gui/resources/ui/ALSettingsWidget.ui +++ b/src/gui/resources/ui/ALSettingsWidget.ui @@ -259,7 +259,7 @@ - 自定义程序外观,文件加载后将立即生效。 + 选择一个主题,或导入新的主题文件: true @@ -271,8 +271,21 @@ 5 + + + + + 160 + 25 + + + + + + false + 0 @@ -288,18 +301,12 @@ - 25 - 25 - - - - - 25 + 60 25 - ... + 导入 @@ -312,6 +319,9 @@ + + false + 80 @@ -332,7 +342,7 @@ - 重置外观 + 重置主题