mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-17 23:13:03 +08:00
fix(gui): 修复 ThemeInfoLabel 富文本换行与布局
- 设置 textFormat=RichText,\n 替换为 <br> 实现正确换行 - .ui 添加 minimumHeight=60、alignment=AlignTop 防止多行文本被裁剪
This commit is contained in:
@@ -134,6 +134,7 @@ class ALSettingsWidget(QWidget, Ui_ALSettingsWidget):
|
||||
self.NavigationList.setCurrentRow(0)
|
||||
self.populateStyles()
|
||||
self.setNavigationIcons()
|
||||
self.ThemeInfoLabel.setTextFormat(Qt.TextFormat.RichText)
|
||||
|
||||
def setNavigationIcons(
|
||||
self
|
||||
@@ -250,9 +251,9 @@ class ALSettingsWidget(QWidget, Ui_ALSettingsWidget):
|
||||
need_theme = t.get("need_theme", "both")
|
||||
brief = t.get("brief", "没有相关简介")
|
||||
self.ThemeInfoLabel.setText(
|
||||
f"<b>{name}</b>\n"
|
||||
f"适用于 {_themeToReadable(need_theme)} 主题\n"
|
||||
f"作者:{author}\n"
|
||||
f"<b>{name}</b><br>"
|
||||
f"适用于 {_themeToReadable(need_theme)} 主题<br>"
|
||||
f"作者:{author}<br>"
|
||||
f"{brief}"
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -320,9 +320,21 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ThemeInfoLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::RichText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignTop</property>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user