First commit
This commit is contained in:
58
qml/pages/PresetList.qml
Normal file
58
qml/pages/PresetList.qml
Normal file
@@ -0,0 +1,58 @@
|
||||
import QtQuick 2.2
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
Page {
|
||||
onStatusChanged: {
|
||||
if (status === PageStatus.Activating) {
|
||||
var list = settings.presetsList()
|
||||
for(var key in list) {
|
||||
listModel.append({ name: list[key] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
PageHeader { title: qsTr("Saved presets") }
|
||||
|
||||
width: parent.width
|
||||
spacing: Theme.paddingLarge
|
||||
|
||||
SilicaListView {
|
||||
id: presetsList
|
||||
|
||||
width: parent.width; height: 800
|
||||
|
||||
model: listModel
|
||||
|
||||
delegate: BackgroundItem {
|
||||
width: parent.width
|
||||
height: Theme.itemSizeSmall
|
||||
|
||||
onClicked: {
|
||||
settings.preset = presetsList.model.get(index).name
|
||||
|
||||
pageStack.pop(firstPage)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: name
|
||||
|
||||
color: highlighted ? Theme.highlightColor : Theme.primaryColor
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
|
||||
verticalCenter: parent.verticalCenter
|
||||
|
||||
margins: Theme.paddingLarge
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: listModel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user