Fix actions in ListItems
Apparently the combination of SwipeListItem and BasicListItem is evil, so port away from it to ensure that actions show up again.
This commit is contained in:
@@ -23,13 +23,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
model: AccountRegistry
|
model: AccountRegistry
|
||||||
delegate: Kirigami.SwipeListItem {
|
delegate: Kirigami.BasicListItem {
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
Kirigami.BasicListItem {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
|
|
||||||
text: model.connection.localUser.displayName
|
text: model.connection.localUser.displayName
|
||||||
labelItem.textFormat: Text.PlainText
|
labelItem.textFormat: Text.PlainText
|
||||||
subtitle: model.connection.localUserId
|
subtitle: model.connection.localUserId
|
||||||
@@ -39,17 +33,22 @@ Kirigami.ScrollablePage {
|
|||||||
Controller.activeConnection = model.connection
|
Controller.activeConnection = model.connection
|
||||||
pageStack.layers.pop()
|
pageStack.layers.pop()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
actions: [
|
trailing: RowLayout {
|
||||||
Kirigami.Action {
|
Controls.ToolButton {
|
||||||
|
display: Controls.AbstractButton.IconOnly
|
||||||
|
action: Kirigami.Action {
|
||||||
text: i18n("Edit this account")
|
text: i18n("Edit this account")
|
||||||
iconName: "document-edit"
|
iconName: "document-edit"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
userEditSheet.connection = model.connection
|
userEditSheet.connection = model.connection
|
||||||
userEditSheet.open()
|
userEditSheet.open()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Kirigami.Action {
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
|
display: Controls.AbstractButton.IconOnly
|
||||||
|
action: Kirigami.Action {
|
||||||
text: i18n("Logout")
|
text: i18n("Logout")
|
||||||
iconName: "im-kick-user"
|
iconName: "im-kick-user"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
@@ -58,7 +57,8 @@ Kirigami.ScrollablePage {
|
|||||||
pageStack.layers.pop()
|
pageStack.layers.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,19 +26,14 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Kirigami.SwipeListItem {
|
delegate: Kirigami.BasicListItem {
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
Kirigami.BasicListItem {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
|
|
||||||
text: model.displayName
|
text: model.displayName
|
||||||
subtitle: model.id
|
subtitle: model.id
|
||||||
icon: "network-connect"
|
icon: "network-connect"
|
||||||
}
|
trailing: RowLayout {
|
||||||
actions: [
|
Controls.ToolButton {
|
||||||
Kirigami.Action {
|
display: Controls.AbstractButton.IconOnly
|
||||||
|
action: Kirigami.Action {
|
||||||
text: i18n("Edit device name")
|
text: i18n("Edit device name")
|
||||||
iconName: "document-edit"
|
iconName: "document-edit"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
@@ -46,8 +41,11 @@ Kirigami.ScrollablePage {
|
|||||||
renameSheet.name = model.displayName
|
renameSheet.name = model.displayName
|
||||||
renameSheet.open()
|
renameSheet.open()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Kirigami.Action {
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
|
display: Controls.AbstractButton.IconOnly
|
||||||
|
action: Kirigami.Action {
|
||||||
text: i18n("Logout device")
|
text: i18n("Logout device")
|
||||||
iconName: "edit-delete-remove"
|
iconName: "edit-delete-remove"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
@@ -55,7 +53,8 @@ Kirigami.ScrollablePage {
|
|||||||
passwordSheet.open()
|
passwordSheet.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user