Merge lp:~fboucault/camera-app/convergence_fullscreen_staging into lp:camera-app/staging

Proposed by Florian Boucault on 2016-02-23
Status: Merged
Approved by: Florian Boucault on 2016-03-23
Approved revision: 636
Merged at revision: 685
Proposed branch: lp:~fboucault/camera-app/convergence_fullscreen_staging
Merge into: lp:camera-app/staging
Diff against target: 203 lines (+45/-15)
7 files modified
GalleryView.qml (+2/-0)
PhotogridView.qml (+1/-1)
SlideshowView.qml (+3/-5)
ViewFinderOverlay.qml (+3/-3)
ViewFinderOverlayLoader.qml (+2/-0)
ViewFinderView.qml (+2/-1)
camera-app.qml (+32/-5)
To merge this branch: bzr merge lp:~fboucault/camera-app/convergence_fullscreen_staging
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2016-03-23
Ubuntu Phablet Team 2016-02-23 Pending
Review via email: mp+286885@code.launchpad.net

Commit Message

Only use full screen in staged mode.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GalleryView.qml'
2--- GalleryView.qml 2016-02-23 11:46:52 +0000
3+++ GalleryView.qml 2016-02-23 11:51:30 +0000
4@@ -76,6 +76,7 @@
5 model: galleryView.model
6 visible: opacity != 0.0
7 inView: galleryView.inView && galleryView.currentView == slideshowView
8+ focus: inView
9 inSelectionMode: main.contentExportMode || galleryView.userSelectionMode
10 onToggleSelection: model.toggleSelected(currentIndex)
11 onToggleHeader: header.toggle();
12@@ -89,6 +90,7 @@
13 model: galleryView.model
14 visible: opacity != 0.0
15 inView: galleryView.inView && galleryView.currentView == photogridView
16+ focus: inView
17 inSelectionMode: main.contentExportMode || galleryView.userSelectionMode
18 onPhotoClicked: {
19 slideshowView.showPhotoAtIndex(index);
20
21=== modified file 'PhotogridView.qml'
22--- PhotogridView.qml 2016-02-23 11:46:52 +0000
23+++ PhotogridView.qml 2016-02-23 11:51:30 +0000
24@@ -22,7 +22,7 @@
25 import CameraApp 0.1
26 import "MimeTypeMapper.js" as MimeTypeMapper
27
28-Item {
29+FocusScope {
30 id: photogridView
31
32 property var model
33
34=== modified file 'SlideshowView.qml'
35--- SlideshowView.qml 2016-02-23 11:46:52 +0000
36+++ SlideshowView.qml 2016-02-23 11:51:30 +0000
37@@ -23,7 +23,7 @@
38 import CameraApp 0.1
39 import "MimeTypeMapper.js" as MimeTypeMapper
40
41-Item {
42+FocusScope {
43 id: slideshowView
44
45 property var model
46@@ -111,14 +111,12 @@
47
48 anchors.fill: parent
49 model: slideshowView.model
50+ focus: true
51 orientation: ListView.Horizontal
52 boundsBehavior: Flickable.StopAtBounds
53 cacheBuffer: width
54 highlightRangeMode: ListView.StrictlyEnforceRange
55- // FIXME: this disables the animation introduced by highlightRangeMode
56- // happening setting currentIndex; it is necessary at least because we
57- // were hitting https://bugreports.qt-project.org/browse/QTBUG-41035
58- highlightMoveDuration: 0
59+ highlightMoveDuration: UbuntuAnimation.FastDuration
60 snapMode: ListView.SnapOneItem
61 onCountChanged: {
62 // currentIndex is -1 by default and stays so until manually set to something else
63
64=== modified file 'ViewFinderOverlay.qml'
65--- ViewFinderOverlay.qml 2016-02-23 11:46:52 +0000
66+++ ViewFinderOverlay.qml 2016-02-23 11:51:30 +0000
67@@ -32,6 +32,7 @@
68 property real revealProgress: noSpaceHint.visible ? 1.0 : bottomEdge.progress
69 property var controls: controls
70 property var settings: settings
71+ property int sensorOrientation
72 property bool readyForCapture
73
74 function showFocusRing(x, y) {
75@@ -692,9 +693,8 @@
76 break;
77 }
78
79- if (Screen.primaryOrientation == Qt.PortraitOrientation) {
80- orientation += 90;
81- }
82+ // account for the orientation of the sensor
83+ orientation -= viewFinderOverlay.sensorOrientation;
84
85 if (camera.captureMode == Camera.CaptureVideo) {
86 if (main.contentExportMode) {
87
88=== modified file 'ViewFinderOverlayLoader.qml'
89--- ViewFinderOverlayLoader.qml 2016-02-23 11:46:52 +0000
90+++ ViewFinderOverlayLoader.qml 2016-02-23 11:51:30 +0000
91@@ -24,6 +24,7 @@
92 property real revealProgress: loader.item ? loader.item.revealProgress : 0
93 property var controls: loader.item ? loader.item.controls : null
94 property var settings: loader.item.settings
95+ property int sensorOrientation
96 property bool readyForCapture
97
98 function showFocusRing(x, y) {
99@@ -37,6 +38,7 @@
100 asynchronous: true
101 Component.onCompleted: {
102 loader.setSource("ViewFinderOverlay.qml", { "camera": loader.camera,
103+ "sensorOrientation": Qt.binding(function () {return loader.sensorOrientation}),
104 "readyForCapture": Qt.binding(function() { return loader.readyForCapture})
105 });
106 }
107
108=== modified file 'ViewFinderView.qml'
109--- ViewFinderView.qml 2016-02-23 11:46:52 +0000
110+++ ViewFinderView.qml 2016-02-23 11:51:30 +0000
111@@ -23,7 +23,7 @@
112 import QtGraphicalEffects 1.0
113 import Ubuntu.Content 0.1
114
115-Item {
116+FocusScope {
117 id: viewFinderView
118
119 property bool overlayVisible: true
120@@ -265,6 +265,7 @@
121 // Set orientation only at startup because later on Screen.primaryOrientation
122 // may change.
123 orientation = Screen.primaryOrientation === Qt.PortraitOrientation ? -90 : 0;
124+ viewFinderOverlay.sensorOrientation = orientation;
125 }
126
127 transform: Rotation {
128
129=== modified file 'camera-app.qml'
130--- camera-app.qml 2016-02-23 11:46:52 +0000
131+++ camera-app.qml 2016-02-23 11:51:30 +0000
132@@ -30,6 +30,26 @@
133 height: units.gu(80)
134 color: "black"
135 title: "Camera"
136+ // special flag only supported by Unity8/MIR so far that hides the shell's
137+ // top panel in Staged mode
138+ flags: Qt.Window | 0x00800000
139+
140+ property int preFullScreenVisibility
141+
142+ function toggleFullScreen() {
143+ if (main.visibility != Window.FullScreen) {
144+ preFullScreenVisibility = main.visibility;
145+ main.visibility = Window.FullScreen;
146+ } else {
147+ main.visibility = preFullScreenVisibility;
148+ }
149+ }
150+
151+ function exitFullScreen() {
152+ if (main.visibility == Window.FullScreen) {
153+ main.visibility = preFullScreenVisibility;
154+ }
155+ }
156
157 UnityActions.ActionManager {
158 actions: [
159@@ -63,11 +83,7 @@
160
161 Component.onCompleted: {
162 i18n.domain = "camera-app";
163- if (!application.desktopMode) {
164- main.showFullScreen();
165- } else {
166- main.show();
167- }
168+ main.show();
169 }
170
171
172@@ -78,6 +94,15 @@
173 flickableDirection: state == "PORTRAIT" ? Flickable.HorizontalFlick : Flickable.VerticalFlick
174 boundsBehavior: Flickable.StopAtBounds
175
176+ Keys.onPressed: {
177+ if (event.key == Qt.Key_F11) {
178+ main.toggleFullScreen();
179+ event.accepted = true;
180+ }
181+ }
182+ Keys.onEscapePressed: main.exitFullScreen()
183+
184+
185 property real panesMargin: units.gu(1)
186 property real ratio
187 property int orientationAngle: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
188@@ -256,6 +281,7 @@
189 height: viewSwitcher.height
190 overlayVisible: !viewSwitcher.moving && !viewSwitcher.flicking
191 inView: viewSwitcher.ratio < 0.5
192+ focus: !galleryView.focus
193 opacity: inView ? 1.0 : 0.0
194 onPhotoTaken: {
195 galleryView.prependMediaToModel(filePath);
196@@ -273,6 +299,7 @@
197 width: viewSwitcher.width
198 height: viewSwitcher.height
199 inView: viewSwitcher.ratio > 0.0
200+ focus: inView
201 onExit: viewSwitcher.switchToViewFinder()
202 opacity: inView ? 1.0 : 0.0
203 }

Subscribers

People subscribed via source and target branches