mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-21 00:43:03 +08:00
refactor(gui): 自定义主题控件及函数重命名,统一 CustomTheme 前缀
This commit is contained in:
+79
-78
@@ -115,22 +115,23 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
):
|
):
|
||||||
|
|
||||||
self.setWindowFlags(Qt.WindowType.Window)
|
self.setWindowFlags(Qt.WindowType.Window)
|
||||||
self.NavigationList.setCurrentRow(0)
|
|
||||||
self.populateStyles()
|
|
||||||
self.setNavigationIcons()
|
self.setNavigationIcons()
|
||||||
color = QApplication.instance().palette().color(
|
color = QApplication.instance().palette().color(
|
||||||
QApplication.instance().palette().ColorRole.WindowText
|
QApplication.instance().palette().ColorRole.WindowText
|
||||||
).name()
|
).name()
|
||||||
self.BrowseQssButton.setIcon(qta.icon("fa6s.plus", color=color))
|
self.ImportCustomThemeButton.setIcon(qta.icon("fa6s.plus", color=color))
|
||||||
self.BrowseQssButton.setText("")
|
self.ImportCustomThemeButton.setText("")
|
||||||
self.RemoveThemeButton.setIcon(qta.icon("fa6s.minus", color=color))
|
self.RemoveCustomThemeButton.setIcon(qta.icon("fa6s.minus", color=color))
|
||||||
self.RemoveThemeButton.setText("")
|
self.RemoveCustomThemeButton.setText("")
|
||||||
self.ThemeInfoLabel.setTextFormat(Qt.TextFormat.RichText)
|
self.CustomThemeInfoLabel.setTextFormat(Qt.TextFormat.RichText)
|
||||||
self.ThemeInfoLabel.setStyleSheet(
|
self.CustomThemeInfoLabel.setStyleSheet(
|
||||||
"border: 1px solid palette(mid);"\
|
"border: 1px solid palette(mid);"\
|
||||||
"border-radius: 2px;"\
|
"border-radius: 2px;"\
|
||||||
"padding: 5px;"
|
"padding: 5px;"
|
||||||
)
|
)
|
||||||
|
self.NavigationList.setCurrentRow(0)
|
||||||
|
self.populateStyles()
|
||||||
|
self.populateCustomThemes()
|
||||||
|
|
||||||
def setNavigationIcons(
|
def setNavigationIcons(
|
||||||
self
|
self
|
||||||
@@ -149,14 +150,32 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
self.StyleComboBox.clear()
|
self.StyleComboBox.clear()
|
||||||
self.StyleComboBox.addItems(QStyleFactory.keys())
|
self.StyleComboBox.addItems(QStyleFactory.keys())
|
||||||
|
|
||||||
|
def populateCustomThemes(
|
||||||
|
self
|
||||||
|
):
|
||||||
|
|
||||||
|
self.CustomThemeComboBox.blockSignals(True)
|
||||||
|
self.CustomThemeComboBox.clear()
|
||||||
|
self.CustomThemeComboBox.addItem("默认", "")
|
||||||
|
self.__theme_cache = {}
|
||||||
|
themes = themeInstance().listThemes()
|
||||||
|
for t in themes:
|
||||||
|
name = t.get("name", "")
|
||||||
|
file = t.get("file", name)
|
||||||
|
author = t.get("author", "")
|
||||||
|
if name:
|
||||||
|
self.__theme_cache[file] = t
|
||||||
|
self.CustomThemeComboBox.addItem(name, file)
|
||||||
|
self.CustomThemeComboBox.blockSignals(False)
|
||||||
|
|
||||||
def connectSignals(
|
def connectSignals(
|
||||||
self
|
self
|
||||||
):
|
):
|
||||||
|
|
||||||
self.BrowseQssButton.clicked.connect(self.onImportThemeButtonClicked)
|
self.ImportCustomThemeButton.clicked.connect(self.onImportCustomThemeButtonClicked)
|
||||||
self.RemoveThemeButton.clicked.connect(self.onRemoveThemeButtonClicked)
|
self.RemoveCustomThemeButton.clicked.connect(self.onRemoveCustomThemeButtonClicked)
|
||||||
self.ThemeComboBox.currentIndexChanged.connect(self.onThemeComboBoxChanged)
|
self.CustomThemeComboBox.currentIndexChanged.connect(self.onCustomThemeComboBoxChanged)
|
||||||
self.ResetThemeButton.clicked.connect(self.onResetThemeButtonClicked)
|
self.ResetCustomThemeButton.clicked.connect(self.onResetCustomThemeButtonClicked)
|
||||||
self.CancelButton.clicked.connect(self.onCancelButtonClicked)
|
self.CancelButton.clicked.connect(self.onCancelButtonClicked)
|
||||||
self.ApplyButton.clicked.connect(self.onApplyButtonClicked)
|
self.ApplyButton.clicked.connect(self.onApplyButtonClicked)
|
||||||
self.ConfirmButton.clicked.connect(self.onConfirmButtonClicked)
|
self.ConfirmButton.clicked.connect(self.onConfirmButtonClicked)
|
||||||
@@ -181,33 +200,20 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
if index < 0:
|
if index < 0:
|
||||||
index = 0
|
index = 0
|
||||||
self.StyleComboBox.setCurrentIndex(index)
|
self.StyleComboBox.setCurrentIndex(index)
|
||||||
self.populateThemeList()
|
|
||||||
if custom_theme:
|
if custom_theme:
|
||||||
idx = self.ThemeComboBox.findData(custom_theme)
|
idx = self.CustomThemeComboBox.findData(custom_theme)
|
||||||
if idx >= 0:
|
if idx >= 0:
|
||||||
self.ThemeComboBox.setCurrentIndex(idx)
|
self.CustomThemeComboBox.setCurrentIndex(idx)
|
||||||
self.updateThemeStatus()
|
self.updateCustomThemeInfo()
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeStatus()
|
||||||
|
|
||||||
def updateThemeStatus(
|
def updateCustomThemeInfo(
|
||||||
self
|
self
|
||||||
):
|
):
|
||||||
|
|
||||||
file = self.ThemeComboBox.currentData()
|
file = self.CustomThemeComboBox.currentData()
|
||||||
t = self.__theme_cache.get(file) if file else None
|
|
||||||
name = t.get("name", "") if t else ""
|
|
||||||
if name:
|
|
||||||
self.QssStatusLabel.setText(f"当前使用 {name} 主题。")
|
|
||||||
else:
|
|
||||||
self.QssStatusLabel.setText("当前使用 默认 主题。")
|
|
||||||
|
|
||||||
def updateThemeInfo(
|
|
||||||
self
|
|
||||||
):
|
|
||||||
|
|
||||||
file = self.ThemeComboBox.currentData()
|
|
||||||
if not file:
|
if not file:
|
||||||
self.ThemeInfoLabel.setText("")
|
self.CustomThemeInfoLabel.setText("")
|
||||||
return
|
return
|
||||||
t = self.__theme_cache.get(file)
|
t = self.__theme_cache.get(file)
|
||||||
if t:
|
if t:
|
||||||
@@ -215,13 +221,25 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
author = t.get("author", "未知作者")
|
author = t.get("author", "未知作者")
|
||||||
need_theme = t.get("need_theme", "both")
|
need_theme = t.get("need_theme", "both")
|
||||||
brief = t.get("brief", "没有相关简介")
|
brief = t.get("brief", "没有相关简介")
|
||||||
self.ThemeInfoLabel.setText(
|
self.CustomThemeInfoLabel.setText(
|
||||||
f"<b>{name}</b> - 适用于 <i>{_themeToReadable(need_theme)}</i> 主题<br>"
|
f"<b>{name}</b> - 适用于 <i>{_themeToReadable(need_theme)}</i> 主题<br>"
|
||||||
f"作者:{author}<br><br>"
|
f"作者:{author}<br><br>"
|
||||||
f"{brief}"
|
f"{brief}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.ThemeInfoLabel.setText("")
|
self.CustomThemeInfoLabel.setText("")
|
||||||
|
|
||||||
|
def updateCustomThemeStatus(
|
||||||
|
self
|
||||||
|
):
|
||||||
|
|
||||||
|
file = self.CustomThemeComboBox.currentData()
|
||||||
|
t = self.__theme_cache.get(file) if file else None
|
||||||
|
name = t.get("name", "") if t else ""
|
||||||
|
if name:
|
||||||
|
self.CustomThemeStatusLabel.setText(f"当前使用 {name} 主题。")
|
||||||
|
else:
|
||||||
|
self.CustomThemeStatusLabel.setText("当前使用 默认 主题。")
|
||||||
|
|
||||||
def syncRadioFromNeedTheme(
|
def syncRadioFromNeedTheme(
|
||||||
self,
|
self,
|
||||||
@@ -247,7 +265,7 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
else:
|
else:
|
||||||
theme = "system"
|
theme = "system"
|
||||||
style = self.StyleComboBox.currentText()
|
style = self.StyleComboBox.currentText()
|
||||||
custom_theme = self.ThemeComboBox.currentData() or ""
|
custom_theme = self.CustomThemeComboBox.currentData() or ""
|
||||||
if not custom_theme:
|
if not custom_theme:
|
||||||
custom_theme = ""
|
custom_theme = ""
|
||||||
return theme, style, custom_theme
|
return theme, style, custom_theme
|
||||||
@@ -268,8 +286,8 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
theme, _, _ = self.collectSettings()
|
theme, _, _ = self.collectSettings()
|
||||||
self.__cfg_mgr.set(CfgKey.GLOBAL.APPEARANCE.THEME, theme)
|
self.__cfg_mgr.set(CfgKey.GLOBAL.APPEARANCE.THEME, theme)
|
||||||
self.setNavigationIcons()
|
self.setNavigationIcons()
|
||||||
self.updateThemeStatus()
|
self.updateCustomThemeStatus()
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeInfo()
|
||||||
self.__original_theme = theme
|
self.__original_theme = theme
|
||||||
self.__original_custom_theme = custom_theme if custom_theme else ""
|
self.__original_custom_theme = custom_theme if custom_theme else ""
|
||||||
self.__original_style = getActiveStyle()
|
self.__original_style = getActiveStyle()
|
||||||
@@ -290,30 +308,12 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def populateThemeList(
|
|
||||||
self
|
|
||||||
):
|
|
||||||
|
|
||||||
self.ThemeComboBox.blockSignals(True)
|
|
||||||
self.ThemeComboBox.clear()
|
|
||||||
self.ThemeComboBox.addItem("默认", "")
|
|
||||||
self.__theme_cache = {}
|
|
||||||
themes = themeInstance().listThemes()
|
|
||||||
for t in themes:
|
|
||||||
name = t.get("name", "")
|
|
||||||
file = t.get("file", name)
|
|
||||||
author = t.get("author", "")
|
|
||||||
if name:
|
|
||||||
self.__theme_cache[file] = t
|
|
||||||
self.ThemeComboBox.addItem(name, file)
|
|
||||||
self.ThemeComboBox.blockSignals(False)
|
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def onRemoveThemeButtonClicked(
|
def onRemoveCustomThemeButtonClicked(
|
||||||
self
|
self
|
||||||
):
|
):
|
||||||
|
|
||||||
file = self.ThemeComboBox.currentData()
|
file = self.CustomThemeComboBox.currentData()
|
||||||
if not file:
|
if not file:
|
||||||
QMessageBox.information(
|
QMessageBox.information(
|
||||||
self,
|
self,
|
||||||
@@ -334,10 +334,10 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
themeInstance().removeTheme(file)
|
themeInstance().removeTheme(file)
|
||||||
self.populateThemeList()
|
self.populateCustomThemes()
|
||||||
self.ThemeComboBox.setCurrentIndex(0)
|
self.CustomThemeComboBox.setCurrentIndex(0)
|
||||||
self.updateThemeStatus()
|
self.updateCustomThemeStatus()
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeInfo()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
QMessageBox.warning(
|
QMessageBox.warning(
|
||||||
self,
|
self,
|
||||||
@@ -346,7 +346,7 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def onImportThemeButtonClicked(
|
def onImportCustomThemeButtonClicked(
|
||||||
self
|
self
|
||||||
):
|
):
|
||||||
|
|
||||||
@@ -360,12 +360,12 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
file_id = themeInstance().importTheme(file_path)
|
file_id = themeInstance().importTheme(file_path)
|
||||||
self.populateThemeList()
|
self.populateCustomThemes()
|
||||||
idx = self.ThemeComboBox.findData(file_id)
|
idx = self.CustomThemeComboBox.findData(file_id)
|
||||||
if idx >= 0:
|
if idx >= 0:
|
||||||
self.ThemeComboBox.setCurrentIndex(idx)
|
self.CustomThemeComboBox.setCurrentIndex(idx)
|
||||||
self.updateThemeStatus()
|
self.updateCustomThemeStatus()
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeInfo()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
QMessageBox.warning(
|
QMessageBox.warning(
|
||||||
self,
|
self,
|
||||||
@@ -374,36 +374,37 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def onThemeComboBoxChanged(
|
def onCustomThemeComboBoxChanged(
|
||||||
self,
|
self,
|
||||||
index: int
|
index: int
|
||||||
):
|
):
|
||||||
|
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeInfo()
|
||||||
|
# no status update, because custom theme is not applied yet.
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def onResetThemeButtonClicked(
|
def onResetCustomThemeButtonClicked(
|
||||||
self
|
self
|
||||||
):
|
):
|
||||||
|
|
||||||
self.ThemeComboBox.blockSignals(True)
|
self.CustomThemeComboBox.blockSignals(True)
|
||||||
if self.__original_custom_theme:
|
if self.__original_custom_theme:
|
||||||
idx = self.ThemeComboBox.findData(self.__original_custom_theme)
|
idx = self.CustomThemeComboBox.findData(self.__original_custom_theme)
|
||||||
if idx >= 0:
|
if idx >= 0:
|
||||||
self.ThemeComboBox.setCurrentIndex(idx)
|
self.CustomThemeComboBox.setCurrentIndex(idx)
|
||||||
else:
|
else:
|
||||||
self.ThemeComboBox.setCurrentIndex(0)
|
self.CustomThemeComboBox.setCurrentIndex(0)
|
||||||
else:
|
else:
|
||||||
self.ThemeComboBox.setCurrentIndex(0)
|
self.CustomThemeComboBox.setCurrentIndex(0)
|
||||||
self.ThemeComboBox.blockSignals(False)
|
self.CustomThemeComboBox.blockSignals(False)
|
||||||
if self.__original_theme == "light":
|
if self.__original_theme == "light":
|
||||||
self.LightThemeRadio.setChecked(True)
|
self.LightThemeRadio.setChecked(True)
|
||||||
elif self.__original_theme == "dark":
|
elif self.__original_theme == "dark":
|
||||||
self.DarkThemeRadio.setChecked(True)
|
self.DarkThemeRadio.setChecked(True)
|
||||||
else:
|
else:
|
||||||
self.SystemThemeRadio.setChecked(True)
|
self.SystemThemeRadio.setChecked(True)
|
||||||
self.updateThemeStatus()
|
self.updateCustomThemeInfo()
|
||||||
self.updateThemeInfo()
|
self.updateCustomThemeStatus()
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def onCancelButtonClicked(
|
def onCancelButtonClicked(
|
||||||
|
|||||||
@@ -115,9 +115,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>-51</y>
|
||||||
<width>450</width>
|
<width>397</width>
|
||||||
<height>380</height>
|
<height>434</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="AppearancePageLayout">
|
<layout class="QVBoxLayout" name="AppearancePageLayout">
|
||||||
@@ -138,324 +138,308 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="AppearanceGroupBox">
|
<widget class="QGroupBox" name="AppearanceGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>主题模式</string>
|
<string>主题模式</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="AppearanceGroupBoxLayout">
|
<layout class="QVBoxLayout" name="AppearanceGroupBoxLayout">
|
||||||
<property name="spacing">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="LightThemeRadio">
|
|
||||||
<property name="text">
|
|
||||||
<string>浅色</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="DarkThemeRadio">
|
|
||||||
<property name="text">
|
|
||||||
<string>深色</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="SystemThemeRadio">
|
|
||||||
<property name="text">
|
|
||||||
<string>跟随系统</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="InterfaceGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>界面风格</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="InterfaceGroupBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="StyleSelectLayout">
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="StyleSelectLabel">
|
<widget class="QRadioButton" name="LightThemeRadio">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>应用程序样式:</string>
|
<string>浅色</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="StyleComboBox">
|
<widget class="QRadioButton" name="DarkThemeRadio">
|
||||||
<property name="minimumSize">
|
<property name="text">
|
||||||
<size>
|
<string>深色</string>
|
||||||
<width>160</width>
|
</property>
|
||||||
<height>25</height>
|
</widget>
|
||||||
</size>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="SystemThemeRadio">
|
||||||
|
<property name="text">
|
||||||
|
<string>跟随系统</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
</item>
|
||||||
<widget class="QLabel" name="StyleHintLabel">
|
<item>
|
||||||
<property name="text">
|
<widget class="QGroupBox" name="InterfaceGroupBox">
|
||||||
<string>更改样式将在下次启动应用程序时生效。</string>
|
<property name="title">
|
||||||
</property>
|
<string>界面风格</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<layout class="QVBoxLayout" name="InterfaceGroupBoxLayout">
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="CustomQssGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>自定义外观</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="CustomQssGroupBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="CustomQssHintLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>选择一个主题,或导入新的主题文件:</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="QssPathLayout">
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="ThemeComboBox">
|
<layout class="QHBoxLayout" name="StyleSelectLayout">
|
||||||
<property name="minimumSize">
|
<property name="spacing">
|
||||||
<size>
|
<number>5</number>
|
||||||
<width>160</width>
|
</property>
|
||||||
<height>25</height>
|
<item>
|
||||||
</size>
|
<widget class="QLabel" name="StyleSelectLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>应用程序样式:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="StyleComboBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>160</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="StyleHintLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>更改样式将在下次启动应用程序时生效。</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="CustomThemeGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>自定义外观</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="CustomQssGroupBoxLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="CustomThemeHintLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>选择一个主题,或导入新的主题文件:</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="QssPathEdit">
|
<layout class="QHBoxLayout" name="CustomThemePathLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="CustomThemeComboBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>160</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="CustomThemePathEdit">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="visible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>选择或输入 QSS 样式表文件路径...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="ImportCustomThemeButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>25</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>25</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>+</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="RemoveCustomThemeButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>25</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>25</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="CustomThemeInfoLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>25</height>
|
<height>60</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="visible">
|
<property name="text">
|
||||||
<bool>false</bool>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="textFormat">
|
||||||
<string>选择或输入 QSS 样式表文件路径...</string>
|
<enum>Qt::TextFormat::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="BrowseQssButton">
|
<layout class="QHBoxLayout" name="CustomThemeActionLayout">
|
||||||
<property name="minimumSize">
|
<property name="spacing">
|
||||||
<size>
|
<number>5</number>
|
||||||
<width>25</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<item>
|
||||||
<size>
|
<widget class="QPushButton" name="ResetCustomThemeButton">
|
||||||
<width>25</width>
|
<property name="minimumSize">
|
||||||
<height>25</height>
|
<size>
|
||||||
</size>
|
<width>80</width>
|
||||||
</property>
|
<height>25</height>
|
||||||
<property name="text">
|
</size>
|
||||||
<string>+</string>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>重置主题</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="CustomThemeActionSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="RemoveThemeButton">
|
<widget class="QLabel" name="CustomThemeStatusLabel">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>25</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>25</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-</string>
|
<string>当前使用程序 默认 外观。</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
</item>
|
||||||
<widget class="QLabel" name="ThemeInfoLabel">
|
<item>
|
||||||
<property name="minimumSize">
|
<spacer name="AppearancePageSpacer">
|
||||||
<size>
|
<property name="orientation">
|
||||||
<width>0</width>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
<height>60</height>
|
</property>
|
||||||
</size>
|
<property name="sizeHint" stdset="0">
|
||||||
</property>
|
<size>
|
||||||
<property name="text">
|
<width>20</width>
|
||||||
<string/>
|
<height>40</height>
|
||||||
</property>
|
</size>
|
||||||
<property name="textFormat">
|
</property>
|
||||||
<enum>Qt::TextFormat::RichText</enum>
|
</spacer>
|
||||||
</property>
|
</item>
|
||||||
<property name="alignment">
|
</layout>
|
||||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignTop</set>
|
</widget>
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="QssActionLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="ApplyQssButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="visible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>应用样式</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="ResetThemeButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>重置主题</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="QssActionSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Orientation::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="QssStatusLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>当前使用程序 默认 外观。</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="AppearancePageSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Orientation::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
</layout>
|
||||||
</layout>
|
</item>
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="ButtonLayout">
|
<layout class="QHBoxLayout" name="ButtonLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
|
|||||||
Reference in New Issue
Block a user