Improve feed refreshing

This commit is contained in:
Tobias Fella 2020-07-30 19:53:28 +02:00
parent 6dc1ef11e2
commit a35ccfc7d8
4 changed files with 12 additions and 52 deletions

View File

@ -41,8 +41,10 @@ ColumnLayout {
width: parent.width
height: root.height * 0.2
FeedImage {
feed: page.feed
Kirigami.Icon {
source: Fetcher.image(page.feed.image)
width: height
height: parent.height
}
ColumnLayout {

View File

@ -37,9 +37,16 @@ Kirigami.ScrollablePage {
onRefreshingChanged:
if(refreshing) {
feed.refresh()
refreshing = false
}
Connections {
target: feed
function onRefreshingChanged(refreshing) {
if(!refreshing)
page.refreshing = refreshing
}
}
contextualActions: [
Kirigami.Action {
iconName: "help-about-symbolic"

View File

@ -1,48 +0,0 @@
/**
* Copyright 2020 Tobias Fella <fella@posteo.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.14
import QtQuick.Controls 2.14 as Controls
import QtQuick.Layouts 1.14
import org.kde.kirigami 2.12 as Kirigami
import org.kde.alligator 1.0
Item {
id: icon
width: height
height: parent.height
property QtObject feed
Kirigami.Icon {
source: feed.image === "" ? "rss" : Fetcher.image(feed.image)
width: height
height: parent.height
visible: !busy.visible
}
Controls.BusyIndicator {
id: busy
width: height
height: parent.height
visible: feed.refreshing
}
}

View File

@ -10,7 +10,6 @@
<file alias="EntryListDelegate.qml">qml/EntryListDelegate.qml</file>
<file alias="AddFeedSheet.qml">qml/AddFeedSheet.qml</file>
<file alias="FeedListDelegate.qml">qml/FeedListDelegate.qml</file>
<file alias="FeedImage.qml">qml/FeedImage.qml</file>
<file>qtquickcontrols2.conf</file>
</qresource>
</RCC>