Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button size && CustomAvatarEmptyArea text align tweak #1976

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/plugin-accounts/qml/AccountSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ DccObject {
settings.nopasswdLoginChecked = dccData.nopasswdLogin(settings.userId)
}

FontMetrics {
id: fm
}

// 账户头像
DccObject {
id: userAvatars
Expand Down Expand Up @@ -184,9 +188,12 @@ DccObject {
text: qsTr("Add new user")
Layout.alignment: Qt.AlignRight | Qt.AlignHCenter
Layout.rightMargin: 10
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
onClicked: {
cadLoader.active = true
}

Loader {
id: cadLoader
active: false
Expand Down Expand Up @@ -438,6 +445,8 @@ DccObject {
Layout.alignment: groupSettingsBtn.visible ? Qt.AlignLeft : Qt.AlignRight
text: qsTr("Delete current account")
enabled: dccData.isDeleteAble(settings.userId)
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
Loader {
id: cfdLoader
active: false
Expand All @@ -463,6 +472,8 @@ DccObject {
Layout.alignment: Qt.AlignRight
text: qsTr("Group setting")
visible: dccData.needShowGroups()
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
onClicked: {
DccApp.showPage(groupSettings)
}
Expand Down Expand Up @@ -645,6 +656,8 @@ DccObject {
Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Add group")
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
onClicked: {
dccData.requestCreateGroup(settings.userId)
groupview.positionViewAtEnd()
Expand Down
1 change: 1 addition & 0 deletions src/plugin-accounts/qml/CustomAvatarEmpatyArea.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Control {
wrapMode: Text.WordWrap
anchors.top: addIcon.bottom
anchors.topMargin: 20
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("You haven't uploaded an avatar yet. Click or drag and drop to upload an image.")
}
Expand Down
6 changes: 5 additions & 1 deletion src/plugin-datetime/qml/LangAndFormat.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import QtQml.Models

// 语言和区域
DccObject {
FontMetrics {
id: fm
}
// 语言列表抬头
DccObject {
id: languageListTiltle
Expand Down Expand Up @@ -168,7 +171,8 @@ DccObject {
backgroundType: DccObject.Normal
pageType: DccObject.Editor
page: Button {
implicitWidth: 80
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
text: qsTr("add")
LangsChooserDialog {
id: dialogLoader
Expand Down
5 changes: 5 additions & 0 deletions src/plugin-datetime/qml/TimeAndDate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ DccObject {
anchors.fill: parent
property bool needShowDialog: false
text: qsTr("Settings")
implicitWidth: fm.advanceWidth(text) + 12
implicitHeight: 30
FontMetrics {
id: fm
}

Loader {
id: loader
Expand Down
2 changes: 1 addition & 1 deletion translations/dde-control-center_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
<name>ComfirmSafePage</name>
<message>
<source>Go to settings</source>
<translation type="unfinished"></translation>
<translation>去设置</translation>
</message>
<message>
<source>Cancel</source>
Expand Down
Loading