Fix qml warnings in RoomSortParameterDialog
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
||||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||||
|
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls as QQC2
|
import QtQuick.Controls as QQC2
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.kirigamiaddons.delegates as Delegates
|
import org.kde.kirigamiaddons.delegates as Delegates
|
||||||
import org.kde.kirigamiaddons.formcard as FormCard
|
|
||||||
|
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
@@ -21,8 +22,8 @@ Kirigami.Dialog {
|
|||||||
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
header.background.children[0].visible = true
|
(header as QQC2.Control).background.children[0].visible = true
|
||||||
footer.background.children[0].visible = true
|
(footer as QQC2.Control).background.children[0].visible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
@@ -109,7 +110,7 @@ Kirigami.Dialog {
|
|||||||
text: i18nc("@action:button", "Add parameter")
|
text: i18nc("@action:button", "Add parameter")
|
||||||
icon.name: "list-add"
|
icon.name: "list-add"
|
||||||
|
|
||||||
onClicked: addParameterDialogComponent.createObject(root).open()
|
onClicked: (addParameterDialogComponent.createObject(root) as Kirigami.Dialog).open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,37 +128,36 @@ Kirigami.Dialog {
|
|||||||
standardButtons: Kirigami.Dialog.Cancel
|
standardButtons: Kirigami.Dialog.Cancel
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
header.background.children[0].visible = true
|
(header as QQC2.Control).background.children[0].visible = true
|
||||||
footer.background.children[0].visible = true
|
(footer as QQC2.Control).background.children[0].visible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: QQC2.ScrollView {
|
contentItem: QQC2.ScrollView {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
|
||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
model: roomSortParameterModel.allParameterModel()
|
model: roomSortParameterModel.allParameterModel()
|
||||||
|
|
||||||
delegate: Delegates.RoundedItemDelegate {
|
delegate: Delegates.RoundedItemDelegate {
|
||||||
id: parameterDelegate
|
id: addParameterDelegate
|
||||||
required property string name
|
required property string name
|
||||||
required property string description
|
required property string description
|
||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
width: parent?.width ?? 0
|
width: parent?.width ?? 0
|
||||||
|
|
||||||
text: parameterDelegate.name
|
text: addParameterDelegate.name
|
||||||
|
|
||||||
contentItem: Delegates.SubtitleContentItem {
|
contentItem: Delegates.SubtitleContentItem {
|
||||||
itemDelegate: parameterDelegate
|
itemDelegate: addParameterDelegate
|
||||||
subtitle: parameterDelegate.description
|
subtitle: addParameterDelegate.description
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
roomSortParameterModel.addParameter(parameterDelegate.index)
|
roomSortParameterModel.addParameter(addParameterDelegate.index)
|
||||||
addParameterDialog.close()
|
addParameterDialog.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user