~om26er/gallery-app/fix_selection_test

« back to all changes in this revision

Viewing changes to rc/qml/AlbumViewer/AlbumViewerTransition.qml

  • Committer: Bill Filler
  • Date: 2014-04-04 16:34:27 UTC
  • mfrom: (918.3.27 gallery-app-album-nav)
  • Revision ID: bill.filler@canonical.com-20140404163427-5yjg1t2tkv6ykou1
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        expandAlbum.width = thumbnailRect.width;
89
89
        expandAlbum.height = thumbnailRect.height;
90
90
 
91
 
        expandAlbum.showCover = album.closed
 
91
        expandAlbum.showCover = album.closed;
92
92
 
93
93
        showAlbumViewerAnimation.screenRect = getFullscreenRect(album.closed);
94
94
        showAlbumViewerAnimation.start();
99
99
    function transitionFromAlbumViewer(album, thumbnailRect, stayOpen, viewingPage) {
100
100
        // Set up portrait mode even-numbered page close transition.
101
101
        albumOpenerPortrait.viewingPage = viewingPage;
102
 
        flipOnClose = isPortrait && viewingPage !== album.currentPage && stayOpen;
 
102
        flipOnClose = isPortrait && viewingPage !== album.currentPage && stayOpen &&
 
103
                      !viewingPage == 0;
103
104
 
104
105
        albumViewerTransition.album = album;
105
106
        expandAlbum = flipOnClose ? albumOpenerPortrait : albumOpenerLandscape;
118
119
        expandAlbum.height = rect.height;
119
120
 
120
121
        hideStayingOpen = stayOpen;
121
 
        albumOpenerLandscape.showCover = !stayOpen
 
122
        albumOpenerLandscape.showCover = !stayOpen || viewingPage == 0;
122
123
 
 
124
        /* The Album preview doesn't like when the album is set to page zero,
 
125
           it actually expects its property closed to be set to true in that case.
 
126
           But we cant set that during the animation or it will think we're
 
127
           flipping to closed, so we set it at the end */
 
128
        hideAlbumViewerAnimation.setAlbumClosedAtEnd = viewingPage == 0;
123
129
        hideAlbumViewerAnimation.thumbnailRect = thumbnailRect;
124
130
        hideAlbumViewerAnimation.start();
125
131
    }
284
290
        id: hideAlbumViewerAnimation
285
291
 
286
292
        property variant thumbnailRect: {"x": 0, "y": 0, "width": 0, "height": 0}
 
293
        property bool setAlbumClosedAtEnd: false
287
294
 
288
295
        PropertyAction { target: expandAlbum; property: "visible"; value: true; }
289
296
 
372
379
                return;
373
380
 
374
381
            if (album)
375
 
                album.closed = !hideStayingOpen;
 
382
                album.closed = !hideStayingOpen || setAlbumClosedAtEnd;
376
383
 
377
384
            transitionFromAlbumViewerCompleted();
378
385
        }