Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/qml/pages/CameraUI.qml b/qml/pages/CameraUI.qml
- index 985a2f7..4dc5d3b 100644
- --- a/qml/pages/CameraUI.qml
- +++ b/qml/pages/CameraUI.qml
- @@ -93,6 +93,39 @@ Page {
- imageCapture {
- onImageCaptured: {
- photoPreview.source = preview // Show the preview in an Image
- + console.log("Camera: captured", photoPreview.source)
- + }
- + onImageSaved: {
- + console.log("Camera: image saved") //, photo.source)
- + photo.source = "file://" + path
- + //modelData.append({ photoPath: "file://" + path, photoMini: photo })
- + modelData.append({ photoPath: "file://" + path })
- + //modelData.append({ photoMini: photo })
- + btnGallery.visible = true
- + btnGallery.enabled = true
- + }
- + }
- + }
- +
- + Image {
- + id: photoPreview
- +
- + onStatusChanged: {
- + if (photoPreview.status == Image.Ready) {
- + console.log('photoPreview ready')
- + }
- + }
- + }
- +
- + Image {
- + id: photo
- + visible: false
- +
- + onStatusChanged: {
- + if (photo.status == Image.Ready) {
- + sourceSize: sourceSize / 4
- + //modelData.append({ "photoPath": camera.imageCapture.path, "photoMini": photo })
- + console.log("photo ready:", source, photo )
- }
- }
- }
- @@ -445,6 +478,10 @@ Page {
- }
- */
- + ListModel {
- + id: modelData
- + }
- +
- Timer {
- id: delayQuery
- interval: 1000
- @@ -608,4 +645,26 @@ Page {
- return siz.width + "x" + siz.height;
- }
- +
- + RoundButton {
- + id: btnGallery
- +
- + visible: false
- + enabled: false
- +
- + anchors.bottom: parent.bottom
- + anchors.bottomMargin: 50
- + anchors.right: parent.right
- + anchors.rightMargin: 50
- +
- + height: parent.height / 6
- + width: height
- +
- + image: "image://theme/icon-m-share-gallery"
- +
- + onClicked: {
- + pageStack.push(Qt.resolvedUrl("GalleryUI.qml"), { "photoList": modelData })
- + }
- + }
- +
- }
- ####### qml/pages/GalleryUI.qml #####
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import Sailfish.Media 1.0
- import QtMultimedia 5.4
- import QtQuick.Layouts 1.0
- import uk.co.piggz.harbour_advanced_camera 1.0
- import Nemo.Configuration 1.0
- import "../components/"
- Page {
- id: galleryPage
- property var photoList: ({})
- // The effective value will be restricted by ApplicationWindow.allowedOrientations
- allowedOrientations: Orientation.Landscape
- SlideshowView {
- id: gallery
- clip: true
- width: parent.width
- height: parent.height
- itemWidth: width / 2
- itemHeight: height * 2 / 3
- y: parent.height / 6
- model: photoList
- delegate: Rectangle {
- id: delegate
- width: gallery.itemWidth
- height: gallery.height
- border.width: 1
- color: 'black'
- Image {
- id: thumbnail
- sourceSize.width: parent.width
- anchors.fill: parent
- fillMode: Image.PreserveAspectFit
- //source: photoMini.source
- source: photoPath
- opacity: 1
- MouseArea {
- anchors.fill: parent
- onClicked: {
- //TODO: open the photo
- console.log("Clicked", thumbnail.source)
- Qt.openUrlExternally(thumbnail.source)
- }
- }
- }
- /*
- Label {
- id: lblThumbnail
- color: 'white'
- text: thumbnail.source
- }
- */
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment