Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / welcome / qml / SitesPanel.qml
blob1510b75d946b7618f24978f9933b7b3c0d9634c4
1 // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import QtQuick 2.0
4 Item {
5     id: container
6     width: 100
7     height: 62
9     signal clicked(string url)
11     Text {
12         id: header
13         text: qsTr("Websites")
14         width: parent.width
15         color: "#44515c"
16         font {
17             pointSize: 14
18             weight: Font.Bold
19         }
20     }
22     ListModel {
23         id: sitesModel
24         ListElement { link: "http://www.librepilot.org" }
25         ListElement { link: "https://librepilot.atlassian.net/wiki/display/LPDOC/Welcome" }
26         ListElement { link: "http://forum.librepilot.org" }
27         ListElement { link: "http://github.com/librepilot/LibrePilot/pulls" }
28         ListElement { link: "http://github.com/librepilot/LibrePilot/issues" }
29         function title(index){
30             if (title["text"] === undefined) {
31             title.text = [
32                 qsTr("Home"),
33                 qsTr("Wiki"),
34                 qsTr("Forums"),
35                 qsTr("Pull Requests"),
36                 qsTr("Progress")
37                ]
38              }
39               return title.text[index]
40        }
41     }
43     ListView {
44         id: view
45         width: 839
46         anchors.topMargin: 30
47         anchors { top: parent.top; bottom: parent.bottom }
48         orientation: ListView.Horizontal
49         model: sitesModel
50         spacing: 40  // Need dynamic spacing
52         delegate: Text {
53             text: view.model.title(index)
54             wrapMode: Text.WrapAtWordBoundaryOrAnywhere
55             font {
56                 pointSize: 12
57                 weight: Font.Bold
58             }
60             color: mouseArea.containsMouse ? "#224d81" : "black"
62             MouseArea {
63                 id: mouseArea
64                 anchors.fill: parent
65                 hoverEnabled: true
66                 onClicked: {
67                     console.log(link)
68                     container.clicked(link)
69                 }
70             }
71         }
72     }