Merge lp:~artmello/gallery-app/gallery-app-avoid_reload_fullscreen_toggle into lp:gallery-app

Proposed by Arthur Mello on 2015-08-27
Status: Merged
Approved by: Florian Boucault on 2015-09-03
Approved revision: 1239
Merged at revision: 1237
Proposed branch: lp:~artmello/gallery-app/gallery-app-avoid_reload_fullscreen_toggle
Merge into: lp:gallery-app
Diff against target: 55 lines (+20/-6)
1 file modified
rc/qml/MediaViewer/SingleMediaViewer.qml (+20/-6)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-avoid_reload_fullscreen_toggle
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-09-03
Florian Boucault (community) 2015-08-27 Approve on 2015-09-03
Review via email: mp+269424@code.launchpad.net

Commit Message

Request only one thumbnail to be displayed at SingleMediaViewer to avoid reloading at fullscreen toggle

Description of the Change

Request only one thumbnail to be displayed at SingleMediaViewer to avoid reloading at fullscreen toggle

To post a comment you must log in.
1235. By Arthur Mello on 2015-09-03

Handle photoviewer resize on desktop

1236. By Arthur Mello on 2015-09-03

Only change the thumbnailer size for resizes bigger than 5%

1237. By Arthur Mello on 2015-09-03

Set both attributes of size

Florian Boucault (fboucault) wrote :

'overview' cannot be referred to as it is not defined in this file. Instead viewer.width and viewer.height should probably be used.

review: Needs Fixing
Florian Boucault (fboucault) wrote :

It might be more reliable (and more succint) to do:

    property size thumbSize: Qt.size(overview.width, overview.height)

instead of:

    Component.onCompleted: {
        thumbSize = Qt.size(overview.width, overview.height)
    }

review: Needs Fixing
Florian Boucault (fboucault) wrote :

Don't forget ';' a the end of JS lines.

review: Needs Fixing
1238. By Arthur Mello on 2015-09-03

Does not use overview
Remove unnecessary onCompleted method

1239. By Arthur Mello on 2015-09-03

Always set thumbSize with a 5% margin

Florian Boucault (fboucault) wrote :

Good to go

review: Approve
1240. By Arthur Mello on 2015-09-15

Remove wrong test for video thumbnails

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/MediaViewer/SingleMediaViewer.qml'
2--- rc/qml/MediaViewer/SingleMediaViewer.qml 2015-07-28 22:02:49 +0000
3+++ rc/qml/MediaViewer/SingleMediaViewer.qml 2015-09-15 17:13:43 +0000
4@@ -28,7 +28,7 @@
5 id: viewer
6 property bool pinchInProgress: zoomPinchArea.active
7 property var mediaSource
8- property real maxDimension: overview.height
9+ property size thumbSize: Qt.size(viewer.width * 1.05, viewer.height * 1.05)
10 property bool showThumbnail: true
11
12 property bool isVideo: mediaSource.type === MediaSource.Video
13@@ -43,6 +43,22 @@
14
15 signal clicked()
16
17+ onWidthChanged: {
18+ // Only change thumbSize if width increases more than 5%
19+ // that way we do not reload image for small resizes
20+ if (width > thumbSize.width) {
21+ thumbSize = Qt.size(width * 1.05, height * 1.05);
22+ }
23+ }
24+
25+ onHeightChanged: {
26+ // Only change thumbSize if height increases more than 5%
27+ // that way we do not reload image for small resizes
28+ if (height > thumbSize.height) {
29+ thumbSize = Qt.size(width * 1.05, height * 1.05);
30+ }
31+ }
32+
33 function zoomIn(centerX, centerY, factor) {
34 flickable.scaleCenterX = centerX / (flickable.sizeScale * flickable.width);
35 flickable.scaleCenterY = centerY / (flickable.sizeScale * flickable.height);
36@@ -145,16 +161,14 @@
37 cache: false
38 source: {
39 if (viewer.isVideo) {
40- if (viewer.maxDimension > 0) {
41- return "image://thumbnailer/" + mediaSource.path
42- }
43+ return "image://thumbnailer/" + mediaSource.path
44 } else {
45 return "image://photo/" + mediaSource.path
46 }
47 }
48 sourceSize {
49- width: viewer.maxDimension
50- height: viewer.maxDimension
51+ width: viewer.thumbSize.width
52+ height: viewer.thumbSize.height
53 }
54 fillMode: Image.PreserveAspectFit
55 visible: viewer.showThumbnail

Subscribers

People subscribed via source and target branches