WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Add FullScreen option to menu - v2
0001-Add-a-Toggle-FullScreen-option-to-QtLauncher-Menu.patch (text/plain), 6.89 KB, created by
Jesus Sanchez-Palencia
on 2010-03-04 14:03:49 PST
(
hide
)
Description:
Add FullScreen option to menu - v2
Filename:
MIME Type:
Creator:
Jesus Sanchez-Palencia
Created:
2010-03-04 14:03:49 PST
Size:
6.89 KB
patch
obsolete
>From 448806d0edd29bbb59b8b6a9c28695f93076eba1 Mon Sep 17 00:00:00 2001 >From: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> >Date: Thu, 4 Mar 2010 16:14:08 -0300 >Subject: [PATCH] Add a "Toggle FullScreen" option to QtLauncher Menu > >Reviewed by NOBODY (OOPS!). > >[Qt] QtLauncher needs an option to toggle FullScreen Mode >https://bugs.webkit.org/show_bug.cgi?id=35755 > >* QtLauncher/main.cpp: >(LauncherWindow::init): >(LauncherWindow::eventFilter): >(LauncherWindow::initializeView): >(LauncherWindow::toggleFullScreenMode): >(LauncherWindow::createChrome): >--- > WebKitTools/ChangeLog | 16 ++++++++++ > WebKitTools/QtLauncher/main.cpp | 60 +++++++++++++++++++++++++++++++++++--- > 2 files changed, 71 insertions(+), 5 deletions(-) > >diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog >index 3ca9820..c938a60 100644 >--- a/WebKitTools/ChangeLog >+++ b/WebKitTools/ChangeLog >@@ -1,3 +1,19 @@ >+2010-03-04 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a "Toggle FullScreen" option to QtLauncher Menu. >+ >+ [Qt] QtLauncher needs an option to toggle FullScreen Mode >+ https://bugs.webkit.org/show_bug.cgi?id=35755 >+ >+ * QtLauncher/main.cpp: >+ (LauncherWindow::init): >+ (LauncherWindow::eventFilter): >+ (LauncherWindow::initializeView): >+ (LauncherWindow::toggleFullScreenMode): >+ (LauncherWindow::createChrome): >+ > 2010-03-01 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> > > Reviewed by NOBODY (OOPS!). >diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp >index c47ef13..32a6c43 100644 >--- a/WebKitTools/QtLauncher/main.cpp >+++ b/WebKitTools/QtLauncher/main.cpp >@@ -70,7 +70,7 @@ > void QWEBKIT_EXPORT qt_drt_garbageCollector_collect(); > #endif > >- >+static const int gExitClickArea = 80; > static bool gUseGraphicsView = false; > static bool gUseCompositing = false; > static bool gCacheWebView = false; >@@ -90,9 +90,10 @@ public: > > #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) > void sendTouchEvent(); >- bool eventFilter(QObject* obj, QEvent* event); > #endif > >+ bool eventFilter(QObject* obj, QEvent* event); >+ > protected slots: > void loadStarted(); > void loadFinished(); >@@ -118,11 +119,15 @@ protected slots: > void toggleAcceleratedCompositing(bool toggle); > void toggleWebGL(bool toggle); > void initializeView(bool useGraphicsView = false); >+ void toggleFullScreenMode(bool enable); > > public slots: > void newWindow(); > void cloneWindow(); > >+signals: >+ void enteredFullScreenMode(bool on); >+ > private: > void createChrome(); > >@@ -182,8 +187,9 @@ void LauncherWindow::init(bool useGraphicsView) > setCentralWidget(splitter); > > #if defined(Q_WS_S60) >- showMaximized(); >+ setWindowState(Qt::WindowMaximized); > #else >+ setWindowState(Qt::WindowNoState); > resize(800, 600); > #endif > >@@ -193,6 +199,7 @@ void LauncherWindow::init(bool useGraphicsView) > connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); > connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), > this, SLOT(showLinkHover(const QString&, const QString&))); >+ connect(this, SIGNAL(enteredFullScreenMode(bool)), this, SLOT(toggleFullScreenMode(bool))); > > if (!gInspectorUrl.isEmpty()) > page()->settings()->setInspectorUrl(gInspectorUrl); >@@ -303,9 +310,23 @@ void LauncherWindow::sendTouchEvent() > if (m_touchPoints.size() > 1 && m_touchPoints[1].state() == Qt::TouchPointReleased) > m_touchPoints.removeAt(1); > } >+#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) > > bool LauncherWindow::eventFilter(QObject* obj, QEvent* event) > { >+ // If click pos is the bottom right corner (square with size defined by gExitClickArea) >+ // and the window is on FullScreen, the window must return to its original state. >+ if (event->type() == QEvent::MouseButtonRelease) { >+ QMouseEvent* ev = static_cast<QMouseEvent*>(event); >+ if (windowState() == Qt::WindowFullScreen >+ && ev->pos().x() > (width() - gExitClickArea) >+ && ev->pos().y() > (height() - gExitClickArea)) { >+ >+ emit enteredFullScreenMode(false); >+ } >+ } >+ >+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) > if (!m_touchMocking || obj != m_view) > return QObject::eventFilter(obj, event); > >@@ -367,9 +388,10 @@ bool LauncherWindow::eventFilter(QObject* obj, QEvent* event) > m_touchPoints.last().setState(Qt::TouchPointStationary); > } > } >+#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) >+ > return false; > } >-#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) > > void LauncherWindow::loadStarted() > { >@@ -516,6 +538,9 @@ void LauncherWindow::initializeView(bool useGraphicsView) > if (!useGraphicsView) { > WebViewTraditional* view = new WebViewTraditional(splitter); > view->setPage(page()); >+ >+ view->installEventFilter(this); >+ > m_view = view; > } else { > WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter); >@@ -527,15 +552,31 @@ void LauncherWindow::initializeView(bool useGraphicsView) > if (m_flipYAnimated) > connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip())); > >+ // The implementation of QAbstractScrollArea::eventFilter makes us need >+ // to install the event filter on the viewport of a QGraphicsView. >+ view->viewport()->installEventFilter(this); >+ > m_view = view; > } > > #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) >- m_view->installEventFilter(this); > m_touchMocking = false; > #endif > } > >+void LauncherWindow::toggleFullScreenMode(bool enable) >+{ >+ if (enable) >+ setWindowState(Qt::WindowFullScreen); >+ else { >+#if defined(Q_WS_S60) >+ setWindowState(Qt::WindowMaximized); >+#else >+ setWindowState(Qt::WindowNoState); >+#endif >+ } >+} >+ > void LauncherWindow::newWindow() > { > LauncherWindow* mw = new LauncherWindow(this, false); >@@ -600,6 +641,15 @@ void LauncherWindow::createChrome() > zoomOut->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Minus)); > resetZoom->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0)); > >+ QMenu* windowMenu = menuBar()->addMenu("&Window"); >+ QAction* toggleFullScreen = windowMenu->addAction("Toggle FullScreen", this, SIGNAL(enteredFullScreenMode(bool))); >+ toggleFullScreen->setCheckable(true); >+ toggleFullScreen->setChecked(false); >+ >+ // when exit fullscreen mode by clicking on the exit area (bottom right corner) we must >+ // uncheck the Toggle FullScreen action >+ toggleFullScreen->connect(this, SIGNAL(enteredFullScreenMode(bool)), SLOT(setChecked(bool))); >+ > QMenu* toolsMenu = menuBar()->addMenu("&Develop"); > toolsMenu->addAction("Select Elements...", this, SLOT(selectElements())); > QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I)); >-- >1.6.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hausmann
:
review+
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 35755
:
50038
|
50052
|
50534