Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created February 14, 2015 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/e959b02b3106528f234b to your computer and use it in GitHub Desktop.
Save tadzik/e959b02b3106528f234b to your computer and use it in GitHub Desktop.
Page {
id: spellList
// To enable PullDownMenu, place our content in a SilicaFlickable
SilicaFlickable {
anchors.fill: parent
// PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
//PullDownMenu {
// MenuItem {
// text: qsTr("Show shit")
// onClicked: pageStack.push(Qt.resolvedUrl("SpellDetails.qml"))
// }
//}
// Tell SilicaFlickable the height of its content.
contentHeight: spellList.height
SilicaListView {
id: listView
anchors.fill: parent
header: SearchField {
id: searchField
width: listView.width
placeholderText: "Search"
onTextChanged: {
spells.search(searchField.text)
}
}
// prevent newly added list delegates from stealing focus away from the search field
currentIndex: -1
model: spells
delegate: Item {
height: Theme.itemSizeSmall
width: parent.width
Label { text: name }
MouseArea {
anchors.fill: parent
onClicked: {
pageStack.push(Qt.resolvedUrl("SpellDetails.qml"), {"spellFullText": full_text})
}
}
}
}
Spells {
id: spells
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment