~dpm/ubuntu-rssreader-app/enable-translations

« back to all changes in this revision

Viewing changes to article_items/ArticleOneImgA.qml

  • Committer: Tarmac
  • Author(s): Joey Chan
  • Date: 2013-09-03 16:05:14 UTC
  • mfrom: (55.1.1 ubuntu-rssreader-app)
  • Revision ID: tarmac-20130903160514-2bdefz78lg9jfrfq
what's new:
1. new grid view with new layout algorithm;
2. article items updated;

to do:
1. memory management of the new grid view;
2. read and unread indicate (need to modify the database first);
3. order articles;. Fixes: https://bugs.launchpad.net/bugs/1215343, https://bugs.launchpad.net/bugs/1218201, https://bugs.launchpad.net/bugs/1218204.

Approved by Ubuntu Phone Apps Jenkins Bot, Roman Shchekin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
UbuntuShape
7
7
{
8
 
    width: units.gu(20)
9
 
    height: content.height + units.gu(1.5)
 
8
    width: units.gu(18)
 
9
    height: units.gu(33) /*content.height + units.gu(1.5)*/
10
10
    radius: "medium"
11
 
    color: "#3D3028"
 
11
    color: "#5C3B42"
12
12
 
13
13
    property variant rss_item
14
14
    property variant imageArray: []
15
15
    property variant rss_model
16
16
    property int model_index
17
17
 
18
 
    Column
19
 
    {
20
 
        id: content
21
 
        anchors{ left: parent.left; right: parent.right }
22
 
        spacing: units.gu(1)
 
18
//    Column
 
19
//    {
 
20
//        id: content
 
21
//        anchors{ left: parent.left; right: parent.right }
 
22
//        spacing: units.gu(1)
23
23
 
24
24
        UbuntuShape
25
25
        {
26
26
            id: u_pic
27
27
            width: parent.width
28
 
            height: pic.height > units.gu(12) ? pic.height : units.gu(12)
 
28
            height: pic.height /*> units.gu(12) ? pic.height : units.gu(12)*/
29
29
            radius: "medium"
30
30
            image: Image {
31
31
                id: pic
37
37
 
38
38
        Column
39
39
        {
40
 
            anchors{ left: parent.left; right: parent.right; margins: units.gu(2) }
 
40
            anchors {
 
41
                left: parent.left; right: parent.right;
 
42
                top: u_pic.bottom; bottom: parent.bottom
 
43
                topMargin: units.gu(2); bottomMargin: units.gu(1.5);
 
44
                leftMargin: units.gu(1); rightMargin: units.gu(1.5)
 
45
            }
41
46
            spacing: units.gu(1)
42
47
 
43
48
            Label
44
49
            {
45
50
                id: label_time
46
51
                text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
47
 
                fontSize: "small"
48
 
                //            horizontalAlignment: Text.AlignRight
 
52
                fontSize: "x-small"
49
53
                width: parent.width
 
54
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
 
55
                opacity: 0.6
50
56
            }
51
57
 
52
58
            Label
53
59
            {
54
60
                id: label_title
55
61
                text: rss_item.title
56
 
                //            anchors.horizontalCenter: parent.horizontalCenter
57
62
                width: parent.width
 
63
                height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
58
64
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
59
 
                fontSize: "medium"
 
65
                fontSize: "small"
60
66
                textFormat: Text.PlainText
61
 
                //            horizontalAlignment: Text.AlignRight
62
67
                font.weight: Font.DemiBold
 
68
                elide: Text.ElideRight
 
69
                opacity: 0.8
63
70
            }
64
71
 
65
72
            Label
66
73
            {
67
74
                id: label_feedname
68
75
                text: rss_item.feed_name
69
 
                fontSize: "small"
 
76
                fontSize: "x-small"
70
77
                width: parent.width
71
78
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
 
79
                opacity: 0.6
72
80
            }
73
81
        }
74
 
    }
 
82
//    }
75
83
 
76
84
    MouseArea
77
85
    {
83
91
        }
84
92
    }
85
93
}
86
 
 
87
 
//Column {
88
 
//    id: delegate_item
89
 
//    width: units.gu(34)
90
 
////    height: units.gu(16)
91
 
////    anchors.fill: parent
92
 
//    property variant rss_item
93
 
//    property variant imageArray: []
94
 
//    property variant rss_model
95
 
//    property int model_index
96
 
 
97
 
//    Row
98
 
//    {
99
 
//        id: row
100
 
//        spacing: units.gu(1)
101
 
////        anchors.fill: parent
102
 
 
103
 
//        Label
104
 
//        {
105
 
//            id: label_title
106
 
//            text: rss_item.title
107
 
////            anchors.horizontalCenter: parent.horizontalCenter
108
 
//            width: units.gu(14)
109
 
//            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
110
 
////            color: "black"
111
 
//            fontSize: "medium"
112
 
//            textFormat: Text.PlainText
113
 
//            horizontalAlignment: Text.AlignRight
114
 
 
115
 
 
116
 
//        }
117
 
 
118
 
//        UbuntuShape
119
 
//        {
120
 
//            id: u_pic
121
 
//            width: units.gu(18)
122
 
//            height: pic.height
123
 
//            image: Image {
124
 
//                id: pic
125
 
//                width: units.gu(18)
126
 
//                fillMode: Image.PreserveAspectFit
127
 
//                source: imageArray[0]
128
 
////                {
129
 
////                    if (imageArray == 0)
130
 
////                    {
131
 
////                        label_title.width = units.gu(30)
132
 
////                        label_title.fontSize = "large"
133
 
////                        return ""
134
 
////                    }
135
 
////                    else if (imageArray.length > 0)
136
 
////                        return imageArray[0]
137
 
////                }
138
 
//            }
139
 
//        }
140
 
 
141
 
 
142
 
//    }
143
 
 
144
 
//    Label
145
 
//    {
146
 
//        id: label_time
147
 
//        text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
148
 
////        color: "black"
149
 
//        fontSize: "medium"
150
 
//        horizontalAlignment: Text.AlignRight
151
 
//        width: parent.width
152
 
//    }
153
 
//}