Skip to content

Commit

Permalink
chore: dialog set fix size
Browse files Browse the repository at this point in the history
- dialog set fix size to avoid resize(in treeland)
- translation tweak
- right margin tweak
  • Loading branch information
kegechen committed Dec 25, 2024
1 parent 6c9c6ce commit e609653
Show file tree
Hide file tree
Showing 33 changed files with 87 additions and 305 deletions.
2 changes: 1 addition & 1 deletion src/dde-control-center/frame/dccrepeater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void DccRepeater::initItem(int index, QObject *object)
if (!d->delegateValidated) {
d->delegateValidated = true;
QObject* delegate = this->delegate();
qmlWarning(delegate ? delegate : this) << tr("Delegate must be of `DccObject` type");
qmlWarning(delegate ? delegate : this) << "Delegate must be of `DccObject` type";
}
}
return;
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-accounts/qml/AvatarSettingsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ D.DialogWindow {
property string currentAvatar: dccData.avatar()
width: 640
height: 500
minimumWidth: 640
minimumHeight: 500
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
modality: Qt.WindowModal
D.DWindow.enableSystemMove: !cropper.dragActived
Expand Down
11 changes: 8 additions & 3 deletions src/plugin-accounts/qml/ComfirmDeleteDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ D.DialogWindow {
id: dialog
icon: "preferences-system"
width: 400
height: 170
minimumWidth: 400
minimumHeight: 170
maximumWidth: minimumWidth
maximumHeight: minimumHeight

signal requestDelete(bool deleteHome)
ColumnLayout {
// width: 400
width: dialog.width - 20
Label {
Layout.alignment: Qt.AlignHCenter
font: D.DTK.fontManager.t5
Expand All @@ -33,7 +38,7 @@ D.DialogWindow {
Layout.fillWidth: true
Button {
text: qsTr("Cancel")
Layout.preferredWidth: 175
Layout.preferredWidth: 180
onClicked: {
close()
}
Expand All @@ -43,7 +48,7 @@ D.DialogWindow {
}
D.WarningButton {
text: qsTr("Delete")
Layout.preferredWidth: 175
Layout.preferredWidth: 180
Layout.alignment: Qt.AlignRight
onClicked: {
requestDelete(deleteHomeCheckbox.checked)
Expand Down
9 changes: 7 additions & 2 deletions src/plugin-accounts/qml/ComfirmSafePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.deepin.dcc 1.0
import org.deepin.dtk 1.0 as D

D.DialogWindow {
id: dialog
icon: "preferences-system"
width: 600
height: 180
minimumWidth: 600
minimumHeight: 180
maximumWidth: minimumWidth
maximumHeight: minimumHeight
property string msg

signal requestShowSafePage()
ColumnLayout {
// width: 400
Label {
Layout.alignment: Qt.AlignHCenter
verticalAlignment: Text.AlignVCenter
font: D.DTK.fontManager.t5
text: msg
wrapMode: Text.WordWrap
Layout.preferredWidth: dialog.width - 10
Layout.preferredHeight: 60
leftPadding: 10
rightPadding: 10
}
Expand Down
7 changes: 7 additions & 0 deletions src/plugin-accounts/qml/CreateAccountDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ D.DialogWindow {
id: dialog
width: 450
height: 500
minimumWidth: 450
minimumHeight: 500
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
modality: Qt.WindowModal
title: qsTr("Create a new account")
Expand Down Expand Up @@ -162,6 +166,7 @@ D.DialogWindow {
PasswordLayout {
id: pwdLayout
currentPwdVisible: false
Layout.fillWidth: true
name: {
let nameEdit = namesContainter.eidtItems[0]
if (nameEdit === undefined)
Expand All @@ -175,6 +180,8 @@ D.DialogWindow {
spacing: 10
Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter
Layout.bottomMargin: 10
Layout.leftMargin: 10
Layout.rightMargin: 10

Button {
Layout.fillWidth: true
Expand Down
15 changes: 7 additions & 8 deletions src/plugin-accounts/qml/PasswordLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ColumnLayout {
property string userId
property string name: dccData.userName(pwdLayout.userId)
property bool currentPwdVisible: true
// property alas pwdContainter: pwdContainter
Layout.fillWidth: true

signal requestClose();
Expand Down Expand Up @@ -47,8 +46,8 @@ ColumnLayout {
visible: pwdLayout.currentPwdVisible
label.text: qsTr("Current password")
edit.placeholderText: qsTr("Required")
Layout.leftMargin: 10
Layout.rightMargin: 20
Layout.leftMargin: 0
Layout.rightMargin: 16
Layout.bottomMargin: 10

Loader {
Expand Down Expand Up @@ -106,8 +105,8 @@ ColumnLayout {
RowLayout {
id: pwdIndicator
spacing: 4
Layout.alignment: Qt.AlignRight
Layout.rightMargin: 30
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
Layout.rightMargin: pwdLayout.currentPwdVisible ? 30 : 20
Label {
id: pwdStrengthHintText
text: ""
Expand Down Expand Up @@ -182,7 +181,7 @@ ColumnLayout {
radius: 8
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.rightMargin: 10
Layout.rightMargin: pwdLayout.currentPwdVisible ? 10 : 0
Layout.bottomMargin: 30
implicitHeight: 150
color: "transparent"
Expand Down Expand Up @@ -261,7 +260,7 @@ ColumnLayout {
backgroundVisible: false
checkable: false
implicitHeight: 50
leftPadding: 10
leftPadding: pwdLayout.currentPwdVisible ? 0 : 10
rightPadding: 10

contentItem: PasswordItem {
Expand Down Expand Up @@ -297,7 +296,7 @@ ColumnLayout {
Layout.preferredWidth: pwdLayout.minWidth(font, text, dialog.width - 20)
Layout.alignment: Qt.AlignRight
Layout.rightMargin: 10
Layout.leftMargin: 10
Layout.leftMargin: 0
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/plugin-accounts/qml/PasswordModifyDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ D.DialogWindow {
id: dialog
property string userId
width: 520
height: 480
minimumWidth: width
minimumHeight: height
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
modality: Qt.WindowModal
title: isCurrent() ? qsTr("Modify password") : qsTr("Reset password")
Expand All @@ -24,14 +27,13 @@ D.DialogWindow {
}

ColumnLayout {
anchors.fill: parent

Label {
text: dialog.title
font.bold: true
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
}
Label {
id: descLable
text: {
if (dialog.isCurrent())
return qsTr("Password length should be at least 8 characters, and the password should contain a combination of at least 3 of the following: uppercase letters, lowercase letters, numbers, and symbols. This type of password is more secure.")
Expand All @@ -49,6 +51,7 @@ D.DialogWindow {
PasswordLayout {
id: pwdLayout
userId: dialog.userId
Layout.leftMargin: 10
onRequestClose: {
// no error, close dialog
close()
Expand All @@ -59,6 +62,7 @@ D.DialogWindow {
spacing: 10
Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter
Layout.bottomMargin: 10
Layout.leftMargin: 10
Layout.rightMargin: 20

Button {
Expand Down
6 changes: 5 additions & 1 deletion src/plugin-datetime/qml/DateTimeSettingDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ import QtQuick.Layouts 1.15
import org.deepin.dtk 1.0 as D

D.DialogWindow {
id: ddialog
id: ddialog
width: 400
height: 220
minimumWidth: 400
minimumHeight: 220
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
modality: Qt.WindowModal
property date currentDate: new Date()
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-datetime/qml/LangsChooserDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Loader {
id: ddialog
width: 420
height: 550
minimumWidth: width
minimumHeight: height
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
modality: Qt.WindowModal
ColumnLayout {
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-datetime/qml/RegionFormatDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Loader {
id: ddialog
width: 640
height: 680
minimumWidth: width
minimumHeight: height
maximumWidth: minimumWidth
maximumHeight: minimumHeight
icon: "preferences-system"
// DWindow.enableBlurWindow: true
modality: Qt.WindowModal
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-datetime/qml/RegionsChooserWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Loader {
id: searchWindow
width: 200
height: 500
minimumWidth: width
minimumHeight: height
maximumWidth: minimumWidth
maximumHeight: minimumHeight
DWindow.enabled: true
DWindow.enableSystemResize: false
DWindow.enableBlurWindow: true
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-datetime/qml/SearchableListViewPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Popup {
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
placeholder: qsTr("搜索")
placeholder: qsTr("Search")
onVisibleChanged: {
clear() // clear seach text
}
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-datetime/qml/TimezoneDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ D.DialogWindow {
visible: true
width: 1080
height: 730
minimumWidth: width
minimumHeight: height
maximumWidth: minimumWidth
maximumHeight: minimumHeight
color: "#66000000"
modality: Qt.WindowModal

Expand Down
4 changes: 4 additions & 0 deletions src/plugin-keyboard/qml/ShortcutSettingDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ D.DialogWindow {
id: ddialog
width: 400
height: 360
minimumWidth: 400
minimumHeight: 360
maximumWidth: minimumWidth
maximumHeight: minimumHeight
visible: true
icon: "preferences-system"
modality: Qt.WindowModal
Expand Down
16 changes: 1 addition & 15 deletions translations/dde-control-center.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2970,13 +2970,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DccRepeater</name>
<message>
<source>Delegate must be of `DccObject` type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DccWindow</name>
<message>
Expand Down Expand Up @@ -4764,7 +4757,7 @@ Sign in to %1 ID to get personalized features and services of Browser, App Store
<context>
<name>SearchableListViewPopup</name>
<message>
<source>搜索</source>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down Expand Up @@ -6391,13 +6384,6 @@ Sign in to %1 ID to get personalized features and services of Browser, App Store
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>dccV25::DccRepeater</name>
<message>
<source>Delegate must be of `DccObject` type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>dccV25::KeyboardController</name>
<message>
Expand Down
16 changes: 1 addition & 15 deletions translations/dde-control-center_az.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2970,13 +2970,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DccRepeater</name>
<message>
<source>Delegate must be of `DccObject` type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DccWindow</name>
<message>
Expand Down Expand Up @@ -4764,7 +4757,7 @@ Sign in to %1 ID to get personalized features and services of Browser, App Store
<context>
<name>SearchableListViewPopup</name>
<message>
<source>搜索</source>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down Expand Up @@ -6391,13 +6384,6 @@ Sign in to %1 ID to get personalized features and services of Browser, App Store
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>dccV25::DccRepeater</name>
<message>
<source>Delegate must be of `DccObject` type</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>dccV25::KeyboardController</name>
<message>
Expand Down
Loading

0 comments on commit e609653

Please sign in to comment.