fix: About 窗口标题和副标题水平居中(Layout.alignment 在 ColumnLayout 内不可靠,改用 fillWidth+horizontalAlignment)
This commit is contained in:
@@ -99,6 +99,8 @@ Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 标题区:插件中文名 + 英文名,整体居中
|
// 标题区:插件中文名 + 英文名,整体居中
|
||||||
|
// 注意:用 Layout.fillWidth + horizontalAlignment 而非 Layout.alignment,
|
||||||
|
// 后者在 ColumnLayout 内对 Text 不可靠(实测会左对齐贴边)
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 2
|
spacing: 2
|
||||||
@@ -108,14 +110,16 @@ Window {
|
|||||||
font.pixelSize: 18
|
font.pixelSize: 18
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: "#333333"
|
color: "#333333"
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "JNetApplet"
|
text: "JNetApplet"
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
color: "#999999"
|
color: "#999999"
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user