1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-08 19:46:06 +01:00
LibrePilot/ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml
Dmytro Poplavskiy 3d05256a36 Welcome page UI tweaks
To make it closer to proposed design.

* Aligned the background OP logo to the bottom-right corner
* Don't upscale the OP logo
* Fixed width of community panel
* Changed the vertical layout of icons and community panel
* Fixed color of community panel titles
* Use styled text for next containing &,
   this fixes rendering but "..." are not displayed
2012-02-25 20:17:55 +11:00

80 lines
2.0 KiB
QML

// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
Item {
id: container
width: 100
height: 62
signal clicked(string url)
Text {
id: header
text: "Project News"
width: parent.width
color: "#44515c"
font {
pointSize: 14
weight: Font.Bold
}
}
ListView {
id: view
width: parent.width
anchors { top: header.bottom; topMargin: 14; bottom: parent.bottom }
model: xmlModel
delegate: listDelegate
clip: true
}
XmlListModel {
id: xmlModel
source: "http://www.openpilot.org/feed/"
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "description"; query: "description/string()" }
XmlRole { name: "link"; query: "link/string()" }
}
Component {
id: listDelegate
Item {
width: view.width
height: column.height + 16
Column {
id: column
spacing: 4
Text {
text: title
width: view.width
textFormat: text.indexOf("&") > 0 ? Text.StyledText : Text.PlainText
elide: Text.ElideRight
font.bold: true
color: mouseArea.containsMouse ? "#224d81" : "black"
}
Text {
text: description
width: view.width
textFormat: text.indexOf("&") > 0 ? Text.StyledText : Text.PlainText
elide: Text.ElideRight
color: mouseArea.containsMouse ? "#224d81" : "black"
}
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: {
console.log(link)
container.clicked(link)
}
}
}
}
}