Merge remote-tracking branch 'mardy/master'
This commit is contained in:
commit
e00d3544f7
11 changed files with 60 additions and 30 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
24
qml/ttrss/ubuntu-touch/MyPullToRefresh.qml
Normal file
24
qml/ttrss/ubuntu-touch/MyPullToRefresh.qml
Normal file
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
BIN
ubuntu/ttrss_icon_128.png
Normal file
BIN
ubuntu/ttrss_icon_128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
ubuntu/ttrss_icon_256.png
Normal file
BIN
ubuntu/ttrss_icon_256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
ubuntu/ttrss_icon_512.png
Normal file
BIN
ubuntu/ttrss_icon_512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
Loading…
Add table
Reference in a new issue