Merge lp:~renatofilho/mediaplayer-app/pocket-pc-full-screen into lp:mediaplayer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 400
Merged at revision: 406
Proposed branch: lp:~renatofilho/mediaplayer-app/pocket-pc-full-screen
Merge into: lp:mediaplayer-app
Prerequisite: lp:~renatofilho/mediaplayer-app/pocket-pc
Diff against target: 75 lines (+13/-16)
2 files modified
src/mediaplayer.cpp (+8/-12)
src/qml/player/Controls.qml (+5/-4)
To merge this branch: bzr merge lp:~renatofilho/mediaplayer-app/pocket-pc-full-screen
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+284302@code.launchpad.net

Commit message

Set window flag to: 0x00800000

Value that will be handled by Unity/Mir to show a full screen when appropriate.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
400. By Renato Araujo Oliveira Filho

Always show the close button for now.

We need a fix on Mir side to report the correct window state after startup.

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 'src/mediaplayer.cpp'
2--- src/mediaplayer.cpp 2016-01-20 19:52:27 +0000
3+++ src/mediaplayer.cpp 2016-02-05 14:42:46 +0000
4@@ -87,6 +87,8 @@
5 //m_view->engine()->addImageProvider("video", new ThumbnailProvider);
6 m_view->setColor(QColor("black"));
7 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
8+ //FIXME: Using a custom int that will be implement on QtMir in the future
9+ m_view->setFlags(static_cast <Qt::WindowFlags> (0x00800000));
10 m_view->setTitle(tr("Media Player"));
11 QUrl playUri;
12 if (args.count() >= 2) {
13@@ -134,11 +136,7 @@
14 m_view->setSource(source);
15 m_view->setWidth(1200);
16 m_view->setHeight(675);
17- if (windowed) {
18- m_view->showNormal();
19- } else {
20- m_view->showFullScreen();
21- }
22+ m_view->show();
23
24 return true;
25 }
26@@ -157,18 +155,16 @@
27 void
28 MediaPlayer::toggleFullscreen()
29 {
30- if (m_view->windowState() == Qt::WindowFullScreen) {
31- m_view->setWindowState(Qt::WindowNoState);
32- } else {
33- m_view->setWindowState(Qt::WindowFullScreen);
34- }
35+ QWindow::Visibility newVisibility = m_view->visibility() == QWindow::FullScreen ?
36+ QWindow::Windowed : QWindow::FullScreen;
37+ m_view->setVisibility(newVisibility);
38 }
39
40 void
41 MediaPlayer::leaveFullScreen()
42 {
43- if (m_view->windowState() == Qt::WindowFullScreen) {
44- m_view->setWindowState(Qt::WindowNoState);
45+ if (m_view->visibility() == QWindow::FullScreen) {
46+ m_view->setVisibility(QWindow::Windowed);
47 }
48 }
49
50
51=== modified file 'src/qml/player/Controls.qml'
52--- src/qml/player/Controls.qml 2016-01-26 14:48:04 +0000
53+++ src/qml/player/Controls.qml 2016-02-05 14:42:46 +0000
54@@ -153,16 +153,17 @@
55 id: _fullScreenButton
56
57 //TODO: use the correct icon based on window state
58- iconSource: mpApplication.desktopMode ?
59- Window.visibility === Window.FullScreen ? "image://theme/view-restore" : "image://theme/view-fullscreen" :
60- "image://theme/close"
61+// visible: (mpApplication.desktopMode || (Window.visibility === Window.FullScreen))
62+// iconSource: mpApplication.desktopMode ?
63+// Window.visibility === Window.FullScreen ? "image://theme/view-restore" : "image://theme/view-fullscreen" :
64+// "image://theme/close"
65+ iconSource: "image://theme/close"
66 iconSize: units.gu(3)
67 anchors.verticalCenter: parent.verticalCenter
68 width: visible ? units.gu(8) : 0
69 height: units.gu(4)
70 onClicked: controls.fullscreenClicked()
71 leftAlignment: true
72- visible: (mpApplication.desktopMode || (Window.visibility === Window.FullScreen))
73 }
74
75 VLine {

Subscribers

People subscribed via source and target branches