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

Proposed by Arthur Mello
Status: Merged
Approved by: Florian Boucault
Approved revision: 1269
Merged at revision: 1290
Proposed branch: lp:~artmello/gallery-app/gallery-app-convergence_fullscreen
Merge into: lp:gallery-app
Diff against target: 285 lines (+59/-33)
9 files modified
click/manifest.json.in (+1/-1)
rc/qml/AlbumViewer/AlbumViewer.qml (+4/-4)
rc/qml/AlbumsOverview.qml (+1/-1)
rc/qml/GalleryApplication.qml (+6/-8)
rc/qml/MainScreen.qml (+3/-3)
rc/qml/MediaViewer/PopupPhotoViewer.qml (+2/-2)
rc/qml/PickerScreen.qml (+1/-1)
src/gallery-application.cpp (+33/-9)
src/gallery-application.h (+8/-4)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-convergence_fullscreen
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+284288@code.launchpad.net

Commit message

Set Window flag instead of Window state to toggle fullscreen mode for media viewer

Description of the change

Set Window flag instead of Window state to toggle fullscreen mode for media viewer

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

Merge with trunk

1271. By Arthur Mello

Add framework bump to ubuntu-sdk-15.04.4

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/manifest.json.in'
2--- click/manifest.json.in 2015-11-23 22:07:53 +0000
3+++ click/manifest.json.in 2016-03-23 13:53:18 +0000
4@@ -1,6 +1,6 @@
5 {
6 "description": "Gallery application for your photo collection",
7- "framework": "ubuntu-sdk-15.04.2",
8+ "framework": "ubuntu-sdk-15.04.4",
9 "architecture": "@CLICK_ARCH@",
10 "hooks": {
11 "gallery": {
12
13=== modified file 'rc/qml/AlbumViewer/AlbumViewer.qml'
14--- rc/qml/AlbumViewer/AlbumViewer.qml 2015-11-05 18:10:29 +0000
15+++ rc/qml/AlbumViewer/AlbumViewer.qml 2016-03-23 13:53:18 +0000
16@@ -85,14 +85,14 @@
17 }
18 visible = false
19 if (!APP.desktopMode)
20- setFullScreen(false);
21+ setFullScreenAppMode(false);
22 overview.popPage();
23 isOpen = false
24 }
25 onQuickCloseRequested: {
26 visible = false
27 if (!APP.desktopMode)
28- setFullScreen(false);
29+ setFullScreenAppMode(false);
30 overview.popPage();
31 isOpen = false
32 if (previewItem)
33@@ -192,7 +192,7 @@
34 else if (!hit.mediaSource) {
35 albumViewer.header.visible = !albumViewer.header.visible;
36 if (!APP.desktopMode)
37- setFullScreen(!albumViewer.header.visible);
38+ setFullScreenAppMode(!albumViewer.header.visible);
39 return;
40 }
41
42@@ -200,7 +200,7 @@
43 photoViewerLoader.fadeOpen(hit.mediaSource);
44 photoViewerLoader.item.header.visible = false;
45 if (!APP.desktopMode)
46- setFullScreen(true);
47+ setFullScreenAppMode(true);
48 }
49
50 // Long press/right click.
51
52=== modified file 'rc/qml/AlbumsOverview.qml'
53--- rc/qml/AlbumsOverview.qml 2015-11-05 18:31:30 +0000
54+++ rc/qml/AlbumsOverview.qml 2016-03-23 13:53:18 +0000
55@@ -175,7 +175,7 @@
56 if (albumViewer.origin) {
57 albumViewer.visible = true;
58 if (!APP.desktopMode)
59- setFullScreen(true);
60+ setFullScreenAppMode(true);
61 overview.pushPage(albumViewer);
62 if (object.containedCount > 0)
63 albumViewer.header.visible = false;
64
65=== modified file 'rc/qml/GalleryApplication.qml'
66--- rc/qml/GalleryApplication.qml 2015-11-05 19:25:40 +0000
67+++ rc/qml/GalleryApplication.qml 2016-03-23 13:53:18 +0000
68@@ -146,14 +146,12 @@
69 height = temp;
70 }
71
72- function setFullScreen(fullScreen)
73- {
74- APP.fullScreen = fullScreen;
75+ function setFullScreenAppMode(fullScreen) {
76+ APP.fullScreenAppMode = fullScreen;
77 }
78
79- function toggleFullScreen()
80- {
81- APP.fullScreen = !APP.fullScreen;
82+ function setFullScreenUserMode(fullScreen) {
83+ APP.fullScreenUserMode = fullScreen;
84 }
85
86 width: units.gu(DEVICE_WIDTH)
87@@ -168,11 +166,11 @@
88
89 switch(event.key) {
90 case Qt.Key_F11:
91- toggleFullScreen();
92+ setFullScreenUserMode(!APP.fullScreenUserMode);
93 break;
94
95 case Qt.Key_Escape:
96- setFullScreen(false);
97+ setFullScreenUserMode(false);
98 break;
99
100 case Qt.Key_L:
101
102=== modified file 'rc/qml/MainScreen.qml'
103--- rc/qml/MainScreen.qml 2015-12-09 19:19:04 +0000
104+++ rc/qml/MainScreen.qml 2016-03-23 13:53:18 +0000
105@@ -39,7 +39,7 @@
106 property bool applicationLoaded: application.allLoaded
107
108 //fullScreen property is used on autopilot tests
109- property bool fullScreen: APP.fullScreen
110+ property bool fullScreen: APP.fullScreenAppMode || APP.fullScreenUserMode
111
112 property alias currentPage: pageStack.currentPage
113
114@@ -125,7 +125,7 @@
115 Timer {
116 id: setFullScreenTimer
117 interval: 10;
118- onTriggered: setFullScreen(!header.visible)
119+ onTriggered: setFullScreenAppMode(!header.visible)
120 }
121
122 PageStack {
123@@ -288,7 +288,7 @@
124 target: photoViewerLoader.item
125 onCloseRequested: {
126 if (!APP.desktopMode)
127- setFullScreen(false);
128+ setFullScreenAppMode(false);
129 popPage();
130 photoViewerLoader.item.fadeClosed();
131 overview.mediaCurrentlyInView = "";
132
133=== modified file 'rc/qml/MediaViewer/PopupPhotoViewer.qml'
134--- rc/qml/MediaViewer/PopupPhotoViewer.qml 2015-11-05 18:10:29 +0000
135+++ rc/qml/MediaViewer/PopupPhotoViewer.qml 2016-03-23 13:53:18 +0000
136@@ -127,7 +127,7 @@
137 onToggleHeaderVisibilityRequested: {
138 popupPhotoViewer.header.visible = !popupPhotoViewer.header.visible
139 if (!APP.desktopMode)
140- setFullScreen(!popupPhotoViewer.header.visible);
141+ setFullScreenAppMode(!popupPhotoViewer.header.visible);
142 }
143
144 // Internal
145@@ -148,7 +148,7 @@
146 setCurrentPhoto(forMediaSource);
147 viewer.openCompleted = true;
148 if (!APP.desktopMode)
149- setFullScreen(true);
150+ setFullScreenAppMode(true);
151 overview.pushPage(popupPhotoViewer);
152 if (selection && selection.inSelectionMode)
153 popupPhotoViewer.header.visible = true;
154
155=== modified file 'rc/qml/PickerScreen.qml'
156--- rc/qml/PickerScreen.qml 2015-11-05 18:10:29 +0000
157+++ rc/qml/PickerScreen.qml 2016-03-23 13:53:18 +0000
158@@ -215,7 +215,7 @@
159 target: photoViewerLoader.item
160 onCloseRequested: {
161 if (!APP.desktopMode)
162- setFullScreen(false);
163+ setFullScreenAppMode(false);
164 popPage();
165 photoViewerLoader.item.fadeClosed();
166 }
167
168=== modified file 'src/gallery-application.cpp'
169--- src/gallery-application.cpp 2016-01-14 18:41:45 +0000
170+++ src/gallery-application.cpp 2016-03-23 13:53:18 +0000
171@@ -191,10 +191,19 @@
172 }
173
174 /*!
175- * \brief GalleryApplication::isFullScreen
176- * Returns true if window is on FullScreen mode
177- */
178-bool GalleryApplication::isFullScreen() const
179+ * \brief GalleryApplication::isFullScreenAppMode
180+ * Returns true if window is on FullScreen mode requested by app
181+ */
182+bool GalleryApplication::isFullScreenAppMode() const
183+{
184+ return m_view->flags() & static_cast <Qt::WindowFlags> (0x00800000);
185+}
186+
187+/*!
188+ * \brief GalleryApplication::isFullScreenUserMode
189+ * Returns true if window is on FullScreen mode requested by user
190+ */
191+bool GalleryApplication::isFullScreenUserMode() const
192 {
193 return m_view->windowState() == Qt::WindowFullScreen;
194 }
195@@ -245,7 +254,7 @@
196
197 //run fullscreen if specified at command line
198 if (m_cmdLineParser->isFullscreen()) {
199- setFullScreen(true);
200+ setFullScreenUserMode(true);
201 m_view->showFullScreen();
202 } else {
203 m_view->show();
204@@ -345,18 +354,33 @@
205 }
206
207 /*!
208- * \brief GalleryApplication::setFullScreen
209+ * \brief GalleryApplication::setFullScreenAppMode
210+ * Change window to use a specific flag
211+ */
212+void GalleryApplication::setFullScreenAppMode(bool fullScreen)
213+{
214+ if (fullScreen) {
215+ m_view->setFlags(m_view->flags() | static_cast <Qt::WindowFlags> (0x00800000));
216+ } else {
217+ m_view->setFlags(m_view->flags() & !static_cast <Qt::WindowFlags> (0x00800000));
218+ }
219+
220+ Q_EMIT fullScreenAppModeChanged();
221+}
222+
223+/*!
224+ * \brief GalleryApplication::setFullScreenUserMode
225 * Change window state to fullScreen or no state
226 */
227-void GalleryApplication::setFullScreen(bool fullScreen)
228+void GalleryApplication::setFullScreenUserMode(bool fullScreen)
229 {
230- if(fullScreen) {
231+ if (fullScreen) {
232 m_view->setWindowState(Qt::WindowFullScreen);
233 } else {
234 m_view->setWindowState(Qt::WindowNoState);
235 }
236
237- Q_EMIT fullScreenChanged();
238+ Q_EMIT fullScreenUserModeChanged();
239 }
240
241 void GalleryApplication::setMediaFile(const QString &mediaFile)
242
243=== modified file 'src/gallery-application.h'
244--- src/gallery-application.h 2015-12-16 12:49:12 +0000
245+++ src/gallery-application.h 2016-03-23 13:53:18 +0000
246@@ -43,7 +43,8 @@
247 Q_PROPERTY(bool pickModeEnabled READ pickModeEnabled NOTIFY pickModeEnabledChanged)
248 Q_PROPERTY(MediaSource::MediaType mediaTypeFilter READ mediaTypeFilter NOTIFY mediaTypeFilterChanged)
249 Q_PROPERTY(bool desktopMode READ isDesktopMode CONSTANT)
250- Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
251+ Q_PROPERTY(bool fullScreenAppMode READ isFullScreenAppMode WRITE setFullScreenAppMode NOTIFY fullScreenAppModeChanged)
252+ Q_PROPERTY(bool fullScreenUserMode READ isFullScreenUserMode WRITE setFullScreenUserMode NOTIFY fullScreenUserModeChanged)
253 Q_PROPERTY(QString mediaFile READ getMediaFile WRITE setMediaFile NOTIFY mediaFileChanged)
254
255 public:
256@@ -62,7 +63,8 @@
257 void setUiMode(UiMode mode);
258 bool pickModeEnabled() const;
259 bool isDesktopMode() const;
260- bool isFullScreen() const;
261+ bool isFullScreenAppMode() const;
262+ bool isFullScreenUserMode() const;
263 MediaSource::MediaType mediaTypeFilter() const;
264 const QString &getMediaFile() const;
265
266@@ -75,7 +77,8 @@
267 signals:
268 void mediaLoaded();
269 void pickModeEnabledChanged();
270- void fullScreenChanged();
271+ void fullScreenAppModeChanged();
272+ void fullScreenUserModeChanged();
273 void mediaTypeFilterChanged();
274 void mediaFileChanged();
275 void eventsViewRequested();
276@@ -84,7 +87,8 @@
277 void initCollections();
278 void switchToPickMode(QString mediaTypeFilter);
279 void switchToEventsView();
280- void setFullScreen(bool fullScreen);
281+ void setFullScreenAppMode(bool fullScreen);
282+ void setFullScreenUserMode(bool fullScreen);
283 void consistencyCheckFinished();
284 void setMediaFile(const QString &mediaFile);
285 void onMediaLoaded();

Subscribers

People subscribed via source and target branches