Add OverlaySheet with actions on FeedList

This commit is contained in:
Bart De Vries 2021-04-29 13:32:34 +02:00
parent 1ebbafc87f
commit 16a5cfbcf9
3 changed files with 36 additions and 35 deletions

View File

@ -61,6 +61,7 @@ if(ANDROID)
media-playback-pause
source-playlist
arrow-down
overflow-menu
)
else()
target_link_libraries(alligator PRIVATE Qt5::Widgets)

View File

@ -97,8 +97,6 @@ Controls.ItemDelegate {
elide: Text.ElideRight
}
}
}
MouseArea {
@ -133,7 +131,6 @@ Controls.ItemDelegate {
Rectangle {
id: actionsRectangle
visible: false //TODO: temporary hack
anchors.fill: actionsButton
color: "black"
opacity: 0.5
@ -142,7 +139,6 @@ Controls.ItemDelegate {
Controls.Button {
id: actionsButton
visible: false //TODO: temporary hack
anchors.right: img.right
anchors.bottom: img.bottom
anchors.margins: 0
@ -150,26 +146,7 @@ Controls.ItemDelegate {
flat: true
icon.name: "overflow-menu"
icon.color: "white"
}
Kirigami.ActionToolBar {
anchors.right: img.right
anchors.left: img.left
anchors.bottom: img.bottom
anchors.margins: 0
padding: 0
actions: [
Kirigami.Action {
icon.name: "delete"
displayHint: Kirigami.Action.DisplayHint.AlwaysHide
onTriggered: {
if(pageStack.depth > 1 && feed.url === lastFeed)
while(pageStack.depth > 1)
pageStack.pop()
feedsModel.removeFeed(index)
}
}
]
onClicked: actionOverlay.open()
}
// Rounded edges
@ -188,17 +165,40 @@ Controls.ItemDelegate {
}
}
/*actions: [
Kirigami.Action {
icon.name: "delete"
onTriggered: {
if(pageStack.depth > 1 && feed.url === lastFeed)
while(pageStack.depth > 1)
pageStack.pop()
feedsModel.removeFeed(index)
}
Kirigami.OverlaySheet {
id: actionOverlay
parent: applicationWindow().overlay
showCloseButton: true
header: Kirigami.Heading {
text: feed.name
level: 2
wrapMode: Text.Wrap
}
]*/
contentItem: ColumnLayout {
RowLayout {
Layout.preferredWidth: Kirigami.Units.gridUnit * 20
spacing: 0
Kirigami.BasicListItem {
Layout.fillWidth: true
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
iconSize: Kirigami.Units.gridUnit
leftPadding: Kirigami.Units.smallSpacing
rightPadding: 0
onClicked: {
if(pageStack.depth > 1 && feed.url === lastFeed)
while(pageStack.depth > 1)
pageStack.pop()
DataManager.removeFeed(feed)
actionOverlay.close();
}
icon: "delete"
text: i18n("Remove feed")
}
}
}
}
}

View File

@ -58,7 +58,7 @@ Kirigami.ScrollablePage {
}
}
AddFeedSheet {
AddFeedSheet {
id: addSheet
}