Merge lp:~bfiller/gallery-app/no-fullscreen-on-desktop into lp:gallery-app

Proposed by Bill Filler
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 909
Merged at revision: 909
Proposed branch: lp:~bfiller/gallery-app/no-fullscreen-on-desktop
Merge into: lp:gallery-app
Diff against target: 58 lines (+14/-2)
2 files modified
src/gallery-application.cpp (+12/-2)
src/gallery-application.h (+2/-0)
To merge this branch: bzr merge lp:~bfiller/gallery-app/no-fullscreen-on-desktop
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+202941@code.launchpad.net

Commit message

don't run in fullscreen if DESKTOP_MODE=1

Description of the change

don't run in fullscreen if DESKTOP_MODE=1

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gallery-application.cpp'
2--- src/gallery-application.cpp 2013-10-10 09:19:16 +0000
3+++ src/gallery-application.cpp 2014-01-23 20:19:06 +0000
4@@ -138,6 +138,15 @@
5 }
6
7 /*!
8+ * \brief GalleryApplication::isDesktopMode
9+ * Returns true if the DESKTOP_MODE env var is set
10+ */
11+bool GalleryApplication::isDesktopMode() const
12+{
13+ return (qEnvironmentVariableIsSet("DESKTOP_MODE") && (qgetenv("DESKTOP_MODE") == "1"));
14+}
15+
16+/*!
17 * \brief GalleryApplication::createView
18 * Create the master QDeclarativeView that all the pages will operate within
19 */
20@@ -151,7 +160,7 @@
21 size.transpose();
22
23 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
24- if (m_cmdLineParser->formFactor() == "desktop") {
25+ if (m_cmdLineParser->formFactor() == "desktop" || isDesktopMode()) {
26 m_view->setMinimumSize(QSize(60 * m_bguSize, 60 * m_bguSize));
27 }
28
29@@ -174,7 +183,8 @@
30 QObject* rootObject = dynamic_cast<QObject*>(m_view->rootObject());
31 QObject::connect(this, SIGNAL(mediaLoaded()), rootObject, SLOT(onLoaded()));
32
33- if (m_cmdLineParser->isFullscreen())
34+ //run fullscreen if specified at command line or not in DESKTOP_MODE (i.e. on a device)
35+ if (m_cmdLineParser->isFullscreen() || !isDesktopMode())
36 m_view->showFullScreen();
37 else
38 m_view->show();
39
40=== modified file 'src/gallery-application.h'
41--- src/gallery-application.h 2013-09-06 16:10:25 +0000
42+++ src/gallery-application.h 2014-01-23 20:19:06 +0000
43@@ -37,6 +37,7 @@
44 {
45 Q_OBJECT
46 Q_PROPERTY(bool pickModeEnabled READ pickModeEnabled NOTIFY pickModeEnabledChanged)
47+ Q_PROPERTY(bool desktopMode READ isDesktopMode)
48
49 public:
50 enum UiMode{
51@@ -53,6 +54,7 @@
52 UiMode defaultUiMode() const;
53 void setUiMode(UiMode mode);
54 bool pickModeEnabled() const;
55+ bool isDesktopMode() const;
56
57 Q_INVOKABLE void returnPickedContent(QVariant variant);
58 Q_INVOKABLE void contentPickingCanceled();

Subscribers

People subscribed via source and target branches