mirror of https://github.com/KDE/kasts.git
Move feed update action to header on desktop
The refresh buttons currently show up as main action buttons at the bottom on desktop since they are placed inside SwipeViews/tabs. Move these actions to the hierarchical parent ScrollablePages so they end up in the header bar.
This commit is contained in:
parent
ef2df0ef11
commit
eec54d3095
|
@ -19,6 +19,13 @@ Kirigami.Page {
|
||||||
title: i18n("Downloads")
|
title: i18n("Downloads")
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
|
actions.main: Kirigami.Action {
|
||||||
|
iconName: "view-refresh"
|
||||||
|
text: i18n("Refresh All Podcasts")
|
||||||
|
visible: !Kirigami.Settings.isMobile
|
||||||
|
onTriggered: Fetcher.fetchAll()
|
||||||
|
}
|
||||||
|
|
||||||
header: Loader {
|
header: Loader {
|
||||||
id: headerLoader
|
id: headerLoader
|
||||||
active: !Kirigami.Settings.isMobile
|
active: !Kirigami.Settings.isMobile
|
||||||
|
@ -57,9 +64,16 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.SwipeView {
|
contentItem: Controls.SwipeView {
|
||||||
id: swipeView
|
id: swipeView
|
||||||
anchors.fill: parent
|
|
||||||
|
anchors {
|
||||||
|
top: page.header.bottom
|
||||||
|
right: page.right
|
||||||
|
left: page.left
|
||||||
|
bottom: page.footer.top
|
||||||
|
}
|
||||||
|
|
||||||
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
|
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
|
||||||
|
|
||||||
EpisodeListPage {
|
EpisodeListPage {
|
||||||
|
|
|
@ -30,7 +30,7 @@ Kirigami.ScrollablePage {
|
||||||
iconName: "view-refresh"
|
iconName: "view-refresh"
|
||||||
text: i18n("Refresh All Podcasts")
|
text: i18n("Refresh All Podcasts")
|
||||||
onTriggered: refreshing = true
|
onTriggered: refreshing = true
|
||||||
visible: !Kirigami.Settings.isMobile || episodeList.count === 0
|
visible: Kirigami.Settings.isMobile && episodeList.count === 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.PlaceholderMessage {
|
Kirigami.PlaceholderMessage {
|
||||||
|
|
|
@ -19,6 +19,13 @@ Kirigami.Page {
|
||||||
title: i18n("Episode List")
|
title: i18n("Episode List")
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
|
actions.main: Kirigami.Action {
|
||||||
|
iconName: "view-refresh"
|
||||||
|
text: i18n("Refresh All Podcasts")
|
||||||
|
visible: !Kirigami.Settings.isMobile
|
||||||
|
onTriggered: Fetcher.fetchAll()
|
||||||
|
}
|
||||||
|
|
||||||
header: Loader {
|
header: Loader {
|
||||||
id: headerLoader
|
id: headerLoader
|
||||||
active: !Kirigami.Settings.isMobile
|
active: !Kirigami.Settings.isMobile
|
||||||
|
@ -52,9 +59,16 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.SwipeView {
|
contentItem: Controls.SwipeView {
|
||||||
id: swipeView
|
id: swipeView
|
||||||
anchors.fill: parent
|
|
||||||
|
anchors {
|
||||||
|
top: page.header.bottom
|
||||||
|
right: page.right
|
||||||
|
left: page.left
|
||||||
|
bottom: page.footer.top
|
||||||
|
}
|
||||||
|
|
||||||
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
|
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
|
||||||
|
|
||||||
EpisodeListPage {
|
EpisodeListPage {
|
||||||
|
|
Loading…
Reference in New Issue