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
|
selectedIndex: settings.showAll ? 1 : 0
|
||||||
onSelectedIndexChanged: {
|
onSelectedIndexChanged: {
|
||||||
var ttrss = rootWindow.getTTRSS()
|
var ttrss = rootWindow.getTTRSS()
|
||||||
var showAll = (categoriesPage.head.sections.selectedIndex == 1)
|
var showAll = (selectedIndex == 1)
|
||||||
if (showAll != settings.showAll) {
|
if (showAll != settings.showAll) {
|
||||||
ttrss.setShowAll(showAll)
|
ttrss.setShowAll(showAll)
|
||||||
settings.showAll = showAll
|
settings.showAll = showAll
|
||||||
|
|
@ -43,7 +43,7 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UbuntuListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
|
@ -62,10 +62,9 @@ Page {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pullToRefresh {
|
MyPullToRefresh {
|
||||||
enabled: true
|
id: pullToRefresh
|
||||||
onRefresh: categories.update()
|
updating: network.loading
|
||||||
refreshing: network.loading
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: CategoryDelegate {
|
delegate: CategoryDelegate {
|
||||||
|
|
@ -82,7 +81,7 @@ Page {
|
||||||
rootWindow.showAll ? qsTr("No categories to display") : qsTr("No categories have unread items")
|
rootWindow.showAll ? qsTr("No categories to display") : qsTr("No categories have unread items")
|
||||||
}
|
}
|
||||||
ActivityIndicator {
|
ActivityIndicator {
|
||||||
running: listView.count != 0 && network.loading
|
running: network.loading && !pullToRefresh.refreshing
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
Scrollbar {
|
Scrollbar {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: parseContent(root.content, root.attachments)
|
text: parseContent(root.content, root.attachments)
|
||||||
fontSize: settings.webviewFontSize
|
fontSize: settings.webviewFontSize
|
||||||
color: Theme.palette.selected.baseText
|
color: theme.palette.normal.foregroundText
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
onPressAndHold: {
|
onPressAndHold: {
|
||||||
var url = link ? link : root.url
|
var url = link ? link : root.url
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Page {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool isCat: false
|
property bool isCat: false
|
||||||
property var model
|
property alias model: listView.model
|
||||||
property int currentIndex: -1
|
property int currentIndex: -1
|
||||||
property alias currentItem: listView.currentItem
|
property alias currentItem: listView.currentItem
|
||||||
|
|
||||||
|
|
@ -24,7 +24,6 @@ Page {
|
||||||
|
|
||||||
header: PageHeader {
|
header: PageHeader {
|
||||||
title: currentItem ? currentItem.title : ""
|
title: currentItem ? currentItem.title : ""
|
||||||
flickable: currentItem ? currentItem.flickable : null
|
|
||||||
trailingActionBar.actions: [
|
trailingActionBar.actions: [
|
||||||
Action {
|
Action {
|
||||||
iconSource: "../resources/ic_star_"+(currentItem.marked?"enabled":"disabled")+".png"
|
iconSource: "../resources/ic_star_"+(currentItem.marked?"enabled":"disabled")+".png"
|
||||||
|
|
@ -46,7 +45,7 @@ Page {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
orientation: ListView.Horizontal
|
orientation: ListView.Horizontal
|
||||||
snapMode: ListView.SnapOneItem
|
snapMode: ListView.SnapOneItem
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: true
|
||||||
highlightRangeMode: ListView.StrictlyEnforceRange
|
highlightRangeMode: ListView.StrictlyEnforceRange
|
||||||
|
|
||||||
delegate: FeedItem {
|
delegate: FeedItem {
|
||||||
|
|
@ -66,20 +65,27 @@ Page {
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
model.selectedIndex = currentIndex
|
model.selectedIndex = currentIndex
|
||||||
if (currentItem && settings.autoMarkRead && currentItem.unread) {
|
if (settings.autoMarkRead) {
|
||||||
console.log("marking item as read")
|
readTimer.restart()
|
||||||
model.toggleRead()
|
|
||||||
}
|
}
|
||||||
panel.close()
|
panel.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
/* For some reason, unless this is done here, the ListView would
|
/* We don't use an alias on the current index, in order to perform the
|
||||||
* instantiate all the delegates when the page is first shown. */
|
* autoread action when the index changes. */
|
||||||
listView.model = root.model
|
|
||||||
listView.currentIndex = root.currentIndex
|
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 {
|
Panel {
|
||||||
|
|
@ -93,7 +99,7 @@ Page {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Theme.palette.normal.overlay
|
color: theme.palette.normal.overlay
|
||||||
ToolbarItems {
|
ToolbarItems {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
ToolbarButton {
|
ToolbarButton {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ Page {
|
||||||
selectedIndex: settings.showAll ? 1 : 0
|
selectedIndex: settings.showAll ? 1 : 0
|
||||||
onSelectedIndexChanged: {
|
onSelectedIndexChanged: {
|
||||||
var ttrss = rootWindow.getTTRSS()
|
var ttrss = rootWindow.getTTRSS()
|
||||||
var showAll = (feeditemsPage.head.sections.selectedIndex == 1)
|
var showAll = (selectedIndex == 1)
|
||||||
if (showAll != settings.showAll) {
|
if (showAll != settings.showAll) {
|
||||||
ttrss.setShowAll(showAll)
|
ttrss.setShowAll(showAll)
|
||||||
settings.showAll = showAll
|
settings.showAll = showAll
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,6 @@ Page {
|
||||||
var ttrss = rootWindow.getTTRSS()
|
var ttrss = rootWindow.getTTRSS()
|
||||||
ttrss.setShowAll(settings.showAll)
|
ttrss.setShowAll(settings.showAll)
|
||||||
feedModel.update()
|
feedModel.update()
|
||||||
// FIXME workaround for https://bugs.launchpad.net/bugs/1404884
|
|
||||||
pullToRefresh.enabled = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header: PageHeader {
|
header: PageHeader {
|
||||||
|
|
@ -42,7 +40,7 @@ Page {
|
||||||
selectedIndex: settings.showAll ? 1 : 0
|
selectedIndex: settings.showAll ? 1 : 0
|
||||||
onSelectedIndexChanged: {
|
onSelectedIndexChanged: {
|
||||||
var ttrss = rootWindow.getTTRSS()
|
var ttrss = rootWindow.getTTRSS()
|
||||||
var showAll = (feedsPage.head.sections.selectedIndex == 1)
|
var showAll = (selectedIndex == 1)
|
||||||
if (showAll != settings.showAll) {
|
if (showAll != settings.showAll) {
|
||||||
ttrss.setShowAll(showAll)
|
ttrss.setShowAll(showAll)
|
||||||
settings.showAll = showAll
|
settings.showAll = showAll
|
||||||
|
|
@ -57,11 +55,10 @@ Page {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
model: feedModel
|
model: feedModel
|
||||||
|
|
||||||
PullToRefresh {
|
MyPullToRefresh {
|
||||||
id: pullToRefresh
|
id: pullToRefresh
|
||||||
enabled: false
|
|
||||||
onRefresh: feedModel.update()
|
onRefresh: feedModel.update()
|
||||||
refreshing: network.loading
|
updating: network.loading
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO
|
/* TODO
|
||||||
|
|
@ -145,6 +142,10 @@ Page {
|
||||||
qsTr("Loading") :
|
qsTr("Loading") :
|
||||||
rootWindow.showAll ? qsTr("No feeds in category") : qsTr("Category has no unread items")
|
rootWindow.showAll ? qsTr("No feeds in category") : qsTr("Category has no unread items")
|
||||||
}
|
}
|
||||||
|
ActivityIndicator {
|
||||||
|
running: network.loading && !pullToRefresh.refreshing
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
Scrollbar {
|
Scrollbar {
|
||||||
flickableItem: listView
|
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
|
VERSION = 0.6.2
|
||||||
UBUNTU_REVISION = 2
|
UBUNTU_REVISION = 0
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||||
|
|
||||||
DEFINES += Q_OS_UBUNTU_TOUCH
|
DEFINES += Q_OS_UBUNTU_TOUCH
|
||||||
|
|
@ -33,7 +33,7 @@ resources.files = images/resources
|
||||||
resources.path = $${CLICK_DIR}/qml
|
resources.path = $${CLICK_DIR}/qml
|
||||||
INSTALLS += resources
|
INSTALLS += resources
|
||||||
|
|
||||||
icon.files = ubuntu/ttrss.svg
|
icon.files = ubuntu/ttrss_icon_256.png
|
||||||
icon.path = $${CLICK_DIR}
|
icon.path = $${CLICK_DIR}
|
||||||
INSTALLS += icon
|
INSTALLS += icon
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Tiny Tiny RSS
|
Name=Tiny Tiny RSS
|
||||||
Exec=./$${TARGET}
|
Exec=./$${TARGET}
|
||||||
Icon=ttrss.svg
|
Icon=ttrss_icon_256.png
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
X-Ubuntu-Touch=true
|
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