Skip to content

Commit b7db235

Browse files
wyu71deepin-bot[bot]
authored andcommitted
fix: adjust component heights and vertical alignment for localization
- Reduced implicitHeight to accommodate longer translations - Added verticalCenter anchors for multilingual text alignment - Unified item heights to 40 for consistent layout across languages - Enhanced parentItemChanged handling for dynamic language switching Log: improve UI layout for better localization support in datetime plugin pms: BUG-316149
1 parent 2d5036e commit b7db235

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/plugin-datetime/qml/ComboLabel.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Item {
99
property var comboModel: [""]
1010
property int comboCurrentIndex: -1
1111
// property string textRole
12-
implicitHeight: 36
12+
implicitHeight: 30
1313
implicitWidth: item.comboModel.length > 1 ? 280 : 80
1414
signal comboBoxActivated(int index)
1515

@@ -24,6 +24,9 @@ Item {
2424
onActivated: function (index) {
2525
item.comboBoxActivated(index)
2626
}
27+
anchors {
28+
verticalCenter: parent.verticalCenter
29+
}
2730
}
2831

2932
Label {

src/plugin-datetime/qml/LangAndFormat.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ DccObject {
8383
property bool isCurrentLang: dccData.currentLang === dccObj.displayName
8484
visible: dccObj
8585
hoverEnabled: true
86-
implicitHeight: 50
86+
implicitHeight: 40
8787
icon.name: dccObj.icon
8888
checkable: false
8989

@@ -190,6 +190,7 @@ DccObject {
190190
languageListTiltle.isEditing = false
191191
}
192192
}
193+
onParentItemChanged: item => { if (item) item.implicitHeight = 40 }
193194
}
194195
}
195196

@@ -346,6 +347,7 @@ DccObject {
346347
dccData.setCurrentFormat(model.indexBegin + index, idx)
347348
}
348349
}
350+
onParentItemChanged: item => { if (item) item.implicitHeight = 40 }
349351
}
350352
}
351353
}
@@ -378,6 +380,7 @@ DccObject {
378380
dccData.setCurrentFormat(model.indexBegin + index, idx)
379381
}
380382
}
383+
onParentItemChanged: item => { if (item) item.implicitHeight = 40 }
381384
}
382385
}
383386
}
@@ -410,6 +413,7 @@ DccObject {
410413
dccData.setCurrentFormat(model.indexBegin + index, idx)
411414
}
412415
}
416+
onParentItemChanged: item => { if (item) item.implicitHeight = 40 }
413417
}
414418
}
415419
}

0 commit comments

Comments
 (0)