diff --git a/qml/ttrss/sailfish/pages/CategoryDelegate.qml b/qml/ttrss/sailfish/pages/CategoryDelegate.qml index 0556995..70d2d41 100644 --- a/qml/ttrss/sailfish/pages/CategoryDelegate.qml +++ b/qml/ttrss/sailfish/pages/CategoryDelegate.qml @@ -15,9 +15,6 @@ import Sailfish.Silica 1.0 ListItem { id: listItem - signal clicked - property alias pressed: mouseArea.pressed - contentHeight: Theme.itemSizeMedium width: parent.width @@ -44,10 +41,4 @@ ListItem { (listItem.highlighted ? Theme.highlightColor : Theme.primaryColor) : (listItem.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor) } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: listItem.clicked() - } } diff --git a/qml/ttrss/sailfish/pages/FeedDelegate.qml b/qml/ttrss/sailfish/pages/FeedDelegate.qml index fc69aa2..7e35ecd 100644 --- a/qml/ttrss/sailfish/pages/FeedDelegate.qml +++ b/qml/ttrss/sailfish/pages/FeedDelegate.qml @@ -15,9 +15,6 @@ import Sailfish.Silica 1.0 ListItem { id: listItem - signal clicked - property alias pressed: mouseArea.pressed - contentHeight: Theme.itemSizeSmall width: parent.width menu: contextMenu @@ -66,12 +63,6 @@ ListItem { (listItem.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor) } - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: listItem.clicked() - } - Component { id: contextMenu ContextMenu { @@ -80,13 +71,16 @@ ListItem { onClicked: { feeds.catchUp() } } -// MenuItem { -// text: qsTr("Unsubscribe") -// enabled: feedMenu.feedId >= 0 -// onClicked: { -// var ttrss = rootWindow.getTTRSS() -// ttrss.unsubscribe(feedMenu.feedId, function() { feeds.update() }) -// } } + MenuItem { + text: qsTr("Unsubscribe") + visible: model.feedId >= 0 + onClicked: { + var ttrss = rootWindow.getTTRSS() + ttrss.unsubscribe(model.feedId, function() { feeds.update() }) + } } + Component.onCompleted: { + feeds.selectedIndex = index + } } } } diff --git a/qml/ttrss/sailfish/pages/FeedItemDelegate.qml b/qml/ttrss/sailfish/pages/FeedItemDelegate.qml index 3e2149e..9cdf3c6 100644 --- a/qml/ttrss/sailfish/pages/FeedItemDelegate.qml +++ b/qml/ttrss/sailfish/pages/FeedItemDelegate.qml @@ -15,11 +15,9 @@ import Sailfish.Silica 1.0 ListItem { id: listItem - signal clicked - property alias pressed: mouseArea.pressed - contentHeight: Theme.itemSizeExtraLarge width: parent.width + menu: contextMenu Row { spacing: Theme.paddingMedium @@ -104,10 +102,40 @@ ListItem { // } } } + Component { + id: contextMenu + ContextMenu { + MenuItem { + id: toggleStarMenuItem + text: model.marked ? qsTr("Unstar") : qsTr("Star") + onClicked: { + feedItems.toggleStar() + } } + MenuItem { + id: togglePublishedMenuItem + text: model.rss ? qsTr("Unpublish") : qsTr("Publish") + onClicked: { + feedItems.togglePublished() + } } + MenuItem { + id: toggleReadMenuItem + text: model.unread ? qsTr("Mark read") : qsTr("Mark Unread") + onClicked: { + feedItems.toggleRead() + } } + MenuItem { + id: openInBrowserMenuItem + text: qsTr("Open in Web Browser") + visible: model.url && model.url != "" + onClicked: { + var item = feedItems.getSelectedItem() + Qt.openUrlExternally(item.url) + } - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: listItem.clicked() + } + Component.onCompleted: { + feedItems.selectedIndex = index + } + } } }