Last active
October 3, 2015 02:11
-
-
Save Huholoman/7ef36390d5a1b9dd837b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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