~dholbach/ubuntu-rssreader-app/fix-paths

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
import "../dateutils.js" as DateUtils

UbuntuShape
{
    width: units.gu(18)
    height: units.gu(33) /*content.height + units.gu(1.5)*/
    radius: "medium"
    color: "#5C3B42"

    property variant rss_item
    property variant imageArray: []
    property variant rss_model
    property int model_index

//    Column
//    {
//        id: content
//        anchors{ left: parent.left; right: parent.right }
//        spacing: units.gu(1)

        UbuntuShape
        {
            id: u_pic
            width: parent.width
            height: pic.height /*> units.gu(12) ? pic.height : units.gu(12)*/
            radius: "medium"
            image: Image {
                id: pic
                width: u_pic.width
                fillMode: Image.PreserveAspectFit
                source: imageArray[0]
            }
        }

        Column
        {
            anchors {
                left: parent.left; right: parent.right;
                top: u_pic.bottom; bottom: parent.bottom
                topMargin: units.gu(2); bottomMargin: units.gu(1.5);
                leftMargin: units.gu(1); rightMargin: units.gu(1.5)
            }
            spacing: units.gu(1)

            Label
            {
                id: label_time
                text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
                fontSize: "x-small"
                width: parent.width
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                opacity: 0.6
            }

            Label
            {
                id: label_title
                text: rss_item.title
                width: parent.width
                height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                fontSize: "small"
                textFormat: Text.PlainText
                font.weight: Font.DemiBold
                elide: Text.ElideRight
                opacity: 0.8
            }

            Label
            {
                id: label_feedname
                text: rss_item.feed_name
                fontSize: "x-small"
                width: parent.width
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                opacity: 0.6
            }
        }
//    }

    MouseArea
    {
        anchors.fill: parent

        onClicked:
        {
            mainView.toRssPage(rss_model, model_index) ;
        }
    }
}