fix(CreateCategoryPopup): move the delete button into footer

Adjust according to Figma design
- the asset size should be 40x40
- fix the listview's horizontal alignment
- fix the confirmation dialog(s!) title

Fixes #9887
This commit is contained in:
Lukáš Tinkl 2023-04-03 22:21:50 +02:00 committed by Lukáš Tinkl
parent 6768f62451
commit cde9f810e6
2 changed files with 16 additions and 27 deletions

View File

@ -123,10 +123,11 @@ StatusModal {
readonly property bool checked: channelItemCheckbox.checked
objectName: "category_item_name_" + model.name
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: 16
height: visible ? implicitHeight : 0
title: "#" + model.name
asset.width: 30
asset.height: 30
asset.width: 40
asset.height: 40
asset.emoji: model.emoji
asset.color: model.color
asset.imgIsIdenticon: false
@ -159,29 +160,6 @@ StatusModal {
}
}
StatusModalDivider {
visible: deleteCategoryButton.visible
topPadding: 8
bottomPadding: 8
}
StatusListItem {
id: deleteCategoryButton
anchors.horizontalCenter: parent.horizontalCenter
visible: isEdit
title: qsTr("Delete category")
asset.name: "delete"
type: StatusListItem.Type.Danger
onClicked: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
title: qsTr("Delete %1 category").arg(root.contentItem.categoryName.input.text),
confirmationText: qsTr("Are you sure you want to delete %1 category? Channels inside the category wont be deleted.").arg(root.contentItem.categoryName.input.text)
})
}
}
Item {
height: 8
width: parent.width
@ -212,6 +190,17 @@ StatusModal {
}
rightButtons: [
StatusButton {
visible: isEdit
type: StatusBaseButton.Type.Danger
text: qsTr("Delete Category")
onClicked: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
"header.title": qsTr("Delete '%1' category").arg(nameInput.text),
confirmationText: qsTr("Are you sure you want to delete '%1' category? Channels inside the category wont be deleted.").arg(nameInput.text)
})
}
},
StatusButton {
objectName: "createOrEditCommunityCategoryBtn"
enabled: isFormValid()

View File

@ -303,8 +303,8 @@ Item {
type: StatusAction.Type.Danger
onTriggered: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
title: qsTr("Delete %1 category").arg(categoryItem.name),
confirmationText: qsTr("Are you sure you want to delete %1 category? Channels inside the category won't be deleted.")
"header.title": qsTr("Delete '%1' category").arg(categoryItem.name),
confirmationText: qsTr("Are you sure you want to delete '%1' category? Channels inside the category won't be deleted.")
.arg(categoryItem.name),
categoryId: categoryItem.itemId
})