LP-03 Artwork rebranding : updated Logos, wizard and config shapes
[librepilot.git] / ground / openpilotgcs / src / plugins / welcome / qml / SitesPanel.qml
blob67230b3bd553aa1d049828668fbb532178b2d374
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("OpenPilot 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: "http://wiki.openpilot.org" }
26         ListElement { link: "http://www.openpilot.org/hardware/get-hardware/" }
27         ListElement { link: "http://forum.librepilot.org" }
28         ListElement { link: "http://github.com/librepilot" }
29         ListElement { link: "http://github.com/librepilot/LibrePilot/issues" }
30         function title(index){
31             if (title["text"] === undefined) {
32             title.text = [
33                 qsTr("Home"),
34                 qsTr("Wiki"),
35                 qsTr("Store"),
36                 qsTr("Forums"),
37                 qsTr("Code Reviews"),
38                 qsTr("Progress Tracker")
39                ]
40              }
41               return title.text[index]
42        }
43     }
45     ListView {
46         id: view
47         width: 839
48         anchors.topMargin: 30
49         anchors { top: parent.top; bottom: parent.bottom }
50         orientation: ListView.Horizontal
51         model: sitesModel
52         spacing: 40  // Need dynamic spacing
54         delegate: Text {
55             text: view.model.title(index)
56             wrapMode: Text.WrapAtWordBoundaryOrAnywhere
57             font {
58                 pointSize: 12
59                 weight: Font.Bold
60             }
62             color: mouseArea.containsMouse ? "#224d81" : "black"
64             MouseArea {
65                 id: mouseArea
66                 anchors.fill: parent
67                 hoverEnabled: true
68                 onClicked: {
69                     console.log(link)
70                     container.clicked(link)
71                 }
72             }
73         }
74     }