diff --git a/qml/ttrss/ubuntu-touch/Categories.qml b/qml/ttrss/ubuntu-touch/Categories.qml index 13149e9..a05ed02 100644 --- a/qml/ttrss/ubuntu-touch/Categories.qml +++ b/qml/ttrss/ubuntu-touch/Categories.qml @@ -33,7 +33,7 @@ Page { selectedIndex: settings.showAll ? 1 : 0 onSelectedIndexChanged: { var ttrss = rootWindow.getTTRSS() - var showAll = (categoriesPage.head.sections.selectedIndex == 1) + var showAll = (selectedIndex == 1) if (showAll != settings.showAll) { ttrss.setShowAll(showAll) settings.showAll = showAll @@ -43,7 +43,7 @@ Page { } } - UbuntuListView { + ListView { id: listView anchors.fill: parent @@ -62,10 +62,9 @@ Page { } */ - pullToRefresh { - enabled: true - onRefresh: categories.update() - refreshing: network.loading + MyPullToRefresh { + id: pullToRefresh + updating: network.loading } delegate: CategoryDelegate { @@ -82,7 +81,7 @@ Page { rootWindow.showAll ? qsTr("No categories to display") : qsTr("No categories have unread items") } ActivityIndicator { - running: listView.count != 0 && network.loading + running: network.loading && !pullToRefresh.refreshing anchors.centerIn: parent } Scrollbar { diff --git a/qml/ttrss/ubuntu-touch/FeedItem.qml b/qml/ttrss/ubuntu-touch/FeedItem.qml index b2021ed..fd7cfbf 100644 --- a/qml/ttrss/ubuntu-touch/FeedItem.qml +++ b/qml/ttrss/ubuntu-touch/FeedItem.qml @@ -96,7 +96,7 @@ Item { width: parent.width text: parseContent(root.content, root.attachments) fontSize: settings.webviewFontSize - color: Theme.palette.selected.baseText + color: theme.palette.normal.foregroundText onLinkActivated: Qt.openUrlExternally(link) onPressAndHold: { var url = link ? link : root.url diff --git a/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml b/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml index 052c20a..d349efa 100644 --- a/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml +++ b/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml @@ -16,7 +16,7 @@ Page { id: root property bool isCat: false - property var model + property alias model: listView.model property int currentIndex: -1 property alias currentItem: listView.currentItem @@ -24,7 +24,6 @@ Page { header: PageHeader { title: currentItem ? currentItem.title : "" - flickable: currentItem ? currentItem.flickable : null trailingActionBar.actions: [ Action { iconSource: "../resources/ic_star_"+(currentItem.marked?"enabled":"disabled")+".png" @@ -46,7 +45,7 @@ Page { anchors.fill: parent orientation: ListView.Horizontal snapMode: ListView.SnapOneItem - highlightFollowsCurrentItem: false + highlightFollowsCurrentItem: true highlightRangeMode: ListView.StrictlyEnforceRange delegate: FeedItem { @@ -66,20 +65,27 @@ Page { onCurrentIndexChanged: { model.selectedIndex = currentIndex - if (currentItem && settings.autoMarkRead && currentItem.unread) { - console.log("marking item as read") - model.toggleRead() + if (settings.autoMarkRead) { + readTimer.restart() } panel.close() } } Component.onCompleted: { - /* For some reason, unless this is done here, the ListView would - * instantiate all the delegates when the page is first shown. */ - listView.model = root.model + /* We don't use an alias on the current index, in order to perform the + * autoread action when the index changes. */ listView.currentIndex = root.currentIndex - listView.highlightFollowsCurrentItem = true + } + + Timer { + id: readTimer + interval: 500 + repeat: false + onTriggered: if (currentItem && currentItem.unread) { + console.log("marking item as read") + model.toggleRead() + } } Panel { @@ -93,7 +99,7 @@ Page { Rectangle { anchors.fill: parent - color: Theme.palette.normal.overlay + color: theme.palette.normal.overlay ToolbarItems { anchors.fill: parent ToolbarButton { diff --git a/qml/ttrss/ubuntu-touch/FeedItems.qml b/qml/ttrss/ubuntu-touch/FeedItems.qml index 6a52d1e..dd82237 100644 --- a/qml/ttrss/ubuntu-touch/FeedItems.qml +++ b/qml/ttrss/ubuntu-touch/FeedItems.qml @@ -44,7 +44,7 @@ Page { selectedIndex: settings.showAll ? 1 : 0 onSelectedIndexChanged: { var ttrss = rootWindow.getTTRSS() - var showAll = (feeditemsPage.head.sections.selectedIndex == 1) + var showAll = (selectedIndex == 1) if (showAll != settings.showAll) { ttrss.setShowAll(showAll) settings.showAll = showAll diff --git a/qml/ttrss/ubuntu-touch/Feeds.qml b/qml/ttrss/ubuntu-touch/Feeds.qml index 315306a..77ea608 100644 --- a/qml/ttrss/ubuntu-touch/Feeds.qml +++ b/qml/ttrss/ubuntu-touch/Feeds.qml @@ -22,8 +22,6 @@ Page { var ttrss = rootWindow.getTTRSS() ttrss.setShowAll(settings.showAll) feedModel.update() - // FIXME workaround for https://bugs.launchpad.net/bugs/1404884 - pullToRefresh.enabled = true } header: PageHeader { @@ -42,7 +40,7 @@ Page { selectedIndex: settings.showAll ? 1 : 0 onSelectedIndexChanged: { var ttrss = rootWindow.getTTRSS() - var showAll = (feedsPage.head.sections.selectedIndex == 1) + var showAll = (selectedIndex == 1) if (showAll != settings.showAll) { ttrss.setShowAll(showAll) settings.showAll = showAll @@ -57,11 +55,10 @@ Page { anchors.fill: parent model: feedModel - PullToRefresh { + MyPullToRefresh { id: pullToRefresh - enabled: false onRefresh: feedModel.update() - refreshing: network.loading + updating: network.loading } /* TODO @@ -145,6 +142,10 @@ Page { qsTr("Loading") : rootWindow.showAll ? qsTr("No feeds in category") : qsTr("Category has no unread items") } + ActivityIndicator { + running: network.loading && !pullToRefresh.refreshing + anchors.centerIn: parent + } Scrollbar { flickableItem: listView } diff --git a/qml/ttrss/ubuntu-touch/MyPullToRefresh.qml b/qml/ttrss/ubuntu-touch/MyPullToRefresh.qml new file mode 100644 index 0000000..727b9bf --- /dev/null +++ b/qml/ttrss/ubuntu-touch/MyPullToRefresh.qml @@ -0,0 +1,24 @@ +//Copyright Hauke Schade, 2012-2014 +// +//This file is part of TTRss. +// +//TTRss 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) any later version. +//TTRss 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 TTRss (on a Maemo/Meego system there is a copy +//in /usr/share/common-licenses. If not, see http://www.gnu.org/licenses/. + +import QtQuick 2.0 +import Ubuntu.Components 1.3 + +PullToRefresh { + id: root + + property bool updating: false + + property bool _wasPulled: false + onRefresh: _wasPulled = true + refreshing: _wasPulled && updating + onUpdatingChanged: if (!updating) _wasPulled = false +} diff --git a/ttrss-ubuntu.pro b/ttrss-ubuntu.pro index 36e4690..ed28a31 100644 --- a/ttrss-ubuntu.pro +++ b/ttrss-ubuntu.pro @@ -1,5 +1,5 @@ -VERSION = 0.5.2 -UBUNTU_REVISION = 2 +VERSION = 0.6.2 +UBUNTU_REVISION = 0 DEFINES += APP_VERSION=\\\"$$VERSION\\\" DEFINES += Q_OS_UBUNTU_TOUCH @@ -33,7 +33,7 @@ resources.files = images/resources resources.path = $${CLICK_DIR}/qml INSTALLS += resources -icon.files = ubuntu/ttrss.svg +icon.files = ubuntu/ttrss_icon_256.png icon.path = $${CLICK_DIR} INSTALLS += icon diff --git a/ubuntu/ttrss.desktop.in b/ubuntu/ttrss.desktop.in index c0c3bb3..cf2ed7f 100644 --- a/ubuntu/ttrss.desktop.in +++ b/ubuntu/ttrss.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Name=Tiny Tiny RSS Exec=./$${TARGET} -Icon=ttrss.svg +Icon=ttrss_icon_256.png Terminal=false Type=Application X-Ubuntu-Touch=true diff --git a/ubuntu/ttrss_icon_128.png b/ubuntu/ttrss_icon_128.png new file mode 100644 index 0000000..21e8e66 Binary files /dev/null and b/ubuntu/ttrss_icon_128.png differ diff --git a/ubuntu/ttrss_icon_256.png b/ubuntu/ttrss_icon_256.png new file mode 100644 index 0000000..3c3f9f7 Binary files /dev/null and b/ubuntu/ttrss_icon_256.png differ diff --git a/ubuntu/ttrss_icon_512.png b/ubuntu/ttrss_icon_512.png new file mode 100644 index 0000000..28f080c Binary files /dev/null and b/ubuntu/ttrss_icon_512.png differ