[Sialfish] UI improvements
This commit is contained in:
parent
1abd792d45
commit
b8791ff665
12 changed files with 302 additions and 273 deletions
|
|
@ -109,11 +109,11 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
Separator {
|
||||
/*Separator {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Theme.primaryColor
|
||||
}
|
||||
}*/
|
||||
|
||||
Label {
|
||||
wrapMode: Text.WordWrap
|
||||
|
|
@ -129,7 +129,6 @@ Page {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
textFormat: Text.RichText
|
||||
text: qsTr("This software is distributed under the terms of the "+
|
||||
"GNU General Public Licence version 3.")
|
||||
MouseArea {
|
||||
|
|
@ -142,11 +141,24 @@ Page {
|
|||
|
||||
}
|
||||
|
||||
Separator {
|
||||
/*Label {
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.HorizontalFit
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
text: qsTr("Be aware that Kaktus is an UNOFFICIAL application. It means 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.")
|
||||
|
||||
}*/
|
||||
|
||||
/*Separator {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Theme.primaryColor
|
||||
}
|
||||
}*/
|
||||
|
||||
Item {
|
||||
height: Theme.paddingLarge
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ Page {
|
|||
description: 'Old Reader is supported as new feed aggreagator.'
|
||||
}
|
||||
|
||||
LogItem {
|
||||
title: 'Many small improvements and bug fixes'
|
||||
description: 'Many improvements, like performance optimization and UI polishing were made.'
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: qsTr("Version %1").arg("1.4")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ ListItem {
|
|||
property int readlater: 0
|
||||
property string content
|
||||
property string image
|
||||
property bool friendStream
|
||||
property string feedIcon
|
||||
property string feedTitle
|
||||
property int maxWords: 20
|
||||
|
|
@ -38,6 +39,7 @@ ListItem {
|
|||
property bool broadcast
|
||||
property bool liked
|
||||
property bool fresh
|
||||
property string annotations
|
||||
property bool expanded: false
|
||||
property int index
|
||||
property bool last: false
|
||||
|
|
@ -47,6 +49,7 @@ ListItem {
|
|||
|
||||
property bool hidden: read>0 && readlater==0
|
||||
property bool showIcon: settings.viewMode==1 || settings.viewMode==3 || settings.viewMode==4 || settings.viewMode==5 ? true : false
|
||||
property bool defaultIcon: feedIcon === "http://s.theoldreader.com/icons/user_icon.png"
|
||||
|
||||
signal markedAsRead
|
||||
signal markedAsUnread
|
||||
|
|
@ -57,6 +60,22 @@ ListItem {
|
|||
|
||||
enabled: !last && !daterow
|
||||
|
||||
Component.onCompleted: {
|
||||
var r = feedTitle.length>0 ? (Math.abs(feedTitle.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = feedTitle.length>1 ? (Math.abs(feedTitle.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = feedTitle.length>2 ? (Math.abs(feedTitle.charCodeAt(2)-65)/57)%1 : 1;
|
||||
var colorBg = Qt.rgba(r,g,b,0.9);
|
||||
var colorFg = (r+g+b)>1.5 ? Theme.highlightDimmerColor : Theme.primaryColor;
|
||||
|
||||
iconPlaceholder.color = colorBg;
|
||||
iconPlaceholderLabel.color = colorFg;
|
||||
|
||||
if (defaultIcon)
|
||||
icon.source = "image://icons/friend?" + colorFg;
|
||||
else
|
||||
icon.source = root.feedIcon !== "" ? cache.getUrlbyUrl(root.feedIcon) : "";
|
||||
}
|
||||
|
||||
function getUrlbyUrl(url){return cache.getUrlbyUrl(url)}
|
||||
|
||||
menu: last ? null : contextMenu
|
||||
|
|
@ -125,38 +144,6 @@ ListItem {
|
|||
}
|
||||
}
|
||||
|
||||
/*BackgroundItem {
|
||||
id: like
|
||||
anchors.right: background.right; anchors.top: star.bottom
|
||||
height: Theme.iconSizeSmall+2*Theme.paddingMedium
|
||||
width: height
|
||||
visible: root.liked
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent;
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
source: root.down ? "image://theme/icon-m-like?"+Theme.highlightColor :
|
||||
"image://theme/icon-m-like?"+Theme.primaryColor
|
||||
}
|
||||
}
|
||||
|
||||
BackgroundItem {
|
||||
id: broadcast
|
||||
anchors.right: background.right; anchors.top: star.bottom
|
||||
height: Theme.iconSizeSmall+2*Theme.paddingMedium
|
||||
width: height
|
||||
visible: root.broadcast
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent;
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
source: root.down ? "image://theme/icon-m-share?"+Theme.highlightColor :
|
||||
"image://theme/icon-m-share?"+Theme.primaryColor
|
||||
}
|
||||
}*/
|
||||
|
||||
Item {
|
||||
id: dateRowbox
|
||||
visible: daterow
|
||||
|
|
@ -251,30 +238,20 @@ ListItem {
|
|||
anchors.left: parent.left;
|
||||
anchors.top: titleLabel.top; anchors.topMargin: Theme.paddingSmall
|
||||
y: Theme.paddingMedium
|
||||
visible: !icon.visible && root.showIcon
|
||||
visible: (root.defaultIcon || !icon.visible) && root.showIcon
|
||||
|
||||
Label {
|
||||
id: iconPlaceholderLabel
|
||||
anchors.centerIn: parent
|
||||
text: feedTitle.substring(0,1).toUpperCase()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
//console.log("showIcon", showIcon, "icon.visible", icon.visible);
|
||||
var r = feedTitle.length>0 ? (Math.abs(feedTitle.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = feedTitle.length>1 ? (Math.abs(feedTitle.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = feedTitle.length>2 ? (Math.abs(feedTitle.charCodeAt(2)-65)/57)%1 : 1;
|
||||
iconPlaceholder.color = Qt.rgba(r,g,b,0.9);
|
||||
iconPlaceholderLabel.color = (r+g+b)>1.5 ? Theme.highlightDimmerColor : Theme.primaryColor;
|
||||
visible: !root.defaultIcon
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: icon
|
||||
//color: Theme.secondaryColor
|
||||
//opacity: 0.3
|
||||
color: "white"
|
||||
visible: icon.visible
|
||||
visible: icon.visible && !root.defaultIcon
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
@ -285,24 +262,6 @@ ListItem {
|
|||
anchors.top: titleLabel.top; anchors.topMargin: Theme.paddingSmall
|
||||
visible: status!=Image.Error && status!=Image.Null && root.showIcon
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: settings
|
||||
onShowTabIconsChanged: {
|
||||
if (root.feedIcon!="")
|
||||
icon.source = cache.getUrlbyUrl(root.feedIcon);
|
||||
else
|
||||
icon.source = "";
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.feedIcon!="") {
|
||||
icon.source = cache.getUrlbyUrl(root.feedIcon);
|
||||
} else {
|
||||
icon.source = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
@ -366,7 +325,6 @@ ListItem {
|
|||
|
||||
BackgroundItem {
|
||||
id: expander
|
||||
|
||||
visible: !last && !daterow
|
||||
|
||||
anchors {
|
||||
|
|
@ -379,7 +337,7 @@ ListItem {
|
|||
|
||||
Image {
|
||||
id: expanderIcon
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.paddingMedium
|
||||
source: "image://theme/icon-lock-more"
|
||||
|
|
@ -392,26 +350,33 @@ ListItem {
|
|||
anchors.left: parent.left; anchors.right: expanderIcon.left;
|
||||
anchors.leftMargin: Theme.paddingLarge
|
||||
anchors.rightMargin: Theme.paddingMedium
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
visible: !root.hidden || root.expanded
|
||||
spacing: Theme.paddingMedium
|
||||
Item {
|
||||
// Broadcast
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
visible: (!root.hidden || root.expanded) && (root.broadcast || root.annotations!="")
|
||||
height: Math.max(broadcastImage.height, broadcastLabel.height)
|
||||
|
||||
Image {
|
||||
id: broadcastImage
|
||||
anchors.left: parent.left; anchors.top: parent.top
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
visible: root.liked
|
||||
source: root.down ? "image://theme/icon-m-like?"+Theme.secondaryHighlightColor :
|
||||
"image://theme/icon-m-like?"+Theme.secondaryColor
|
||||
source: root.broadcast ? root.down ? "image://theme/icon-m-share?"+Theme.secondaryHighlightColor :
|
||||
"image://theme/icon-m-share?"+Theme.secondaryColor :
|
||||
root.down ? "image://theme/icon-m-chat?"+Theme.secondaryHighlightColor :
|
||||
"image://theme/icon-m-chat?"+Theme.secondaryColor
|
||||
}
|
||||
|
||||
Image {
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
visible: root.broadcast
|
||||
source: root.down ? "image://theme/icon-m-share?"+Theme.secondaryHighlightColor :
|
||||
"image://theme/icon-m-share?"+Theme.secondaryColor
|
||||
Label {
|
||||
id: broadcastLabel
|
||||
anchors.left: broadcastImage.right; anchors.right: parent.right; anchors.top: parent.top; anchors.leftMargin: Theme.paddingSmall
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: root.read>0 && root.readlater==0 ? root.down ? Theme.secondaryHighlightColor : Theme.secondaryColor :
|
||||
root.down ? Theme.highlightColor : Theme.primaryColor
|
||||
wrapMode: Text.Wrap
|
||||
text: root.annotations
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -423,7 +388,6 @@ ListItem {
|
|||
text: root.author!=""
|
||||
? utils.getHumanFriendlyTimeString(date)+" • "+root.author
|
||||
: utils.getHumanFriendlyTimeString(date)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -465,8 +429,9 @@ ListItem {
|
|||
}
|
||||
|
||||
MenuItem {
|
||||
text: broadcast ? qsTr("Unshare") : qsTr("Share")
|
||||
enabled: settings.signinType >= 10
|
||||
text: broadcast ? qsTr("Unshare") : qsTr("Share with followers")
|
||||
enabled: settings.signinType >= 10 && !root.friendStream
|
||||
visible: enabled
|
||||
onClicked: {
|
||||
if (broadcast) {
|
||||
root.unmarkedBroadcast();
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Page {
|
|||
case 3:
|
||||
return qsTr("All feeds");
|
||||
case 4:
|
||||
return settings.getSigninType()<10 ? qsTr("Saved") : qsTr("Starred");
|
||||
return settings.signinType<10 ? qsTr("Saved") : qsTr("Starred");
|
||||
case 5:
|
||||
return qsTr("Slow");
|
||||
default:
|
||||
|
|
@ -123,6 +123,7 @@ Page {
|
|||
content: model.content
|
||||
date: model.date
|
||||
read: model.read
|
||||
friendStream: model.feedId.substring(0,4) === "user"
|
||||
feedIcon: model.feedIcon
|
||||
feedTitle: model.feedTitle
|
||||
author: model.author
|
||||
|
|
@ -132,14 +133,15 @@ Page {
|
|||
cached: model.cached
|
||||
broadcast: model.broadcast
|
||||
liked: model.liked
|
||||
annotations: model.annotations
|
||||
fresh: model.fresh
|
||||
last: model.uid=="last"
|
||||
daterow: model.uid=="daterow"
|
||||
last: model.uid === "last"
|
||||
daterow: model.uid === "daterow"
|
||||
showMarkedAsRead: settings.viewMode!=4 && model.read<2
|
||||
objectName: "EntryDelegate"
|
||||
|
||||
Component.onCompleted: {
|
||||
//console.log("broadcast:",model.broadcast, model.liked);
|
||||
//console.log("feedId:",model.feedId);
|
||||
// Dynamic creation of new items if last item is compleated
|
||||
if (index==entryModel.count()-1) {
|
||||
//console.log(index);
|
||||
|
|
@ -152,11 +154,11 @@ Page {
|
|||
// Double click
|
||||
timer.stop();
|
||||
|
||||
if (model.read==0) {
|
||||
entryModel.setData(model.index, "read", 1);
|
||||
if (model.read === 0) {
|
||||
entryModel.setData(model.index, "read", 1, "");
|
||||
//read = 1;
|
||||
} else {
|
||||
entryModel.setData(model.index, "read", 0);
|
||||
entryModel.setData(model.index, "read", 0, "");
|
||||
//read = 0;
|
||||
}
|
||||
|
||||
|
|
@ -236,27 +238,28 @@ Page {
|
|||
}
|
||||
|
||||
onMarkedAsRead: {
|
||||
entryModel.setData(model.index, "read", 1);
|
||||
entryModel.setData(model.index, "read", 1, "");
|
||||
}
|
||||
|
||||
onMarkedAsUnread: {
|
||||
entryModel.setData(model.index, "read", 0);
|
||||
entryModel.setData(model.index, "read", 0, "");
|
||||
}
|
||||
|
||||
onMarkedReadlater: {
|
||||
entryModel.setData(index, "readlater", 1);
|
||||
entryModel.setData(index, "readlater", 1, "");
|
||||
}
|
||||
|
||||
onUnmarkedReadlater: {
|
||||
entryModel.setData(index, "readlater", 0);
|
||||
entryModel.setData(index, "readlater", 0, "");
|
||||
}
|
||||
|
||||
onMarkedBroadcast: {
|
||||
entryModel.setData(model.index, "broadcast", true);
|
||||
pageStack.push(Qt.resolvedUrl("ShareDialog.qml"),{"index": model.index,});
|
||||
//entryModel.setData(model.index, "broadcast", true, "");
|
||||
}
|
||||
|
||||
onUnmarkedBroadcast: {
|
||||
entryModel.setData(model.index, "broadcast", false);
|
||||
entryModel.setData(model.index, "broadcast", false, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,23 @@ Page {
|
|||
id: listItem
|
||||
|
||||
property bool last: model.uid=="last"
|
||||
property bool defaultIcon: model.icon === "http://s.theoldreader.com/icons/user_icon.png"
|
||||
|
||||
Component.onCompleted: {
|
||||
var r = title.length>0 ? (Math.abs(title.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = title.length>1 ? (Math.abs(title.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = title.length>2 ? (Math.abs(title.charCodeAt(2)-65)/57)%1 : 1;
|
||||
var colorBg = Qt.rgba(r,g,b,0.9);
|
||||
var colorFg = (r+g+b)>1.5 ? Theme.highlightDimmerColor : Theme.primaryColor;
|
||||
|
||||
imagePlaceholder.color = colorBg;
|
||||
imagePlaceholderLabel.color = colorFg;
|
||||
if (defaultIcon)
|
||||
image.source = "image://icons/friend?" + colorFg;
|
||||
else
|
||||
image.source = model.icon !== "" ? cache.getUrlbyUrl(model.icon) : "";
|
||||
}
|
||||
|
||||
enabled: !last
|
||||
|
||||
contentHeight: last ?
|
||||
|
|
@ -108,7 +125,6 @@ Page {
|
|||
id: item
|
||||
spacing: 0.5*Theme.paddingSmall
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//anchors.left: image.visible ? image.right : parent.left
|
||||
anchors.left: image.visible ? image.right : imagePlaceholder.right
|
||||
anchors.right: unreadbox.visible ? unreadbox.left : parent.right
|
||||
visible: !listItem.last
|
||||
|
|
@ -151,57 +167,32 @@ Page {
|
|||
height: width
|
||||
anchors.left: parent.left
|
||||
y: Theme.paddingMedium
|
||||
visible: !image.visible && !listItem.last
|
||||
visible: listItem.defaultIcon || (!image.visible && !listItem.last)
|
||||
|
||||
Label {
|
||||
id: imagePlaceholderLabel
|
||||
anchors.centerIn: parent
|
||||
text: title.substring(0,1).toUpperCase()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
var r = title.length>0 ? (Math.abs(title.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = title.length>1 ? (Math.abs(title.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = title.length>2 ? (Math.abs(title.charCodeAt(2)-65)/57)%1 : 1;
|
||||
imagePlaceholder.color = Qt.rgba(r,g,b,0.9);
|
||||
imagePlaceholderLabel.color = (r+g+b)>1.5 ? Theme.highlightDimmerColor : Theme.primaryColor;
|
||||
visible: !listItem.defaultIcon
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
// Image white background
|
||||
anchors.fill: image
|
||||
//color: Theme.secondaryColor
|
||||
visible: image.visible
|
||||
visible: image.visible && !listItem.defaultIcon
|
||||
color: "white"
|
||||
//opacity: 0.1
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
width: visible ? 1.2*Theme.iconSizeSmall : 0
|
||||
height: width
|
||||
anchors.left: parent.left; //anchors.leftMargin: Theme.paddingLarge
|
||||
anchors.left: parent.left
|
||||
visible: status!=Image.Error && status!=Image.Null && !listItem.last
|
||||
y: Theme.paddingMedium
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: settings
|
||||
onShowTabIconsChanged: {
|
||||
if (model.icon!="")
|
||||
image.source = cache.getUrlbyUrl(model.icon);
|
||||
else
|
||||
image.source = "";
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (model.icon!="")
|
||||
image.source = cache.getUrlbyUrl(model.icon);
|
||||
else
|
||||
image.source = "";
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (!listItem.last) {
|
||||
utils.setEntryModel(uid);
|
||||
|
|
@ -209,11 +200,12 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
showMenuOnPressAndHold: !listItem.last && model.unread+model.read>0
|
||||
showMenuOnPressAndHold: !listItem.last && (readItem.enabled || unreadItem.enabled)
|
||||
|
||||
menu: ContextMenu {
|
||||
id: contextMenu
|
||||
MenuItem {
|
||||
id: readItem
|
||||
text: qsTr("Mark all as read")
|
||||
enabled: model.unread!=0
|
||||
visible: enabled
|
||||
|
|
@ -222,6 +214,7 @@ Page {
|
|||
}
|
||||
}
|
||||
MenuItem {
|
||||
id: unreadItem
|
||||
text: qsTr("Mark all as unread")
|
||||
enabled: model.read!=0 && settings.signinType<10
|
||||
visible: enabled
|
||||
|
|
|
|||
|
|
@ -96,10 +96,10 @@ Page {
|
|||
visible: settings.signedIn
|
||||
text: settings.signedIn ?
|
||||
settings.signinType==0 ? settings.getUsername() :
|
||||
settings.signinType==1 ? "Twitter" :
|
||||
settings.signinType==2 ? "Facebook" :
|
||||
settings.signinType==10 ? settings.getUsername() :
|
||||
"" : ""
|
||||
settings.signinType==1 ? "Twitter" :
|
||||
settings.signinType==2 ? "Facebook" :
|
||||
settings.signinType==10 ? settings.getUsername() :
|
||||
"" : ""
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -159,6 +159,68 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: qsTr("Syncronization")
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
width: root.width
|
||||
label: qsTr("Sync timeframe")
|
||||
enabled: settings.signinType>=10
|
||||
visible: enabled
|
||||
currentIndex: {
|
||||
var retention = settings.getRetentionDays();
|
||||
if (retention < 1)
|
||||
return 5;
|
||||
if (retention < 3)
|
||||
return 0;
|
||||
if (retention < 7)
|
||||
return 1;
|
||||
if (retention < 14)
|
||||
return 2;
|
||||
if (retention < 30)
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
menu: ContextMenu {
|
||||
MenuItem { text: qsTr("1 Day") }
|
||||
MenuItem { text: qsTr("3 Days") }
|
||||
MenuItem { text: qsTr("1 Week") }
|
||||
MenuItem { text: qsTr("2 Weeks") }
|
||||
MenuItem { text: qsTr("1 Month") }
|
||||
MenuItem { text: qsTr("Wide as possible") }
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
if (currentIndex == 0) {
|
||||
settings.setRetentionDays(1);
|
||||
return;
|
||||
}
|
||||
if (currentIndex == 1) {
|
||||
settings.setRetentionDays(3);
|
||||
return;
|
||||
}
|
||||
if (currentIndex == 2) {
|
||||
settings.setRetentionDays(7);
|
||||
return;
|
||||
}
|
||||
if (currentIndex == 3) {
|
||||
settings.setRetentionDays(14);
|
||||
return;
|
||||
}
|
||||
if (currentIndex == 4) {
|
||||
settings.setRetentionDays(30);
|
||||
return;
|
||||
}
|
||||
settings.setRetentionDays(0);
|
||||
}
|
||||
|
||||
description: qsTr("Most recent articles will be syncronized according to the defined timeframe. " +
|
||||
"Regardless of the value, all starred, liked and shared items will be synced as well. " +
|
||||
"Be aware, this parameter has significant impact on the speed of synchronization.")
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: qsTr("Cache")
|
||||
}
|
||||
|
|
@ -214,6 +276,9 @@ Page {
|
|||
else
|
||||
settings.offlineMode = true;
|
||||
}
|
||||
|
||||
description: qsTr("In the offline mode, Kaktus will only use local cache to get web pages and images, so "+
|
||||
"network connection won't be needed.")
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
|
|
@ -276,19 +341,21 @@ Page {
|
|||
|
||||
menu: ContextMenu {
|
||||
MenuItem { text: qsTr("Default"); onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Čeština"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Deutsch"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "English"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Español"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "فارسی"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Suomi"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Français"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Italiano"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Nederlands"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Čeština"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Deutsch"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "English"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Espanol"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "فارسی"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Suomi"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Français"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Italiano"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Nederlands"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Polski"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Русский"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Türkçe"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "中文 (简体)"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Русский"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Türkçe"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Čeština"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "Čeština"; onClicked: locale.showMessage() }
|
||||
MenuItem { text: "中文 (简体)"; onClicked: locale.showMessage() }
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
|
|
|
|||
85
qml/sailfish/ShareDialog.qml
Normal file
85
qml/sailfish/ShareDialog.qml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
Copyright (C) 2015 Michal Kosciesza <michal@mkiol.net>
|
||||
|
||||
This file is part of Kaktus.
|
||||
|
||||
Kaktus 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Kaktus 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 Kaktus. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
|
||||
Dialog {
|
||||
id: root
|
||||
|
||||
property bool showBar: false
|
||||
property int index
|
||||
property bool actionDone: false
|
||||
|
||||
canAccept: note.text != ""
|
||||
|
||||
allowedOrientations: {
|
||||
switch (settings.allowedOrientations) {
|
||||
case 1:
|
||||
return Orientation.Portrait;
|
||||
case 2:
|
||||
return Orientation.Landscape;
|
||||
}
|
||||
return Orientation.Landscape | Orientation.Portrait;
|
||||
}
|
||||
|
||||
ActiveDetector {}
|
||||
|
||||
SilicaFlickable {
|
||||
anchors {left: parent.left; right: parent.right }
|
||||
anchors {top: parent.top; bottom: parent.bottom }
|
||||
anchors.bottomMargin: app.height - app.flickHeight
|
||||
contentHeight: content.height
|
||||
|
||||
Column {
|
||||
id: content
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
DialogHeader {
|
||||
//title: qsTr("Adding note")
|
||||
acceptText : qsTr("Save note")
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: note
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
placeholderText: qsTr("Want to add a note?")
|
||||
label: qsTr("Note")
|
||||
focus: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
entryModel.setData(index, "broadcast", true, note.text);
|
||||
actionDone = true;
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (!actionDone)
|
||||
entryModel.setData(index, "broadcast", true, note.text);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -90,6 +90,10 @@ Page {
|
|||
id: listItem
|
||||
|
||||
property bool last: model.uid=="last"
|
||||
property string title: model.uid=="subscriptions" ? qsTr("Subscriptions") :
|
||||
model.uid=="friends" ? qsTr("Following") : model.title
|
||||
property string imageSource: model.uid=="friends" ? "image://icons/friend?"+Theme.primaryColor :
|
||||
model.iconUrl != "" ? cache.getUrlbyUrl(iconUrl) : ""
|
||||
enabled: !last
|
||||
|
||||
anchors.top: parent.top
|
||||
|
|
@ -98,7 +102,6 @@ Page {
|
|||
Math.max(item.height, image.height) + 2 * Theme.paddingMedium;
|
||||
|
||||
Rectangle {
|
||||
//anchors.top: parent.top; anchors.left: parent.left
|
||||
anchors.top: parent.top; anchors.right: parent.right
|
||||
width: Theme.paddingSmall; height: item.height
|
||||
visible: model.fresh && !listItem.last
|
||||
|
|
@ -115,7 +118,6 @@ Page {
|
|||
|
||||
spacing: 0.5*Theme.paddingSmall
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//anchors.left: image.visible ? image.right : parent.left
|
||||
anchors.left: image.visible ? image.right : imagePlaceholder.right
|
||||
anchors.right: unreadbox.visible ? unreadbox.left : parent.right
|
||||
visible: !listItem.last
|
||||
|
|
@ -128,8 +130,7 @@ Page {
|
|||
color: listItem.down ?
|
||||
(model.unread ? Theme.highlightColor : Theme.secondaryHighlightColor) :
|
||||
(model.unread ? Theme.primaryColor : Theme.secondaryColor)
|
||||
text: model.uid=="subscriptions" ? qsTr("Subscriptions") :
|
||||
model.uid=="friends" ? qsTr("Following") : model.title
|
||||
text: listItem.title
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,13 +163,13 @@ Page {
|
|||
Label {
|
||||
id: imagePlaceholderLabel
|
||||
anchors.centerIn: parent
|
||||
text: title.substring(0,1).toUpperCase()
|
||||
text: listItem.title.substring(0,1).toUpperCase()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
var r = title.length>0 ? (Math.abs(title.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = title.length>1 ? (Math.abs(title.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = title.length>2 ? (Math.abs(title.charCodeAt(2)-65)/57)%1 : 1;
|
||||
var r = listItem.title.length>0 ? (Math.abs(listItem.title.charCodeAt(0)-65)/57)%1 : 1;
|
||||
var g = listItem.title.length>1 ? (Math.abs(listItem.title.charCodeAt(1)-65)/57)%1 : 1;
|
||||
var b = listItem.title.length>2 ? (Math.abs(listItem.title.charCodeAt(2)-65)/57)%1 : 1;
|
||||
imagePlaceholder.color = Qt.rgba(r,g,b,0.9);
|
||||
imagePlaceholderLabel.color = (r+g+b)>1.5 ? Theme.highlightDimmerColor : Theme.primaryColor;
|
||||
}
|
||||
|
|
@ -181,35 +182,7 @@ Page {
|
|||
anchors.left: parent.left; //anchors.leftMargin: Theme.paddingLarge
|
||||
visible: status!=Image.Error && status!=Image.Null && !listItem.last
|
||||
y: Theme.paddingMedium
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: settings
|
||||
onShowTabIconsChanged: {
|
||||
/*if (model.uid=="friends") {
|
||||
image.source = "image://theme/icon-m-service-generic?"+Theme.primaryColor;
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (iconUrl=="") {
|
||||
image.source = "";
|
||||
return;
|
||||
}
|
||||
image.source = cache.getUrlbyUrl(iconUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
/*if (model.uid=="friends") {
|
||||
image.source = "image://theme/icon-m-service-generic?"+Theme.primaryColor;
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (iconUrl=="") {
|
||||
image.source = "";
|
||||
return;
|
||||
}
|
||||
image.source = cache.getUrlbyUrl(iconUrl);
|
||||
source: listItem.imageSource
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -225,11 +198,11 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
showMenuOnPressAndHold: !listItem.last && model.unread+model.read>0
|
||||
showMenuOnPressAndHold: !listItem.last && (readItem.enabled || unreadItem.enabled)
|
||||
|
||||
menu: ContextMenu {
|
||||
enabled: !listItem.last
|
||||
MenuItem {
|
||||
id: readItem
|
||||
text: qsTr("Mark all as read")
|
||||
enabled: model.unread!=0
|
||||
visible: enabled
|
||||
|
|
@ -238,6 +211,7 @@ Page {
|
|||
}
|
||||
}
|
||||
MenuItem {
|
||||
id: unreadItem
|
||||
text: qsTr("Mark all as unread")
|
||||
enabled: model.read!=0 && settings.signinType<10
|
||||
visible: enabled
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2014 Michal Kosciesza <michal@mkiol.net>
|
||||
|
||||
This file is part of Kaktus.
|
||||
|
||||
Kaktus 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Kaktus 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 Kaktus. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
|
||||
Page {
|
||||
id: root
|
||||
|
||||
property bool showBar: false
|
||||
|
||||
allowedOrientations: {
|
||||
switch (settings.allowedOrientations) {
|
||||
case 1:
|
||||
return Orientation.Portrait;
|
||||
case 2:
|
||||
return Orientation.Landscape;
|
||||
}
|
||||
return Orientation.Landscape | Orientation.Portrait;
|
||||
}
|
||||
|
||||
ActiveDetector {
|
||||
onActivated: tabModel.updateFlags()
|
||||
onInit: bar.flick = listView
|
||||
}
|
||||
|
||||
SilicaListView {
|
||||
id: listView
|
||||
|
||||
anchors { top: parent.top; left: parent.left; right: parent.right }
|
||||
|
||||
height: app.flickHeight
|
||||
|
||||
clip:true
|
||||
|
||||
PageMenu {
|
||||
id: menu
|
||||
showAbout: true
|
||||
showMarkAsRead: false
|
||||
showMarkAsUnread: false
|
||||
}
|
||||
|
||||
header: PageHeader {
|
||||
title: qsTr("")
|
||||
}
|
||||
|
||||
ViewPlaceholder {
|
||||
enabled: listView.count < 1
|
||||
text: qsTr("You are not signed in")
|
||||
|
||||
Label {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.secondaryHighlightColor
|
||||
text: fetcher.busy ? qsTr("Wait until Sync finish") : settings.signedIn ? "" : qsTr("You are not signed in")
|
||||
}
|
||||
}
|
||||
|
||||
VerticalScrollDecorator {
|
||||
flickable: listView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ Page {
|
|||
return;
|
||||
}
|
||||
navigate(offlineUrl);
|
||||
entryModel.setData(index,"cached",1);
|
||||
entryModel.setData(index,"cached",1, "");
|
||||
}
|
||||
onOnlineDownloadFailed: {
|
||||
notification.show(qsTr("Failed to switch to Reader mode :-("));
|
||||
|
|
@ -289,10 +289,10 @@ Page {
|
|||
onStarClicked: {
|
||||
if (stared) {
|
||||
stared=false;
|
||||
entryModel.setData(root.index, "readlater", 0);
|
||||
entryModel.setData(root.index, "readlater", 0, "");
|
||||
} else {
|
||||
stared=true;
|
||||
entryModel.setData(root.index, "readlater", 1);
|
||||
entryModel.setData(root.index, "readlater", 1, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ Page {
|
|||
onTriggered: {
|
||||
if (!root.read) {
|
||||
read=true;
|
||||
entryModel.setData(root.index, "read", 1);
|
||||
entryModel.setData(root.index, "read", 1, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
qml/sailfish/friend.png
Normal file
BIN
qml/sailfish/friend.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -239,8 +239,14 @@ ApplicationWindow {
|
|||
if (code >= 400 && code < 500) {
|
||||
if (code == 402)
|
||||
notification.show(qsTr("The user name or password is incorrect!"));
|
||||
|
||||
console.log("settings.signinType",settings.getSigninType());
|
||||
/*if (code == 403) {
|
||||
notification.show(qsTr("Your login credentials have expired!"));
|
||||
if (settings.getSigninType()>0) {
|
||||
fetcher.getAuthUrl();
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
//console.log("settings.signinType",settings.getSigninType());
|
||||
|
||||
// Sign in
|
||||
var type = settings.signinType;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue