Port away from BasicListItem
This commit is contained in:
committed by
Tobias Fella
parent
091c8806db
commit
443661d113
@@ -16,6 +16,7 @@ Delegates.RoundedItemDelegate {
|
|||||||
required property url source
|
required property url source
|
||||||
|
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
|
signal selected()
|
||||||
|
|
||||||
padding: Kirigami.Units.largeSpacing
|
padding: Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
@@ -23,14 +24,21 @@ Delegates.RoundedItemDelegate {
|
|||||||
QQC2.ToolTip.text: text
|
QQC2.ToolTip.text: text
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
|
|
||||||
|
Accessible.onPressAction: selected();
|
||||||
|
Keys.onSpacePressed: selected();
|
||||||
|
Keys.onEnterPressed: selected();
|
||||||
|
|
||||||
onPressAndHold: root.contextMenuRequested()
|
onPressAndHold: root.contextMenuRequested()
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||||
acceptedDevices: PointerDevice.Mouse
|
onTapped: (eventPoint, button) => {
|
||||||
grabPermissions: PointerHandler.TakeOverForbidden
|
if (button === Qt.RightButton) {
|
||||||
gesturePolicy: TapHandler.WithinBounds
|
root.contextMenuRequested();
|
||||||
onTapped: root.contextMenuRequested()
|
} else {
|
||||||
|
root.selected();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: KirigamiComponents.Avatar {
|
contentItem: KirigamiComponents.Avatar {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import QtQuick.Layouts
|
|||||||
import QtQml
|
import QtQml
|
||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.kirigamiaddons.delegates as Delegates
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
Kirigami.Page {
|
Kirigami.Page {
|
||||||
@@ -48,14 +49,16 @@ Kirigami.Page {
|
|||||||
icon: "security-medium-symbolic"
|
icon: "security-medium-symbolic"
|
||||||
text: i18n("Waiting for other party to verify.")
|
text: i18n("Waiting for other party to verify.")
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
Delegates.RoundedItemDelegate {
|
||||||
id: emojiVerification
|
id: emojiVerification
|
||||||
text: "Emoji Verification"
|
text: i18n("Emoji Verification")
|
||||||
visible: root.session.state === KeyVerificationSession.READY
|
visible: root.session.state === KeyVerificationSession.READY
|
||||||
subtitle: i18n("Compare a set of emoji on both devices")
|
contentItem: Delegates.SubtitleContentItem {
|
||||||
onClicked: {
|
subtitle: i18n("Compare a set of emoji on both devices")
|
||||||
root.session.sendStartSas()
|
itemDelegate: emojiVerification
|
||||||
}
|
}
|
||||||
|
onClicked: root.session.sendStartSas()
|
||||||
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
Message {
|
Message {
|
||||||
visible: root.session.state === KeyVerificationSession.DONE
|
visible: root.session.state === KeyVerificationSession.DONE
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||||
|
import org.kde.kirigamiaddons.formcard as FormCard
|
||||||
|
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
@@ -20,8 +21,8 @@ Kirigami.Dialog {
|
|||||||
|
|
||||||
parent: applicationWindow().overlay
|
parent: applicationWindow().overlay
|
||||||
|
|
||||||
leftPadding: Kirigami.Units.smallSpacing
|
leftPadding: 0
|
||||||
rightPadding: Kirigami.Units.smallSpacing
|
rightPadding: 0
|
||||||
topPadding: 0
|
topPadding: 0
|
||||||
bottomPadding: 0
|
bottomPadding: 0
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ Kirigami.Dialog {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser
|
visible: !root.user.isLocalUser
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
text: room.connection.isIgnored(root.user.object) ? i18n("Unignore this user") : i18n("Ignore this user")
|
text: room.connection.isIgnored(root.user.object) ? i18n("Unignore this user") : i18n("Ignore this user")
|
||||||
@@ -85,7 +86,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser && room.canSendState("kick") && room.containsUser(root.user.id)
|
visible: !root.user.isLocalUser && room.canSendState("kick") && room.containsUser(root.user.id)
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
@@ -97,7 +99,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser && room.canSendState("invite") && !room.containsUser(root.user.id)
|
visible: !root.user.isLocalUser && room.canSendState("invite") && !room.containsUser(root.user.id)
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
@@ -110,7 +113,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser && room.canSendState("ban") && !room.isUserBanned(root.user.id)
|
visible: !root.user.isLocalUser && room.canSendState("ban") && !room.isUserBanned(root.user.id)
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
@@ -126,7 +130,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser && room.canSendState("ban") && room.isUserBanned(root.user.id)
|
visible: !root.user.isLocalUser && room.canSendState("ban") && room.isUserBanned(root.user.id)
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
@@ -139,7 +144,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
text: i18n("Set user power level")
|
text: i18n("Set user power level")
|
||||||
@@ -162,7 +168,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: root.user.isLocalUser || room.canSendState("redact")
|
visible: root.user.isLocalUser || room.canSendState("redact")
|
||||||
|
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
@@ -178,7 +185,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
visible: !root.user.isLocalUser
|
visible: !root.user.isLocalUser
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
text: i18n("Open a private chat")
|
text: i18n("Open a private chat")
|
||||||
@@ -189,7 +197,8 @@ Kirigami.Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
text: i18n("Copy link")
|
text: i18n("Copy link")
|
||||||
icon.name: "username-copy"
|
icon.name: "username-copy"
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ 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.labs.components as KirigamiComponents
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||||
|
import org.kde.kirigamiaddons.formcard as FormCard
|
||||||
|
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
@@ -270,9 +271,9 @@ Loader {
|
|||||||
id: listViewAction
|
id: listViewAction
|
||||||
model: actionLayout.actions
|
model: actionLayout.actions
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
FormCard.FormButtonDelegate {
|
||||||
icon: modelData.icon.name
|
icon.name: modelData.icon.name
|
||||||
iconColor: modelData.icon.color ?? undefined
|
icon.color: modelData.icon.color ?? undefined
|
||||||
enabled: modelData.enabled
|
enabled: modelData.enabled
|
||||||
visible: modelData.visible
|
visible: modelData.visible
|
||||||
text: modelData.text
|
text: modelData.text
|
||||||
@@ -280,7 +281,6 @@ Loader {
|
|||||||
modelData.triggered()
|
modelData.triggered()
|
||||||
root.item.close();
|
root.item.close();
|
||||||
}
|
}
|
||||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -353,9 +353,9 @@ Loader {
|
|||||||
id: listViewAction
|
id: listViewAction
|
||||||
model: root.actions
|
model: root.actions
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
FormCard.FormButtonDelegate {
|
||||||
icon: modelData.icon.name
|
icon.name: modelData.icon.name
|
||||||
iconColor: modelData.icon.color ?? undefined
|
icon.color: modelData.icon.color ?? undefined
|
||||||
enabled: modelData.enabled
|
enabled: modelData.enabled
|
||||||
visible: modelData.visible
|
visible: modelData.visible
|
||||||
text: modelData.text
|
text: modelData.text
|
||||||
@@ -363,17 +363,15 @@ Loader {
|
|||||||
modelData.triggered()
|
modelData.triggered()
|
||||||
root.item.close();
|
root.item.close();
|
||||||
}
|
}
|
||||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.nestedActions
|
model: root.nestedActions
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
FormCard.FormButtonDelegate {
|
||||||
action: modelData
|
action: modelData
|
||||||
visible: modelData.visible
|
visible: modelData.visible
|
||||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
stackView.push(nestedActionsComponent, {
|
stackView.push(nestedActionsComponent, {
|
||||||
title: modelData.text,
|
title: modelData.text,
|
||||||
|
|||||||
@@ -52,13 +52,17 @@ Delegates.RoundedItemDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
Components.Avatar {
|
Components.Avatar {
|
||||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 2
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 2
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
source: root.avatarUrl
|
source: root.avatarUrl
|
||||||
name: root.displayName
|
name: root.displayName
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import QtQuick.Layouts
|
|||||||
import Qt.labs.qmlmodels
|
import Qt.labs.qmlmodels
|
||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
|
import org.kde.kirigamiaddons.delegates as Delegates
|
||||||
|
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
@@ -92,34 +92,53 @@ Kirigami.ScrollablePage {
|
|||||||
id: serverListModel
|
id: serverListModel
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Kirigami.BasicListItem {
|
delegate: Delegates.RoundedItemDelegate {
|
||||||
id: serverItem
|
id: serverItem
|
||||||
|
|
||||||
label: isAddServerDelegate ? i18n("Add New Server") : url
|
required property int index
|
||||||
subtitle: isHomeServer ? i18n("Home Server") : ""
|
required property string url
|
||||||
|
required property bool isAddServerDelegate
|
||||||
|
required property bool isHomeServer
|
||||||
|
required property bool isDeletable
|
||||||
|
|
||||||
|
text: isAddServerDelegate ? i18n("Add New Server") : url
|
||||||
|
highlighted: false
|
||||||
|
|
||||||
|
topInset: index === 0 ? Kirigami.Units.smallSpacing : Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
bottomInset: index === ListView.view.count - 1 ? Kirigami.Units.smallSpacing : Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
|
||||||
onClicked: if (isAddServerDelegate) {
|
onClicked: if (isAddServerDelegate) {
|
||||||
addServerSheet.open()
|
addServerSheet.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
trailing: QQC2.ToolButton {
|
contentItem: RowLayout {
|
||||||
visible: isAddServerDelegate || isDeletable
|
spacing: Kirigami.Units.smallSpacing
|
||||||
icon.name: isAddServerDelegate ? "list-add" : "dialog-close"
|
|
||||||
text: i18n("Add new server")
|
|
||||||
Accessible.name: text
|
|
||||||
display: QQC2.AbstractButton.IconOnly
|
|
||||||
|
|
||||||
onClicked: {
|
Delegates.SubtitleContentItem {
|
||||||
if (serverField.currentIndex === index && isDeletable) {
|
itemDelegate: serverItem
|
||||||
serverField.currentIndex = 0
|
subtitle: serverItem.isHomeServer ? i18n("Home Server") : ""
|
||||||
server = serverField.currentValue
|
Layout.fillWidth: true
|
||||||
serverField.popup.close()
|
}
|
||||||
}
|
|
||||||
if (isAddServerDelegate) {
|
QQC2.ToolButton {
|
||||||
addServerSheet.open()
|
visible: serverItem.isAddServerDelegate || serverItem.isDeletable
|
||||||
serverItem.clicked()
|
icon.name: serverItem.isAddServerDelegate ? "list-add" : "dialog-close"
|
||||||
} else {
|
text: i18nc("@action:button", "Add new server")
|
||||||
serverListModel.removeServerAtIndex(index)
|
Accessible.name: text
|
||||||
|
display: QQC2.AbstractButton.IconOnly
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (serverField.currentIndex === serverItem.index && serverItem.isDeletable) {
|
||||||
|
serverField.currentIndex = 0;
|
||||||
|
server = serverField.currentValue;
|
||||||
|
serverField.popup.close();
|
||||||
|
}
|
||||||
|
if (serverItem.isAddServerDelegate) {
|
||||||
|
addServerSheet.open();
|
||||||
|
serverItem.clicked();
|
||||||
|
} else {
|
||||||
|
serverListModel.removeServerAtIndex(serverItem.index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,8 +229,10 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: publicRoomsListView
|
id: publicRoomsListView
|
||||||
topMargin: Kirigami.Units.smallSpacing
|
|
||||||
clip: true
|
topMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
bottomMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
|
||||||
model: PublicRoomListModel {
|
model: PublicRoomListModel {
|
||||||
id: publicRoomListModel
|
id: publicRoomListModel
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ QQC2.Control {
|
|||||||
text: displayName
|
text: displayName
|
||||||
source: avatar ? ("image://mxc/" + avatar) : ""
|
source: avatar ? ("image://mxc/" + avatar) : ""
|
||||||
|
|
||||||
onClicked: root.selectedSpaceId = roomId
|
onSelected: root.selectedSpaceId = roomId
|
||||||
checked: root.selectedSpaceId === roomId
|
checked: root.selectedSpaceId === roomId
|
||||||
onContextMenuRequested: root.createContextMenu(currentRoom)
|
onContextMenuRequested: root.createContextMenu(currentRoom)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ 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.labs.components as KirigamiComponents
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||||
|
import org.kde.kirigamiaddons.formcard as FormCard
|
||||||
|
|
||||||
import org.kde.neochat
|
import org.kde.neochat
|
||||||
|
|
||||||
@@ -79,13 +80,16 @@ Loader {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: popupContent
|
id: popupContent
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: headerLayout
|
id: headerLayout
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.largeSpacing
|
Layout.margins: Kirigami.Units.largeSpacing
|
||||||
spacing: Kirigami.Units.largeSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
id: avatar
|
id: avatar
|
||||||
source: room.avatarMediaId ? ("image://mxc/" + room.avatarMediaId) : ""
|
source: room.avatarMediaId ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||||
@@ -93,22 +97,40 @@ Loader {
|
|||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Heading {
|
Kirigami.Heading {
|
||||||
level: 5
|
level: 5
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: room.displayName
|
text: room.displayName
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QQC2.ToolButton {
|
FormCard.FormButtonDelegate {
|
||||||
icon.name: 'settings-configure'
|
text: i18nc("'Space' is a matrix space", "View Space")
|
||||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/Categories.qml', {room: room, connection: root.connection}, { title: i18n("Space Settings") })
|
icon.name: "view-list-details"
|
||||||
|
onClicked: RoomManager.enterRoom(room);
|
||||||
|
}
|
||||||
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18nc("@action:inmenu", "Copy Address to Clipboard")
|
||||||
|
icon.name: "edit-copy"
|
||||||
|
onClicked: if (room.canonicalAlias.length === 0) {
|
||||||
|
Clipboard.saveText(room.id);
|
||||||
|
} else {
|
||||||
|
Clipboard.saveText(room.canonicalAlias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.BasicListItem {
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18nc("'Space' is a matrix space", "Space Settings")
|
||||||
|
icon.name: 'settings-configure'
|
||||||
|
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/Categories.qml', {room: room, connection: connection}, { title: i18n("Space Settings") })
|
||||||
|
}
|
||||||
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
text: i18nc("'Space' is a matrix space", "Leave Space")
|
text: i18nc("'Space' is a matrix space", "Leave Space")
|
||||||
onClicked: RoomManager.leaveRoom(room)
|
onClicked: RoomManager.leaveRoom(room)
|
||||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClosed: root.closed()
|
onClosed: root.closed()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import QtQuick.Layouts
|
|||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.sonnet as Sonnet
|
import org.kde.sonnet as Sonnet
|
||||||
import org.kde.kirigamiaddons.formcard as FormCard
|
import org.kde.kirigamiaddons.formcard as FormCard
|
||||||
|
import org.kde.kirigamiaddons.delegates as Delegates
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
id: root
|
id: root
|
||||||
@@ -170,19 +171,39 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ListView {
|
ListView {
|
||||||
|
topMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
bottomMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
|
||||||
model: settings.currentIgnoreList
|
model: settings.currentIgnoreList
|
||||||
delegate: Kirigami.BasicListItem {
|
delegate: Delegates.RoundedItemDelegate {
|
||||||
label: model.modelData
|
id: wordDelegate
|
||||||
trailing: QQC2.ToolButton {
|
|
||||||
icon.name: "delete"
|
required property var modelData
|
||||||
onClicked: {
|
|
||||||
remove(modelData)
|
text: modelData
|
||||||
if (instantApply) {
|
|
||||||
settings.save();
|
contentItem: RowLayout {
|
||||||
}
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
|
Delegates.DefaultContentItem {
|
||||||
|
itemDelegate: wordDelegate
|
||||||
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
QQC2.ToolTip {
|
|
||||||
text: i18n("Delete word")
|
QQC2.ToolButton {
|
||||||
|
text: i18nc("@action:button", "Delete word")
|
||||||
|
icon.name: "delete"
|
||||||
|
display: QQC2.ToolButton.IconOnly
|
||||||
|
onClicked: {
|
||||||
|
remove(wordDelegate.modelData);
|
||||||
|
if (instantApply) {
|
||||||
|
settings.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
QQC2.ToolTip.delay: Kirigami.ToolTip.toolTipDelay
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user