123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- /****************************************************************************
- **
- ** Copyright (C) 2012 Róbert Márki
- **
- ** This file is part of Web Feeds.
- **
- ** Web Feeds 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.
- **
- ** Web Feeds 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 Web Feeds. If not, see <http://www.gnu.org/licenses/>.
- ****************************************************************************/
- import QtQuick 1.1
- import com.nokia.meego 1.0
- import "../../../../shared/qml" as Shared
- import "../../../../shared/qml/UIConstants.js" as UIConstants
- import "../misc" as Misc
- import NewsBlur 1.0
- Item {
- id: root
- signal released(int row)
- signal holded(int row)
- property int titleSize: UIConstants.LIST_TILE_SIZE
- property int titleWeight: Font.Bold
- property color titleColor: UIConstants.LIST_TITLE_COLOR
- property int subtitleSize: UIConstants.FONT_XXSMALL
- property int subtitleWeight: Font.Light
- property variant service
- height: UIConstants.XLARGE_DELEGATE_HEIGHT
- width: parent.width
- BorderImage {
- id: background
- anchors.fill: parent
- // Fill page porders
- anchors.leftMargin: -UIConstants.DEFAULT_MARGIN
- anchors.rightMargin: -UIConstants.DEFAULT_MARGIN
- visible: mouseArea.pressed
- source: "image://theme/meegotouch-panel-background-pressed"
- }
- Shared.Separator {
- id: separator
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.leftMargin: UIConstants.DEFAULT_MARGIN
- anchors.right: parent.right
- anchors.rightMargin: UIConstants.DEFAULT_MARGIN
- visible: index
- }
- Item {
- id: conents
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.rightMargin: UIConstants.DEFAULT_MARGIN
- Misc.UnreadMark {
- id: unreadMark
- anchors.left: parent.left
- anchors.leftMargin: UIConstants.DEFAULT_HALF_MARGIN
- anchors.top: parent.top
- anchors.topMargin: UIConstants.PADDING_MEDIUM
- anchors.bottom: parent.bottom
- anchors.bottomMargin: UIConstants.PADDING_SMALL
- active: !model.isRead
- classification: model.itemClassification
- }
- Text {
- id: mainText
- anchors.top: parent.top
- anchors.topMargin: UIConstants.DELEGATE_TOP_MARGIN
- anchors.left: unreadMark.right
- anchors.leftMargin: 12
- anchors.right: starImage.left
- anchors.rightMargin: UIConstants.LIST_ITEM_SPACING
- text: model.title
- font.family: UIConstants.FONT_FAMILY
- font.weight: root.titleWeight
- font.pixelSize: root.titleSize
- color: root.titleColor
- elide: Text.ElideRight
- wrapMode: Text.Wrap
- maximumLineCount: 2
- textFormat: Text.PlainText
- }
- Image {
- id: starImage
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: UIConstants.LIST_ITEM_SPACING
- source: "qrc:/plugins/newsblur/images/star_mark.png"
- width: model.starred ? 32 : 0
- height: model.starred ? 32 : 0
- visible: model.starred
- }
- Text {
- id: feedTitleText
- anchors.bottom: parent.bottom
- anchors.bottomMargin: UIConstants.PADDING_XXXLARGE
- anchors.left: unreadMark.right
- anchors.leftMargin: 12
- anchors.right: parent.right
- text: root.service.feedTitle(model.feedId);
- font.pixelSize: UIConstants.FONT_LLSMALL
- font.family: UIConstants.FONT_FAMILY_LIGHT
- color: "black"
- visible: text.length
- elide: Text.ElideRight
- textFormat: Text.PlainText
- }
- Text {
- id: dateTimeText
- anchors.bottom: parent.bottom
- anchors.bottomMargin: UIConstants.DELEGATE_BOTTOM_MARGINT
- anchors.left: unreadMark.right
- anchors.leftMargin: 12
- anchors.right: parent.right
- text: model.formattedDate
- font.family: UIConstants.FONT_FAMILY
- font.weight: root.subtitleWeight
- font.pixelSize: root.subtitleSize
- color: model.isRead ? UIConstants.LIST_SUBTITLE_COLOR : unreadMark.color
- width: parent.width
- visible: text.length
- maximumLineCount: 1
- elide: Text.ElideRight
- wrapMode: Text.NoWrap
- textFormat: Text.PlainText
- }
- }
- MouseArea {
- id: mouseArea;
- anchors.fill: parent
- onReleased: {
- if(!mouse.wasHeld)
- root.released(index);
- }
- onPressAndHold: {
- root.holded(index);
- }
- }
- }
|