I have made the following changes intended for :
  CE:Apps:MTF / qmlgallery

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5252

Thank You,
Robin Burchell

[This message was auto-generated]

---

Request # 5252:

Messages from BOSS:

State: review at 2012-07-22T15:28:23 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:w00t:branches:CE:Apps:MTF / qmlgallery -> CE:Apps:MTF / 
qmlgallery
  
changes files:
--------------
--- qmlgallery.changes
+++ qmlgallery.changes
@@ -0,0 +1,9 @@
+* Sun Jul 22 2012 Robin Burchell <[email protected]> - 0.0.5
+- Fixes NEMO#235: Glitch on transition to landscape
+- Fixes NEMO#232: When exiting the full image view, the zoom factor
+  should be reset (optionally animated)
+- Fixes NEMO#212: Landscape layout needs some work
+- Fixes NEMO#189: Add small padding between images
+- Add double tap to zoom out of an image when in full image view
+- Add a toolbar on the main page, currently only for asthetic reasons
+

old:
----
  qmlgallery-0.0.4.tar.bz2

new:
----
  qmlgallery-0.0.5.tar.bz2

spec files:
-----------
--- qmlgallery.spec
+++ qmlgallery.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    Photo Gallery for Nemo
-Version:    0.0.4
+Version:    0.0.5
 Release:    1
 Group:      Applications/System
 License:    BSD

other changes:
--------------

++++++ qmlgallery-0.0.4.tar.bz2 -> qmlgallery-0.0.5.tar.bz2
--- qml/qmlgallery/ImagePage.qml
+++ qml/qmlgallery/ImagePage.qml
@@ -248,6 +248,24 @@
                             else if (scale == 1 && imageview.interactive == 
false) imageview.interactive = true
                         }
 
+                        MouseArea {
+                            anchors.fill: parent
+
+                            Timer {
+                                id: doubleClickTimer
+                                interval: 350
+                            }
+
+                            // onDoubleClicked seems broken on-device with all 
of the flickable/pincharea here
+                            onClicked: {
+                                if (doubleClickTimer.running) {
+                                    img.scale = 1
+                                    flickImg.contentX = flickImg.contentY = 0
+                                }
+                                else
+                                    doubleClickTimer.start()
+                            }
+                        }
                     }
 
                 }
@@ -267,5 +285,4 @@
                 onClicked: appWindow.pageStack.pop()
             }
     }
-
 }
--- qml/qmlgallery/MainPage.qml
+++ qml/qmlgallery/MainPage.qml
@@ -35,33 +35,54 @@
 
 Page {
     anchors.fill: parent
+    tools: mainTools
 
-    //tools: commonTools
+    // baseThumbnailSize is used to request images, and display size will be <=
+    property int baseThumbnailSize: 160
+    property int thumbnailSize: 0
+    property int padding: 2
+
+    Component.onCompleted: updateThumbnailSize()
+    onPaddingChanged: updateThumbnailSize()
+    onBaseThumbnailSizeChanged: updateThumbnailSize()
+ 
+    // Calculate the thumbnail size to fit items of approximately 160px
+    // onto each row with a minimal amount of extra space. The goal is
+    // to avoid having a large unused area on the right edge.
+    function updateThumbnailSize() {
+        var itemsPerRow = Math.floor(width / baseThumbnailSize)
+        // Ideally, this would use (padding*(itemsPerRow-1)), but GridView's
+        // behavior on cellWidth requires the rightmost item to have padding.
+        thumbnailSize = Math.floor((width - padding * itemsPerRow) / 
itemsPerRow)
+    }
+
+    Connections {
+        target: screen
+        onCurrentOrientationChanged: updateThumbnailSize()
+    }
 
     GridView {
         id: grid
-        anchors.centerIn: parent
-
-        width: parent.width
-        height: parent.height
+        anchors.fill: parent
 
         flow: GridView.LeftToRight
         maximumFlickVelocity: 3000
         model: gallery
-        cellHeight: 120
-        cellWidth: 120
+        cellHeight: thumbnailSize + padding
+        cellWidth: thumbnailSize + padding
+        cacheBuffer: cellHeight * 3
 
         delegate:
             Image {
-                width: grid.cellWidth
-                height: grid.cellHeight
-                sourceSize: Qt.size(120, 120)
+                width: thumbnailSize
+                height: thumbnailSize
+                sourceSize: Qt.size(baseThumbnailSize, baseThumbnailSize)
                 asynchronous: true
                 source: "image://nemoThumbnail/" + url
 
                 MouseArea {
                     anchors.fill: parent
-                    onClicked: appWindow.pageStack.push(imagepage, {imageId: 
index, galleryModel: gallery } )
+                    onClicked: 
appWindow.pageStack.push(Qt.resolvedUrl("ImagePage.qml"), {imageId: index, 
galleryModel: gallery } )
                 }
             }
 
@@ -78,5 +99,33 @@
         }
     }
 
+    ToolBarLayout {
+        id: mainTools
+        ToolIcon {
+            platformIconId: "toolbar-view-menu"
+            anchors.right: (parent === undefined) ? undefined : parent.right
+            //onClicked: (myMenu.status == DialogStatus.Closed) ? 
myMenu.open() : myMenu.close()
+        }
+    }
 
+    states: State {
+        name: "active"
+        when: status == PageStatus.Active || status == PageStatus.Activating
+
+        PropertyChanges {
+            target: appWindow.pageStack.toolBar
+            opacity: 0.8
+        }
+    }
+
+    transitions: Transition {
+        from: "active"
+        reversible: true
+
+        NumberAnimation {
+            target: appWindow.pageStack.toolBar
+            property: "opacity"
+            duration: 250
+        }
+    }
 }
--- qml/qmlgallery/main.qml
+++ qml/qmlgallery/main.qml
@@ -41,21 +41,10 @@
         id: mainPage
     }
 
-    ImagePage{
-        id: imagepage
+    Component.onCompleted: {
+        theme.inverted = true
     }
 
-    /*ToolBarLayout {
-        id: commonTools
-        ToolIcon {
-            platformIconId: "toolbar-view-menu"
-            anchors.right: (parent === undefined) ? undefined : parent.right
-            onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() 
: myMenu.close()
-        }
-    }*/
-
-
-
     /*Menu {
         id: myMenu
         visualParent: pageStack

++++++ qmlgallery.yaml
--- qmlgallery.yaml
+++ qmlgallery.yaml
@@ -1,6 +1,6 @@
 Name:  qmlgallery
 Summary: Photo Gallery for Nemo
-Version: 0.0.4
+Version: 0.0.5
 Release: 1
 Group: Applications/System
 License: BSD



Reply via email to