Skip to content

Commit 958cea7

Browse files
add-uosdeepin-bot[bot]
authored andcommitted
style(ui): unify title styles and fix addon button alignment
Extract common title component to DccTitle.qml and replace duplicate Label configurations across multiple modules. Fix ToolButton alignment in DetailAddonsItem by setting proper width and padding. 提取通用标题组件DccTitle.qml,替换多个模块中重复的Label配置。 修复DetailAddonsItem中ToolButton对齐问题,设置正确的宽度和内边距。 Log: 统一标题样式并修复插件按钮对齐 PMS: BUG-353555, BUG-353567 Influence: 统一了UI标题样式,提升了界面一致性;修复了插件设置按钮位置不正确的问题。
1 parent 61ca29e commit 958cea7

9 files changed

Lines changed: 40 additions & 39 deletions

src/dcc-fcitx5configtool/qml/AddonsPage.qml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.15
@@ -22,14 +22,9 @@ DccObject {
2222
pageType: DccObject.Item
2323
page: RowLayout {
2424
width: parent.width
25-
Label {
25+
DccTitle {
2626
Layout.leftMargin: 10
2727
Layout.fillWidth: true
28-
font {
29-
family: D.DTK.fontManager.t4.family
30-
pixelSize: D.DTK.fontManager.t4.pixelSize
31-
weight: Font.Medium
32-
}
3328
text: dccObj.displayName
3429
}
3530
}

src/dcc-fcitx5configtool/qml/AdvancedSettingsModule.qml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.3
@@ -22,14 +22,9 @@ DccObject {
2222
}
2323
page: ColumnLayout {
2424
spacing: 0
25-
Label {
25+
DccTitle {
2626
Layout.leftMargin: 10
2727
Layout.bottomMargin: 0
28-
font {
29-
family: D.DTK.fontManager.t4.family
30-
pixelSize: D.DTK.fontManager.t4.pixelSize
31-
weight: Font.Medium
32-
}
3328
text: dccObj.displayName
3429
}
3530
Label {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
2+
// SPDX-License-Identifier: GPL-3.0-or-later
3+
import QtQuick.Controls 2.15
4+
import QtQuick.Layouts 1.15
5+
import org.deepin.dtk 1.0 as D
6+
7+
Label {
8+
Layout.fillWidth: true
9+
property D.Palette textColor: D.Palette {
10+
normal: Qt.rgba(0, 0, 0, 0.9)
11+
normalDark: Qt.rgba(1, 1, 1, 0.9)
12+
}
13+
font {
14+
family: D.DTK.fontManager.t5.family
15+
pixelSize: D.DTK.fontManager.t5.pixelSize
16+
weight: 500
17+
}
18+
color: D.ColorSelector.textColor
19+
}

src/dcc-fcitx5configtool/qml/DetailAddonsItem.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Layouts 1.15
@@ -36,9 +36,11 @@ DccObject {
3636
onParentItemChanged: {
3737
if (parentItem) {
3838
parentItem.leftPadding = 4
39+
parentItem.rightPadding = 4
3940
}
4041
}
4142
page: RowLayout {
43+
width: parent.parentItem.width
4244
height: 50
4345
spacing: 0
4446
CheckBox {

src/dcc-fcitx5configtool/qml/InputMethodsChooser.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.0
@@ -113,7 +113,7 @@ Loader {
113113
textColor: D.Palette {
114114
normal: D.DTK.makeColor(D.Color.Highlight)
115115
}
116-
116+
font.pixelSize: D.DTK.fontManager.t8.pixelSize
117117
onClicked: {
118118
console.log("Find more in App Store button clicked")
119119
dccData.openDeepinAppStore()

src/dcc-fcitx5configtool/qml/KeyboardLayout.qml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick
44
import QtQuick.Controls 2.3
@@ -17,11 +17,9 @@ DccObject {
1717
weight: 10
1818
pageType: DccObject.Item
1919
page: RowLayout {
20-
Label {
20+
DccTitle {
2121
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
2222
Layout.leftMargin: 10
23-
font.bold: true
24-
font.pointSize: 14
2523
text: dccObj.displayName
2624
}
2725
D.Button {
@@ -156,6 +154,7 @@ DccObject {
156154
crystal: D.DTK.makeColor(D.Color.Highlight)
157155
}
158156
}
157+
font.pixelSize: D.DTK.fontManager.t8.pixelSize
159158
LayoutsChooser {
160159
id: layoutsChooser
161160
viewModel: dccData.layoutSearchModel()

src/dcc-fcitx5configtool/qml/KeyboardLayoutModule.qml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.3
@@ -17,11 +17,9 @@ DccObject {
1717
weight: 10
1818
pageType: DccObject.Item
1919
page: RowLayout {
20-
Label {
20+
DccTitle {
2121
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
2222
Layout.leftMargin: 10
23-
font.bold: true
24-
font.pointSize: 14
2523
text: dccObj.displayName
2624
}
2725
D.Button {
@@ -154,6 +152,7 @@ DccObject {
154152
crystal: D.DTK.makeColor(D.Color.Highlight)
155153
}
156154
}
155+
font.pixelSize: D.DTK.fontManager.t8.pixelSize
157156
LayoutsChooser {
158157
id: layoutsChooser
159158
viewModel: dccData.keyboardController.layoutSearchModel()

src/dcc-fcitx5configtool/qml/ManageInputMethodsModule.qml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.3
@@ -17,14 +17,9 @@ DccObject {
1717
pageType: DccObject.Item
1818
page: RowLayout {
1919
width: parent.width
20-
Label {
20+
DccTitle {
2121
Layout.leftMargin: 10
2222
Layout.fillWidth: true
23-
font {
24-
family: D.DTK.fontManager.t4.family
25-
pixelSize: D.DTK.fontManager.t4.pixelSize
26-
weight: Font.Medium
27-
}
2823
text: dccObj.displayName
2924
}
3025

@@ -37,6 +32,7 @@ DccObject {
3732
textColor: D.Palette {
3833
normal: D.DTK.makeColor(D.Color.Highlight)
3934
}
35+
font.pixelSize: D.DTK.fontManager.t8.pixelSize
4036
InputMethodsChooser {
4137
id: imsChooser
4238
viewModel: dccData.imProxyModel()

src/dcc-fcitx5configtool/qml/ShortcutsModule.qml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
import QtQuick 2.15
44
import QtQuick.Controls 2.3
@@ -119,13 +119,8 @@ DccObject {
119119
weight: 210
120120
pageType: DccObject.Item
121121
page: RowLayout {
122-
Label {
122+
DccTitle {
123123
Layout.leftMargin: 10
124-
font {
125-
family: D.DTK.fontManager.t4.family
126-
pixelSize: D.DTK.fontManager.t4.pixelSize
127-
weight: Font.Medium
128-
}
129124
text: dccObj.displayName
130125
}
131126
D.Button {
@@ -137,6 +132,7 @@ DccObject {
137132
textColor: D.Palette {
138133
normal: D.DTK.makeColor(D.Color.Highlight)
139134
}
135+
font.pixelSize: D.DTK.fontManager.t8.pixelSize
140136
onClicked: {
141137
dccData.fcitx5ConfigProxy.restoreDefault("Hotkey")
142138
console.log("Restore Defaults button clicked")

0 commit comments

Comments
 (0)