123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- /****************************************************************************
- **
- ** 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
- 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.LIST_SUBTILE_SIZE
- property int subtitleWeight: Font.Light
- property color subtitleColor: UIConstants.LIST_SUBTITLE_COLOR
- height: UIConstants.DEFAULT_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: UIConstants.DEFAULT_MARGIN
- anchors.right: parent.right
- anchors.rightMargin: UIConstants.DEFAULT_MARGIN
- Image {
- id: iconImage
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- visible: model.iconSource
- width: UIConstants.LIST_ICON_SIZE
- height: UIConstants.LIST_ICON_SIZE
- source: model.iconSource
- asynchronous: true
- }
- Label {
- id: mainText
- anchors.left: iconImage.right
- anchors.leftMargin: UIConstants.LIST_ITEM_SPACING
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- text: model.title
- font.weight: root.titleWeight
- font.pixelSize: root.titleSize
- color: root.titleColor
- width: parent.width
- elide: Text.ElideRight
- wrapMode: Text.Wrap
- maximumLineCount: 2
- }
- }
- MouseArea {
- id: mouseArea;
- anchors.fill: parent
- onReleased: {
- if(!mouse.wasHeld)
- root.released(index);
- }
- onPressAndHold: {
- root.holded(index);
- }
- }
- }
|