mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-18 07:23: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.NavigationList.setCurrentRow(0)
|
||||||
self.populateStyles()
|
self.populateStyles()
|
||||||
self.setNavigationIcons()
|
self.setNavigationIcons()
|
||||||
|
self.ThemeInfoLabel.setTextFormat(Qt.TextFormat.RichText)
|
||||||
|
|
||||||
def setNavigationIcons(
|
def setNavigationIcons(
|
||||||
self
|
self
|
||||||
@@ -250,9 +251,9 @@ class ALSettingsWidget(QWidget, Ui_ALSettingsWidget):
|
|||||||
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.ThemeInfoLabel.setText(
|
||||||
f"<b>{name}</b>\n"
|
f"<b>{name}</b><br>"
|
||||||
f"适用于 {_themeToReadable(need_theme)} 主题\n"
|
f"适用于 {_themeToReadable(need_theme)} 主题<br>"
|
||||||
f"作者:{author}\n"
|
f"作者:{author}<br>"
|
||||||
f"{brief}"
|
f"{brief}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -320,9 +320,21 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="ThemeInfoLabel">
|
<widget class="QLabel" name="ThemeInfoLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>60</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</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">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user