Merge lp:~fboucault/camera-app/convergence_fullscreen into lp:camera-app

Proposed by Florian Boucault
Status: Superseded
Proposed branch: lp:~fboucault/camera-app/convergence_fullscreen
Merge into: lp:camera-app
Diff against target: 204 lines (+46/-16)
7 files modified
GalleryView.qml (+2/-0)
PhotogridView.qml (+1/-1)
SlideshowView.qml (+3/-5)
ViewFinderOverlay.qml (+3/-3)
ViewFinderOverlayLoader.qml (+3/-1)
ViewFinderView.qml (+2/-1)
camera-app.qml (+32/-5)
To merge this branch: bzr merge lp:~fboucault/camera-app/convergence_fullscreen
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+286340@code.launchpad.net

This proposal has been superseded by a proposal from 2016-03-11.

Commit message

Only use full screen in staged mode.

Description of the change

Only use full screen in staged mode.

To post a comment you must log in.

Unmerged revisions

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 2015-11-26 11:29:18 +0000
3+++ GalleryView.qml 2016-02-17 15:35:50 +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 2015-11-26 13:45:38 +0000
23+++ PhotogridView.qml 2016-02-17 15:35:50 +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 2015-12-07 15:04:12 +0000
36+++ SlideshowView.qml 2016-02-17 15:35:50 +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-01-11 15:07:58 +0000
66+++ ViewFinderOverlay.qml 2016-02-17 15:35:50 +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
73 function showFocusRing(x, y) {
74 focusRing.center = Qt.point(x, y);
75@@ -663,9 +664,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-01-07 08:03:57 +0000
90+++ ViewFinderOverlayLoader.qml 2016-02-17 15:35:50 +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
97 function showFocusRing(x, y) {
98 loader.item.showFocusRing(x, y);
99@@ -35,6 +36,7 @@
100
101 asynchronous: true
102 Component.onCompleted: {
103- loader.setSource("ViewFinderOverlay.qml", { "camera": loader.camera });
104+ loader.setSource("ViewFinderOverlay.qml", { "camera": loader.camera,
105+ "sensorOrientation": Qt.binding(function () {return loader.sensorOrientation})});
106 }
107 }
108
109=== modified file 'ViewFinderView.qml'
110--- ViewFinderView.qml 2016-01-14 15:55:52 +0000
111+++ ViewFinderView.qml 2016-02-17 15:35:50 +0000
112@@ -22,7 +22,7 @@
113 import QtGraphicalEffects 1.0
114 import Ubuntu.Content 0.1
115
116-Item {
117+FocusScope {
118 id: viewFinderView
119
120 property bool overlayVisible: true
121@@ -252,6 +252,7 @@
122 // Set orientation only at startup because later on Screen.primaryOrientation
123 // may change.
124 orientation = Screen.primaryOrientation === Qt.PortraitOrientation ? -90 : 0;
125+ viewFinderOverlay.sensorOrientation = orientation;
126 }
127
128 /* Convenience item tracking the real position and size of the real video feed.
129
130=== modified file 'camera-app.qml'
131--- camera-app.qml 2016-01-07 08:03:57 +0000
132+++ camera-app.qml 2016-02-17 15:35:50 +0000
133@@ -30,6 +30,26 @@
134 height: units.gu(80)
135 color: "black"
136 title: "Camera"
137+ // special flag only supported by Unity8/MIR so far that hides the shell's
138+ // top panel in Staged mode
139+ flags: Qt.Window | 0x00800000
140+
141+ property int preFullScreenVisibility
142+
143+ function toggleFullScreen() {
144+ if (main.visibility != Window.FullScreen) {
145+ preFullScreenVisibility = main.visibility;
146+ main.visibility = Window.FullScreen;
147+ } else {
148+ main.visibility = preFullScreenVisibility;
149+ }
150+ }
151+
152+ function exitFullScreen() {
153+ if (main.visibility == Window.FullScreen) {
154+ main.visibility = preFullScreenVisibility;
155+ }
156+ }
157
158 UnityActions.ActionManager {
159 actions: [
160@@ -63,11 +83,7 @@
161
162 Component.onCompleted: {
163 i18n.domain = "camera-app";
164- if (!application.desktopMode) {
165- main.showFullScreen();
166- } else {
167- main.show();
168- }
169+ main.show();
170 }
171
172
173@@ -78,6 +94,15 @@
174 flickableDirection: state == "PORTRAIT" ? Flickable.HorizontalFlick : Flickable.VerticalFlick
175 boundsBehavior: Flickable.StopAtBounds
176
177+ Keys.onPressed: {
178+ if (event.key == Qt.Key_F11) {
179+ main.toggleFullScreen();
180+ event.accepted = true;
181+ }
182+ }
183+ Keys.onEscapePressed: main.exitFullScreen()
184+
185+
186 property real panesMargin: units.gu(1)
187 property real ratio
188 property int orientationAngle: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
189@@ -256,6 +281,7 @@
190 height: viewSwitcher.height
191 overlayVisible: !viewSwitcher.moving && !viewSwitcher.flicking
192 inView: viewSwitcher.ratio < 0.5
193+ focus: !galleryView.focus
194 opacity: inView ? 1.0 : 0.0
195 onPhotoTaken: {
196 galleryView.prependMediaToModel(filePath);
197@@ -273,6 +299,7 @@
198 width: viewSwitcher.width
199 height: viewSwitcher.height
200 inView: viewSwitcher.ratio > 0.0
201+ focus: inView
202 onExit: viewSwitcher.switchToViewFinder()
203 opacity: inView ? 1.0 : 0.0
204 }

Subscribers

People subscribed via source and target branches