Entries list UI improvements
This commit is contained in:
parent
89a23f5ba6
commit
3a0fa96f2a
9 changed files with 184 additions and 300 deletions
|
|
@ -27,10 +27,11 @@ Image {
|
|||
property int minWidth: 0
|
||||
property string orgSource: ""
|
||||
property bool cached: true
|
||||
property bool hidden: false
|
||||
readonly property bool filled: maxWidth > 0 && implicitWidth > maxWidth/3
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
width: sourceSize.width >= maxWidth ? maxWidth : sourceSize.width
|
||||
enabled: status === Image.Ready &&
|
||||
width: filled ? maxWidth : sourceSize.width
|
||||
enabled: !hidden && status === Image.Ready &&
|
||||
(minWidth === 0 || (sourceSize.width > minWidth && sourceSize.height > minWidth))
|
||||
visible: opacity > 0 && enabled
|
||||
opacity: enabled ? 1.0 : 0.0
|
||||
|
|
@ -59,8 +60,18 @@ Image {
|
|||
}
|
||||
|
||||
onStatusChanged: {
|
||||
if (cached && orgSource.length > 0 && status === Image.Error &&
|
||||
!settings.offlineMode && dm.online) {
|
||||
if (status === Image.Ready) {
|
||||
if (filled) {
|
||||
var ratio = width / implicitWidth
|
||||
height = implicitHeight * ratio
|
||||
if (width < sourceSize.width)
|
||||
sourceSize.width = width
|
||||
if (height < sourceSize.height)
|
||||
sourceSize.height = height
|
||||
}
|
||||
} else if (status === Image.Error &&
|
||||
cached && orgSource.length > 0 &&
|
||||
!settings.offlineMode && dm.online) {
|
||||
cached = false
|
||||
source = orgSource
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ ListItem {
|
|||
property bool daterow: false
|
||||
property bool landscapeMode: false
|
||||
property bool showMarkedAsRead: true
|
||||
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 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"
|
||||
property color highlightedColor: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
|
||||
readonly property alias expandable: box.expandable
|
||||
|
|
@ -108,7 +109,7 @@ ListItem {
|
|||
color: Theme.highlightDimmerColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
/*Rectangle {
|
||||
anchors.top: parent.top; anchors.right: parent.right
|
||||
width: Theme.paddingSmall; height: titleLabel.height
|
||||
visible: root.fresh && !last && !daterow && !(landscapeMode && expanded)
|
||||
|
|
@ -117,73 +118,8 @@ ListItem {
|
|||
GradientStop { position: 0.0; color: Theme.rgba(Theme.highlightColor, 0.4) }
|
||||
GradientStop { position: 1.0; color: Theme.rgba(Theme.highlightColor, 0.0) }
|
||||
}
|
||||
}
|
||||
|
||||
/*Item {
|
||||
id: likeButton
|
||||
anchors.right: star.left; anchors.top: background.top
|
||||
height: Theme.iconSizeSmall+2*Theme.paddingMedium
|
||||
width: Theme.iconSizeSmall
|
||||
visible: !last && !daterow && root.liked
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent;
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
source: root.down ? "image://icons/like?"+Theme.highlightColor :
|
||||
root.hidden ? "image://icons/like?"+Theme.secondaryColor :
|
||||
"image://icons/like?"+Theme.primaryColor
|
||||
}
|
||||
}*/
|
||||
|
||||
/*BackgroundItem {
|
||||
id: star
|
||||
anchors.right: parent.right; anchors.top: parent.top
|
||||
height: Theme.iconSizeSmall + 2*Theme.paddingMedium
|
||||
width: Theme.iconSizeSmall + 2*Theme.paddingMedium
|
||||
visible: !last && !daterow
|
||||
|
||||
onClicked: {
|
||||
if (root.readlater) {
|
||||
root.unmarkedReadlater();
|
||||
} else {
|
||||
root.markedReadlater();
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent;
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
source: {
|
||||
if (root.down) {
|
||||
if (root.readlater)
|
||||
return "image://theme/icon-m-favorite-selected?"+Theme.highlightColor;
|
||||
return "image://theme/icon-m-favorite?"+Theme.highlightColor;
|
||||
}
|
||||
if (root.readlater)
|
||||
return "image://theme/icon-m-favorite-selected?"+Theme.primaryColor;
|
||||
return "image://theme/icon-m-favorite?"+Theme.primaryColor;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
SmallIconButton {
|
||||
id: star
|
||||
anchors.right: parent.right; anchors.top: parent.top
|
||||
marginV: 2*Theme.paddingMedium
|
||||
visible: !last && !daterow
|
||||
|
||||
icon.source: root.readlater ? "image://theme/icon-m-favorite-selected":
|
||||
"image://theme/icon-m-favorite"
|
||||
onClicked: {
|
||||
if (root.readlater)
|
||||
root.unmarkedReadlater()
|
||||
else
|
||||
root.markedReadlater()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: dateRowbox
|
||||
visible: daterow
|
||||
|
|
@ -217,7 +153,7 @@ ListItem {
|
|||
height: root.expanded || root.expandedMode ? sizeExpanded : root.hidden ? sizeHidden : sizeNormal
|
||||
|
||||
clip: true
|
||||
anchors.left: parent.left; anchors.right: parent.right;
|
||||
width: parent.width
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
|
|
@ -228,23 +164,29 @@ ListItem {
|
|||
Column {
|
||||
id: contentItem
|
||||
spacing: entryImage.enabled ? Theme.paddingMedium : Theme.paddingSmall
|
||||
anchors.top: parent.top; anchors.topMargin: Theme.paddingMedium
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
anchors {
|
||||
top: parent.top; topMargin: Theme.paddingMedium
|
||||
left: parent.left; right: parent.right
|
||||
}
|
||||
|
||||
Item {
|
||||
id: titleItem
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
anchors.rightMargin: star.width
|
||||
height: Math.max(titleLabel.height, icon.height+Theme.paddingSmall, icon.height+Theme.paddingSmall)
|
||||
anchors {
|
||||
left: parent.left; right: parent.right
|
||||
leftMargin: Theme.horizontalPageMargin
|
||||
}
|
||||
height: Math.max(titleLabel.height, icon.height + Theme.paddingSmall,
|
||||
icon.height + Theme.paddingSmall)
|
||||
|
||||
// Title
|
||||
|
||||
Label {
|
||||
id: titleLabel
|
||||
anchors {
|
||||
right: parent.right
|
||||
right: star.left
|
||||
rightMargin: Theme.paddingMedium
|
||||
left: icon.visible ? icon.right : parent.left
|
||||
leftMargin: showIcon ? Theme.paddingMedium : Theme.paddingLarge
|
||||
leftMargin: icon.visible ? Theme.paddingMedium : 0
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.family: Theme.fontFamilyHeading
|
||||
|
|
@ -270,36 +212,65 @@ ListItem {
|
|||
id: icon
|
||||
visible: root.showIcon
|
||||
showPlaceholder: !root.defaultIcon
|
||||
showBackground: true
|
||||
source: root.feedIcon
|
||||
icon: root.feedIcon
|
||||
text: root.feedTitle
|
||||
anchors {
|
||||
left: parent.left
|
||||
top: titleLabel.top
|
||||
topMargin: Theme.paddingSmall
|
||||
small: true
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: star
|
||||
|
||||
property bool highlighted: pressed && containsMouse
|
||||
property int iconWidth: Theme.itemSizeExtraSmall/2
|
||||
|
||||
anchors.right: parent.right
|
||||
height: parent.height
|
||||
width: iconWidth + (root.landscapeMode ? Theme.paddingMedium : Theme.horizontalPageMargin)
|
||||
|
||||
onClicked: {
|
||||
if (root.readlater)
|
||||
root.unmarkedReadlater()
|
||||
else
|
||||
root.markedReadlater()
|
||||
}
|
||||
|
||||
Image {
|
||||
source: {
|
||||
var col = parent.highlighted ? Theme.highlightColor : Theme.primaryColor
|
||||
if (root.readlater)
|
||||
return "image://theme/icon-m-favorite-selected?" + col
|
||||
else
|
||||
return "image://theme/icon-m-favorite?" + col
|
||||
}
|
||||
|
||||
width: parent.iconWidth
|
||||
height: width
|
||||
}
|
||||
width: visible ? 1.2*Theme.iconSizeSmall: 0
|
||||
height: width
|
||||
}
|
||||
}
|
||||
|
||||
CachedImage {
|
||||
id: entryImage
|
||||
anchors.left: parent.left
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
maxWidth: root.width
|
||||
minWidth: Theme.iconSizeMedium
|
||||
orgSource: root.image
|
||||
hidden: root.landscapeMode
|
||||
}
|
||||
|
||||
Label {
|
||||
id: contentLabel
|
||||
anchors.left: parent.left; anchors.right: parent.right;
|
||||
anchors.leftMargin: Theme.paddingLarge; anchors.rightMargin: Theme.paddingLarge
|
||||
anchors {
|
||||
left: parent.left; right: parent.right
|
||||
leftMargin: Theme.horizontalPageMargin
|
||||
rightMargin: Theme.horizontalPageMargin
|
||||
}
|
||||
text: root.content
|
||||
wrapMode: Text.Wrap
|
||||
textFormat: Text.PlainText
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
visible: root.content!="" && !root.landscapeMode
|
||||
visible: root.content.length > 0 && !root.landscapeMode
|
||||
color: {
|
||||
if (root.read>0 && root.readlater==0) {
|
||||
if (root.down)
|
||||
|
|
@ -340,13 +311,13 @@ ListItem {
|
|||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
height: Math.max(expanderIcon.height,expanderLabel.height)+Theme.paddingMedium
|
||||
height: Math.max(expanderIcon.height,expanderLabel.height) + Theme.paddingMedium
|
||||
|
||||
Image {
|
||||
id: expanderIcon
|
||||
anchors.verticalCenter: expanderLabel.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.paddingMedium
|
||||
anchors.rightMargin: root.landscapeMode ? Theme.paddingMedium : Theme.horizontalPageMargin
|
||||
source: "image://theme/icon-lock-more"
|
||||
visible: box.expandable && !root.landscapeMode
|
||||
}
|
||||
|
|
@ -355,7 +326,7 @@ ListItem {
|
|||
id: expanderLabel
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left; anchors.right: expanderIcon.left;
|
||||
anchors.leftMargin: Theme.paddingLarge
|
||||
anchors.leftMargin: Theme.horizontalPageMargin
|
||||
anchors.rightMargin: Theme.paddingMedium
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
|
|
@ -365,19 +336,9 @@ ListItem {
|
|||
visible: app.isOldReader && settings.showBroadcast && (!root.hidden || root.expanded) && (root.broadcast || root.annotations!="")
|
||||
height: Math.max(broadcastImage.height, broadcastLabel.height)
|
||||
|
||||
/*Image {
|
||||
id: likeImage
|
||||
visible: root.liked
|
||||
anchors.left: parent.left; anchors.top: parent.top
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
source: root.down ? "image://icons/like?"+Theme.secondaryHighlightColor :
|
||||
root.hidden ? "image://icons/like?"+Theme.secondaryColor : "image://icons/like?"+Theme.primaryColor
|
||||
}*/
|
||||
|
||||
Image {
|
||||
id: broadcastImage
|
||||
visible: root.broadcast || root.annotations!=""
|
||||
visible: root.broadcast || root.annotations.length > 0
|
||||
anchors.left: parent.left; anchors.top: parent.top
|
||||
width: Theme.iconSizeSmall
|
||||
height: Theme.iconSizeSmall
|
||||
|
|
@ -409,53 +370,6 @@ ListItem {
|
|||
? utils.getHumanFriendlyTimeString(date)+" • "+root.author
|
||||
: utils.getHumanFriendlyTimeString(date)
|
||||
}
|
||||
|
||||
/*Item {
|
||||
anchors.left: parent.left; anchors.right: parent.right
|
||||
height: evaluationButtons.height
|
||||
|
||||
Label {
|
||||
id: authorLabel
|
||||
anchors {left: parent.left; right: evaluationButtons.left; verticalCenter: parent.verticalCenter}
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: root.down ? Theme.secondaryHighlightColor : Theme.secondaryColor
|
||||
truncationMode: TruncationMode.Fade
|
||||
text: root.author!=""
|
||||
? utils.getHumanFriendlyTimeString(date)+" • "+root.author
|
||||
: utils.getHumanFriendlyTimeString(date)
|
||||
}
|
||||
|
||||
Row {
|
||||
id: evaluationButtons
|
||||
anchors {right: parent.right; verticalCenter: parent.verticalCenter}
|
||||
|
||||
SmallIconButton {
|
||||
icon.source: root.evaluation === 1 ?
|
||||
"image://icons/icon-m-good-selected" :
|
||||
"image://icons/icon-m-good"
|
||||
onClicked: {
|
||||
if (root.evaluation === 1)
|
||||
root.evaluation = 0
|
||||
else
|
||||
root.evaluation = 1
|
||||
evaluated(root.evaluation)
|
||||
}
|
||||
}
|
||||
|
||||
SmallIconButton {
|
||||
icon.source: root.evaluation === -1 ?
|
||||
"image://icons/icon-m-bad-selected" :
|
||||
"image://icons/icon-m-bad"
|
||||
onClicked: {
|
||||
if (root.evaluation === -1)
|
||||
root.evaluation = 0
|
||||
else
|
||||
root.evaluation = -1
|
||||
evaluated(root.evaluation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
|
|
|
|||
|
|
@ -43,17 +43,19 @@ Page {
|
|||
property string expandedUid: ""
|
||||
property int expandedIndex: 0
|
||||
|
||||
function openInExaternalBrowser(index, link, uid) {
|
||||
function openBrowser(index, link, uid) {
|
||||
entryModel.setData(index, "read", 1, "");
|
||||
notification.show(qsTr("Launching an external browser..."));
|
||||
notification.show(qsTr("Launching a browser..."));
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
|
||||
function setContentPane(delegate) {
|
||||
//console.log("setContentPane",delegate);
|
||||
contentPanel.index = delegate.index
|
||||
contentPanel.content = app.isTablet ? delegate.contentraw : delegate.contentall;
|
||||
contentPanel.image = app.isTablet ? "" : delegate.image;
|
||||
//contentPanel.content = app.isTablet ? delegate.contentraw : delegate.contentall;
|
||||
contentPanel.content = delegate.contentall;
|
||||
//contentPanel.image = app.isTablet ? "" : delegate.image;
|
||||
contentPanel.image = delegate.image;
|
||||
contentPanel.expanded = false;
|
||||
delegate.expanded = true;
|
||||
}
|
||||
|
|
@ -71,7 +73,7 @@ Page {
|
|||
|
||||
function clearContentPane(delegate) {
|
||||
if (delegate) {
|
||||
if (contentPanel.index == delegate.index) {
|
||||
if (contentPanel.index === delegate.index) {
|
||||
contentPanel.index = 0;
|
||||
contentPanel.content = "";
|
||||
contentPanel.image = "";
|
||||
|
|
@ -178,17 +180,17 @@ Page {
|
|||
|
||||
onContentYChanged: {
|
||||
if (root.landscapeMode) {
|
||||
var itemTop = itemAt(0,contentY + root.height/5);
|
||||
var itemBottom = itemAt(0,contentY + 4*root.height/5);
|
||||
var itemTop = itemAt(0,contentY + root.height/5)
|
||||
var itemBottom = itemAt(0,contentY + 4*root.height/5)
|
||||
if (!itemTop.last && !itemTop.daterow) {
|
||||
if (root.expandedDelegate) {
|
||||
if (root.expandedDelegate.index < itemTop.index ||
|
||||
root.expandedDelegate.index > itemBottom.index )
|
||||
itemTop.expanded = true;
|
||||
itemTop.expanded = true
|
||||
else
|
||||
return;
|
||||
return
|
||||
} else {
|
||||
itemTop.expanded = true;
|
||||
itemTop.expanded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -205,17 +207,17 @@ Page {
|
|||
title: {
|
||||
switch (settings.viewMode) {
|
||||
case 3:
|
||||
return qsTr("All feeds");
|
||||
return qsTr("All feeds")
|
||||
case 4:
|
||||
return app.isNetvibes ? qsTr("Saved") : qsTr("Starred");
|
||||
return app.isNetvibes ? qsTr("Saved") : qsTr("Starred")
|
||||
case 5:
|
||||
return qsTr("Slow");
|
||||
return qsTr("Slow")
|
||||
case 6:
|
||||
return qsTr("Liked");
|
||||
return qsTr("Liked")
|
||||
case 7:
|
||||
return qsTr("Shared");
|
||||
return qsTr("Shared")
|
||||
default:
|
||||
return root.title;
|
||||
return root.title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -257,13 +259,13 @@ Page {
|
|||
// Not allowed while Syncing
|
||||
if (dm.busy || fetcher.busy || dm.removerBusy) {
|
||||
notification.show(qsTr("Wait until current task is complete."));
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
// Entry not cached and offline mode enabled
|
||||
if (settings.offlineMode && !model.cached) {
|
||||
notification.show(qsTr("Offline version is not available."));
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
// Switch to offline mode if no network
|
||||
|
|
@ -275,11 +277,11 @@ Page {
|
|||
} else {
|
||||
// Entry not cached
|
||||
notification.show(qsTr("Network is disconnected."));
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
function openEntryInViewer() {
|
||||
|
|
@ -295,14 +297,14 @@ Page {
|
|||
"feedindex": root.index,
|
||||
"read" : model.read===1,
|
||||
"cached" : model.cached
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function showEntryFeedContent() {
|
||||
// Not allowed while Syncing
|
||||
if (dm.busy || fetcher.busy || dm.removerBusy) {
|
||||
notification.show(qsTr("Wait until current task is complete."));
|
||||
return false;
|
||||
notification.show(qsTr("Wait until current task is complete."))
|
||||
return false
|
||||
}
|
||||
|
||||
pageStack.push(Qt.resolvedUrl("FeedWebContentPage.qml"),
|
||||
|
|
@ -318,55 +320,50 @@ Page {
|
|||
"feedindex": root.index,
|
||||
"read" : model.read===1,
|
||||
"cached" : model.cached
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function openEntry() {
|
||||
if (settings.clickBehavior === 2) {
|
||||
showEntryFeedContent();
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
if (!check()) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
if (settings.clickBehavior === 1) {
|
||||
openInExaternalBrowser(model.index, model.link, model.uid);
|
||||
return;
|
||||
openBrowser(model.index, model.link, model.uid);
|
||||
return
|
||||
}
|
||||
|
||||
openEntryInViewer();
|
||||
openEntryInViewer()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
//Dynamic creation of new items if last item is compleated
|
||||
//console.log("index:",index,"count:",entryModel.count());
|
||||
if (index==entryModel.count()-2) {
|
||||
//console.log("index==entryModel.count()-2");
|
||||
entryModel.createItems(index+2,settings.offsetLimit);
|
||||
entryModel.createItems(index+2,settings.offsetLimit)
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
//console.log("id",model.uid, "date", model.date);
|
||||
//console.log("content",model.content);
|
||||
//console.log("contentall",model.contentall);
|
||||
if (timer.running) {
|
||||
// Double click
|
||||
timer.stop();
|
||||
doubleEntryClicked();
|
||||
timer.stop()
|
||||
doubleEntryClicked()
|
||||
} else {
|
||||
timer.start();
|
||||
timer.start()
|
||||
}
|
||||
}
|
||||
|
||||
onDoubleEntryClicked: {
|
||||
if (model.read === 0) {
|
||||
entryModel.setData(model.index, "read", 1, "");
|
||||
entryModel.setData(model.index, "read", 1, "")
|
||||
//read = 1;
|
||||
} else {
|
||||
entryModel.setData(model.index, "read", 0, "");
|
||||
entryModel.setData(model.index, "read", 0, "")
|
||||
//read = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -374,12 +371,12 @@ Page {
|
|||
onSingleEntryClicked: {
|
||||
// Landscape mode
|
||||
if (root.landscapeMode) {
|
||||
delegate.expanded = true;
|
||||
return;
|
||||
delegate.expanded = true
|
||||
return
|
||||
}
|
||||
|
||||
// Portrait mode
|
||||
openEntry();
|
||||
openEntry()
|
||||
}
|
||||
|
||||
Timer {
|
||||
|
|
@ -387,13 +384,7 @@ Page {
|
|||
interval: 400
|
||||
onTriggered: {
|
||||
// Single click
|
||||
/*console.log("date: "+model.date);
|
||||
console.log("read: "+model.read);
|
||||
console.log("readlater: "+model.readlater);
|
||||
console.log("image: "+model.image);
|
||||
console.log("feedIcon: "+feedIcon+" model.feedIcon: "+model.feedIcon);
|
||||
console.log("showMarkedAsRead: "+showMarkedAsRead);*/
|
||||
singleEntryClicked();
|
||||
singleEntryClicked()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -401,37 +392,37 @@ Page {
|
|||
if (expanded) {
|
||||
// Collapsing all other items on expand
|
||||
for (var i = 0; i < listView.contentItem.children.length; i++) {
|
||||
var curItem = listView.contentItem.children[i];
|
||||
var curItem = listView.contentItem.children[i]
|
||||
if (curItem !== delegate) {
|
||||
if (curItem.objectName==="EntryDelegate") {
|
||||
if (curItem.expanded)
|
||||
curItem.expanded = false;
|
||||
curItem.expanded = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
root.expandedDelegate = delegate;
|
||||
root.expandedUid = delegate.uid;
|
||||
root.expandedIndex = delegate.index;
|
||||
root.expandedDelegate = delegate
|
||||
root.expandedUid = delegate.uid
|
||||
root.expandedIndex = delegate.index
|
||||
} else {
|
||||
if (delegate === root.expandedDelegate) {
|
||||
root.expandedDelegate = null;
|
||||
root.expandedUid = "";
|
||||
root.expandedIndex = 0;
|
||||
root.expandedDelegate = null
|
||||
root.expandedUid = ""
|
||||
root.expandedIndex = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, "")
|
||||
if (evaluation !== -1) {
|
||||
evaluation = 1
|
||||
ai.addEvaluation(model.uid, model.title, evaluation)
|
||||
|
|
@ -439,32 +430,31 @@ Page {
|
|||
}
|
||||
|
||||
onUnmarkedReadlater: {
|
||||
entryModel.setData(index, "readlater", 0, "");
|
||||
entryModel.setData(index, "readlater", 0, "")
|
||||
}
|
||||
|
||||
onMarkedLike: {
|
||||
entryModel.setData(model.index, "liked", true, "");
|
||||
entryModel.setData(model.index, "liked", true, "")
|
||||
}
|
||||
|
||||
onUnmarkedLike: {
|
||||
entryModel.setData(model.index, "liked", false, "");
|
||||
entryModel.setData(model.index, "liked", false, "")
|
||||
}
|
||||
|
||||
onMarkedBroadcast: {
|
||||
pageStack.push(Qt.resolvedUrl("ShareDialog.qml"),{"index": model.index,});
|
||||
//entryModel.setData(model.index, "broadcast", true, "");
|
||||
pageStack.push(Qt.resolvedUrl("ShareDialog.qml"),{"index": model.index,})
|
||||
}
|
||||
|
||||
onUnmarkedBroadcast: {
|
||||
entryModel.setData(model.index, "broadcast", false, "");
|
||||
entryModel.setData(model.index, "broadcast", false, "")
|
||||
}
|
||||
|
||||
onMarkedAboveAsRead: {
|
||||
entryModel.setAboveAsRead(model.index);
|
||||
entryModel.setAboveAsRead(model.index)
|
||||
}
|
||||
|
||||
onShowFeedContent: {
|
||||
showEntryFeedContent();
|
||||
showEntryFeedContent()
|
||||
}
|
||||
|
||||
onOpenInBrowser: {
|
||||
|
|
@ -472,7 +462,7 @@ Page {
|
|||
return
|
||||
}
|
||||
|
||||
openInExaternalBrowser(model.index, model.link, model.uid)
|
||||
openBrowser(model.index, model.link, model.uid)
|
||||
}
|
||||
|
||||
onOpenInViewer: {
|
||||
|
|
@ -498,17 +488,12 @@ Page {
|
|||
|
||||
ViewPlaceholder {
|
||||
id: placeholder
|
||||
enabled: listView.count == 0
|
||||
enabled: listView.count === 0
|
||||
text: fetcher.busy ? qsTr("Wait until sync finish") :
|
||||
settings.viewMode==4 ? app.isNetvibes ? qsTr("No saved items") : qsTr("No starred items") :
|
||||
settings.viewMode==6 ? qsTr("No liked items") : settings.showOnlyUnread ? qsTr("No unread items") : qsTr("No items")
|
||||
settings.viewMode === 4 ? app.isNetvibes ? qsTr("No saved items") : qsTr("No starred items") :
|
||||
settings.viewMode === 6 ? qsTr("No liked items") : settings.showOnlyUnread ? qsTr("No unread items") : qsTr("No items")
|
||||
}
|
||||
|
||||
/*Component.onCompleted: {
|
||||
if (listView.count == 0 && settings.viewMode>2)
|
||||
bar.open();
|
||||
}*/
|
||||
|
||||
VerticalScrollDecorator {
|
||||
flickable: listView
|
||||
}
|
||||
|
|
@ -523,31 +508,27 @@ Page {
|
|||
width: expanded ? root.width : app.landscapeContentPanelWidth
|
||||
clip: true
|
||||
height: app.flickHeight
|
||||
//openable: root.expandedUid != "" && !dm.busy && !fetcher.busy && !dm.removerBusy && !app.isTablet
|
||||
openable: false
|
||||
textFormat: app.isTablet ? Text.StyledText : Text.PlainText
|
||||
|
||||
onClicked: {
|
||||
/*if (isTablet) {
|
||||
var delegate = root.expandedDelegate ? root.expandedDelegate : root.expandedUid !="" ? getDelegateByUid(root.expandedUid) : undefined;
|
||||
if (delegate)
|
||||
delegate.openEntry();
|
||||
} else {
|
||||
expanded = !expanded;
|
||||
}*/
|
||||
|
||||
var delegate = root.expandedDelegate ? root.expandedDelegate : root.expandedUid !="" ? getDelegateByUid(root.expandedUid) : undefined;
|
||||
var delegate = root.expandedDelegate ?
|
||||
root.expandedDelegate : root.expandedUid !="" ?
|
||||
getDelegateByUid(root.expandedUid) : undefined
|
||||
if (delegate)
|
||||
delegate.openEntry();
|
||||
delegate.openEntry()
|
||||
}
|
||||
|
||||
onOpenClicked: {
|
||||
var delegate = root.expandedDelegate ? root.expandedDelegate : root.expandedUid !="" ? getDelegateByUid(root.expandedUid) : undefined;
|
||||
var delegate = root.expandedDelegate ?
|
||||
root.expandedDelegate : root.expandedUid !="" ?
|
||||
getDelegateByUid(root.expandedUid) : undefined
|
||||
if (delegate)
|
||||
delegate.openEntry();
|
||||
delegate.openEntry()
|
||||
}
|
||||
|
||||
busy: (width != root.width) && (width != app.landscapeContentPanelWidth)
|
||||
busy: (width != root.width) &&
|
||||
(width !== app.landscapeContentPanelWidth)
|
||||
}
|
||||
|
||||
HintLabel {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ SilicaFlickable {
|
|||
property bool busy: false
|
||||
property bool openable: false
|
||||
property alias textFormat: contentLabel.textFormat
|
||||
readonly property bool active: content != "" || image != ""
|
||||
readonly property bool active: content.length > 0 || image.length > 0
|
||||
|
||||
signal clicked
|
||||
signal openClicked
|
||||
|
|
@ -61,25 +61,12 @@ SilicaFlickable {
|
|||
spacing: Theme.paddingMedium
|
||||
width: root.width
|
||||
|
||||
Image {
|
||||
CachedImage {
|
||||
id: entryImage
|
||||
anchors.left: parent.left;
|
||||
fillMode: Image.PreserveAspectFit
|
||||
width: sourceSize.width>=root.width ? root.width : sourceSize.width
|
||||
enabled: source!="" && status==Image.Ready &&
|
||||
sourceSize.width > Theme.iconSizeMedium &&
|
||||
sourceSize.height > Theme.iconSizeMedium
|
||||
visible: opacity>0
|
||||
opacity: enabled ? 1.0 : 0.0
|
||||
Behavior on opacity { FadeAnimation {} }
|
||||
source: {
|
||||
if (root.image!="") {
|
||||
return settings.offlineMode ? cserver.getUrlbyUrl(root.image) :
|
||||
dm.online ? root.image : cserver.getUrlbyUrl(root.image);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
maxWidth: root.width
|
||||
minWidth: Theme.iconSizeMedium
|
||||
orgSource: root.image
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
@ -90,15 +77,17 @@ SilicaFlickable {
|
|||
|
||||
Label {
|
||||
id: contentLabel
|
||||
anchors.left: parent.left; anchors.right: parent.right;
|
||||
anchors.leftMargin: Theme.paddingLarge; anchors.rightMargin: Theme.paddingLarge
|
||||
anchors {
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
leftMargin: Theme.paddingLarge;
|
||||
rightMargin: Theme.horizontalPageMargin
|
||||
}
|
||||
text: root.content
|
||||
wrapMode: Text.Wrap
|
||||
//textFormat: Text.PlainText
|
||||
//textFormat: root.busy ? Text.PlainText : Text.StyledText
|
||||
linkColor: Theme.highlightColor
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
visible: root.content!="" && !root.busy
|
||||
visible: root.content.length > 0 && !root.busy
|
||||
color: Theme.primaryColor
|
||||
}
|
||||
|
||||
|
|
@ -124,4 +113,3 @@ SilicaFlickable {
|
|||
flickable: root
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,39 +18,31 @@
|
|||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property bool showPlaceholder: false
|
||||
property bool showBackground: false
|
||||
property alias backgroundColor: background.color
|
||||
property alias text: placeholder.text
|
||||
property alias source: icon.orgSource
|
||||
property alias text: _placeholder.text
|
||||
property alias icon: _icon.orgSource
|
||||
property bool small: false
|
||||
|
||||
Rectangle {
|
||||
// icon background
|
||||
id: background
|
||||
enabled: root.showBackground && !placeholder.visible && icon.enabled
|
||||
height: root.small ? Theme.iconSizeMedium * 0.7 : Theme.iconSizeMedium
|
||||
width: height
|
||||
|
||||
IconPlaceholder {
|
||||
// placeholder
|
||||
id: _placeholder
|
||||
anchors.fill: parent
|
||||
color: "white"
|
||||
visible: opacity > 0 && enabled
|
||||
opacity: enabled ? 1.0 : 0.0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200 }
|
||||
}
|
||||
visible: root.showPlaceholder &&
|
||||
_icon.status !== Image.Ready &&
|
||||
title.length > 0
|
||||
}
|
||||
|
||||
CachedImage {
|
||||
// feed icon
|
||||
id: icon
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
IconPlaceholder {
|
||||
// placeholder
|
||||
id: placeholder
|
||||
visible: root.showPlaceholder && !icon.enabled
|
||||
id: _icon
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,13 +141,12 @@ Page {
|
|||
}
|
||||
|
||||
function openEntryInBrowser() {
|
||||
notification.show(qsTr("Launching an external browser..."));
|
||||
//Qt.openUrlExternally(settings.offlineMode ? offlineUrl : onlineUrl);
|
||||
notification.show(qsTr("Launching a browser..."));
|
||||
Qt.openUrlExternally(onlineUrl)
|
||||
}
|
||||
|
||||
function openUrlEntryInBrowser(url) {
|
||||
notification.show(qsTr("Launching an external browser..."));
|
||||
notification.show(qsTr("Launching a browser..."));
|
||||
Qt.openUrlExternally(url);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ ListItem {
|
|||
|
||||
IconPlaceholder {
|
||||
// placeholder
|
||||
id: placeholder
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: Theme.horizontalPageMargin
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import Sailfish.Silica 1.0
|
|||
IconButton {
|
||||
id: root
|
||||
|
||||
property int iconSize: Theme.iconSizeSmall
|
||||
property int iconSize: Theme.iconSizeMe
|
||||
property int marginV: Theme.paddingMedium
|
||||
property int marginH: Theme.paddingMedium
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ Page {
|
|||
}
|
||||
|
||||
function openUrlEntryInBrowser(url) {
|
||||
notification.show(qsTr("Launching an external browser..."))
|
||||
notification.show(qsTr("Launching a browser..."))
|
||||
Qt.openUrlExternally(url)
|
||||
}
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ Page {
|
|||
text: qsTr("Browser")
|
||||
icon: "image://icons/icon-m-browser"
|
||||
onClicked: {
|
||||
notification.show(qsTr("Launching an external browser..."));
|
||||
notification.show(qsTr("Launching a browser..."));
|
||||
var url = view.url.toString().lastIndexOf("about") === 0 ||
|
||||
view.url.length === 0 ? root.onlineUrl : view.url
|
||||
console.log("Opening: " + url)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue