summaryrefslogtreecommitdiff
path: root/qml/pages/AddWidget.qml
blob: 50bf63d9b5dbe208cb78a66f8223c8814c399890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import QtQuick 2.0
import Sailfish.Silica 1.0
import com.javispedro.salmeta 1.0

Page {
	id: page

	property int addToPage
	property int addToPos

	SilicaListView {
		id: allWidgetsListView
		anchors.fill: parent

		model: allWidgets

		header: PageHeader {
			title: "Add widget"
		}

		delegate : BackgroundItem {
			contentHeight: Theme.itemSizeMedium

			Label {
				text: url
				truncationMode: TruncationMode.Elide
				color: highlighted ? Theme.highlightColor : Theme.primaryColor
			}

			onClicked: {
				curWidgets.addWidget(url, addToPage, addToPos, size);
				pageStack.pop();
			}
		}
	}
}