~ubuntu-branches/ubuntu/vivid/qtcreator-plugin-ubuntu/vivid

« back to all changes in this revision

Viewing changes to share/qtcreator/ubuntu/welcome/NewsBox.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Benjamin Zeller
  • Date: 2015-01-30 06:05:59 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20150130060559-1kirdtmm6bl6eb26
Tags: 3.1.1+15.04.20150130-0ubuntu1
[ Benjamin Zeller ]
Refactoring of the publish Tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2013 Canonical Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU Lesser General Public License as published by
6
 
 * the Free Software Foundation; version 2.1.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
17
 
 */
18
 
import QtQuick 2.0
19
 
import QtQuick.XmlListModel 2.0
20
 
 
21
 
ListView {
22
 
 
23
 
    clip: true
24
 
 
25
 
    property url link
26
 
 
27
 
    model: XmlListModel {
28
 
        source: link
29
 
        query: "/rss/channel/item"
30
 
 
31
 
        XmlRole { name: "title"; query: "title/string()" }
32
 
        XmlRole { name: "link"; query: "link/string()" }
33
 
        XmlRole { name: "description"; query: "description/string()" }
34
 
        XmlRole { name: "pubDate"; query: "pubDate/string()" }
35
 
    }
36
 
    delegate: Item {
37
 
        id: delegate
38
 
        height: itemContent.height+ 20
39
 
        width: delegate.ListView.view.width
40
 
        Column {
41
 
            id: itemContent
42
 
            width: parent.width
43
 
            Text {
44
 
                text: pubDate
45
 
                font.pixelSize: 10
46
 
                font.family: "Ubuntu"
47
 
                font.weight: Font.Light
48
 
            }
49
 
 
50
 
            Text {
51
 
                text: title
52
 
                font.family: "Ubuntu"
53
 
                font.pixelSize: 20
54
 
                font.letterSpacing: 1.5
55
 
                wrapMode: Text.WordWrap
56
 
                font.weight: Font.Light
57
 
                width: parent.width
58
 
            }
59
 
 
60
 
            Text {
61
 
                text: description
62
 
                font.family: "Ubuntu"
63
 
                font.pixelSize: 12
64
 
                wrapMode: Text.WordWrap
65
 
                font.weight: Font.Light
66
 
                font.letterSpacing: 1.5
67
 
                width: parent.width
68
 
                textFormat: Text.RichText
69
 
            }
70
 
        }
71
 
        MouseArea {
72
 
            anchors.fill: parent
73
 
            onClicked: {
74
 
                Qt.openUrlExternally(link)
75
 
            }
76
 
        }
77
 
    }
78
 
 
79
 
}