Skip to content

Instantly share code, notes, and snippets.

@Huholoman
Last active October 3, 2015 02:11
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 Huholoman/7ef36390d5a1b9dd837b to your computer and use it in GitHub Desktop.
Save Huholoman/7ef36390d5a1b9dd837b to your computer and use it in GitHub Desktop.
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
id: imagePage
property alias currentIndex: listView.currentIndex
property alias model: listView.model
Drawer {
id: drawer
anchors.fill: parent
background: SilicaFlickable {
anchors.fill: parent
PullDownMenu {
MenuItem {
text: qsTr("Edit")
onClicked: pageStack.push(Qt.resolvedUrl("ImageEdit.qml"))
}
}
Column {
anchors.fill: parent
Text {
color: Theme.highlightColor
text: listView.model.get(listView.currentIndex).title
}
Text {
color: Theme.highlightColor
text: listView.model.get(listView.currentIndex).desc
}
}
}
Column {
id: column
anchors.fill: parent
SilicaListView {
id: listView
clip: true
snapMode: ListView.SnapOneItem
orientation: ListView.HorizontalFlick
highlightRangeMode: ListView.StrictlyEnforceRange
cacheBuffer: width
anchors.fill: parent
delegate: Item {
id: imageItem
width: listView.width
height: listView.height
clip: true
MouseArea {
anchors.fill: image
onClicked: {
drawer.open = !drawer.open
}
}
Image {
id: image
source: path
fillMode: Image.PreserveAspectFit
sourceSize.height: window.height * 2
asynchronous: true
anchors.fill: parent
PinchArea {
anchors.fill: parent
pinch.target: parent
pinch.minimumScale: 1
pinch.maximumScale: 4
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment