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

Proposed by Arthur Mello
Status: Merged
Approved by: Bill Filler
Approved revision: 1158
Merged at revision: 1176
Proposed branch: lp:~artmello/gallery-app/gallery-app-fix_1425563
Merge into: lp:gallery-app
Prerequisite: lp:~phablet-team/gallery-app/gallery-app-photo-editor
Diff against target: 107 lines (+36/-5)
2 files modified
rc/qml/MediaViewer/MediaViewer.qml (+0/-1)
rc/qml/MediaViewer/SingleMediaViewer.qml (+36/-4)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-fix_1425563
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+252444@code.launchpad.net

Commit message

Do not update PhotoViewer Image sourceSize everytime the app is resized on devices.
That way we will not flicker the image everytime we toggle fullscreen
Animate Image resize

Description of the change

Do not update PhotoViewer Image sourceSize everytime the app is resized on devices.
That way we will not flicker the image everytime we toggle fullscreen
Animate Image resize

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1155. By Arthur Mello

Fix the MouseArea zoom control on SingleMediaViewer.qml

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1156. By Arthur Mello

Should not animate on height while zooming the photo

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1157. By Arthur Mello

Fix the calculation of maxDimension since the old way was crashing the image provider cache

1158. By Arthur Mello

Only show the high resolution image after it is loaded

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
2--- rc/qml/MediaViewer/MediaViewer.qml 2015-03-18 00:16:41 +0000
3+++ rc/qml/MediaViewer/MediaViewer.qml 2015-03-18 00:16:41 +0000
4@@ -147,7 +147,6 @@
5 id: media
6 objectName: "openedMedia" + index
7 mediaSource: model.mediaSource
8- maxDimension: Math.max(galleryPhotoViewer.width, galleryPhotoViewer.height)
9
10 width: galleryPhotoViewer.width
11 height: galleryPhotoViewer.height
12
13=== modified file 'rc/qml/MediaViewer/SingleMediaViewer.qml'
14--- rc/qml/MediaViewer/SingleMediaViewer.qml 2015-03-18 00:16:41 +0000
15+++ rc/qml/MediaViewer/SingleMediaViewer.qml 2015-03-18 00:16:41 +0000
16@@ -28,19 +28,30 @@
17 id: viewer
18 property bool pinchInProgress: zoomPinchArea.active
19 property var mediaSource
20- property real maxDimension
21+ property real maxDimension: 0.
22 property bool showThumbnail: true
23
24 property bool isVideo: mediaSource.type === MediaSource.Video
25 property bool userInteracting: pinchInProgress || flickable.sizeScale != 1.0
26 property bool fullyZoomed: flickable.sizeScale == zoomPinchArea.maximumZoom
27 property bool fullyUnzoomed: flickable.sizeScale == zoomPinchArea.minimumZoom
28+ property bool animateMediaOnHeight: false
29
30 property alias paintedHeight: image.paintedHeight
31 property alias paintedWidth: image.paintedWidth
32
33 signal clicked()
34
35+ onHeightChanged: {
36+ if (height > viewer.maxDimension)
37+ viewer.maxDimension = height;
38+ }
39+
40+ onWidthChanged: {
41+ if (width > viewer.maxDimension)
42+ viewer.maxDimension = width;
43+ }
44+
45 function zoomIn(centerX, centerY, factor) {
46 flickable.scaleCenterX = centerX / (flickable.sizeScale * flickable.width);
47 flickable.scaleCenterY = centerY / (flickable.sizeScale * flickable.height);
48@@ -131,6 +142,11 @@
49 }
50 }
51
52+ Behavior on height {
53+ enabled: viewer.animateMediaOnHeight
54+ UbuntuNumberAnimation {}
55+ }
56+
57 Image {
58 id: image
59 anchors.fill: parent
60@@ -159,6 +175,7 @@
61 width: width
62 height: height
63 }
64+ opacity: status == Image.Ready ? 1.0 : 0.0
65 fillMode: Image.PreserveAspectFit
66 }
67 }
68@@ -174,9 +191,17 @@
69 }
70
71 MouseArea {
72+ id: viewerMouseArea
73 anchors.fill: parent
74+ property bool eventAccepted: false
75+
76 onDoubleClicked: {
77+ if (viewerMouseArea.eventAccepted)
78+ return;
79+
80 clickTimer.stop();
81+ viewer.animateMediaOnHeight = false
82+
83 if (viewer.ListView.view.moving) {
84 // FIXME: workaround for Qt bug specific to touch:
85 // doubleClicked is received even though the MouseArea
86@@ -193,12 +218,19 @@
87 zoomOut();
88 }
89 }
90- onClicked: clickTimer.start()
91+ onClicked: {
92+ viewerMouseArea.eventAccepted = false
93+ clickTimer.start()
94+ }
95
96 Timer {
97 id: clickTimer
98- interval: 20
99- onTriggered: viewer.clicked()
100+ interval: 200
101+ onTriggered: {
102+ viewerMouseArea.eventAccepted = true
103+ viewer.animateMediaOnHeight = true
104+ viewer.clicked()
105+ }
106 }
107 }
108

Subscribers

People subscribed via source and target branches