diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-25 17:16:49 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-27 14:03:41 +0000 |
commit | 281f8c2e4a5787aadf4c978139358141f626b8a4 (patch) | |
tree | 833a481c1290d3eea4ea8f29bd7f20b387581507 /src/webengine | |
parent | 8cd47a6df005ae61dbc366b884bebeb0ec49e889 (diff) |
Add exit full screen web action
Adds a web action that can be used for exiting fullscreen mode, and
include it the context menu whenever in fullscreen mode.
Change-Id: I7aa729a86f9ba9df476766cd40f87d9385948fea
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 8 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview_p.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 9a8a6ccb3..e123bda8f 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -266,6 +266,11 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyImageToClipboard); }); ui()->addMenuItem(item, QObject::tr("Copy Image")); } + if (isFullScreen()) { + item = new MenuItemHandler(menu); + QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ExitFullScreen); }); + ui()->addMenuItem(item, QObject::tr("Exit Full Screen Mode")); + } // FIXME: expose the context menu data as an attached property to make this more useful if (contextMenuExtraItems) { @@ -1292,6 +1297,9 @@ void QQuickWebEngineView::triggerWebAction(WebAction action) case InspectElement: d->adapter->inspectElementAt(d->contextMenuData.pos); break; + case ExitFullScreen: + d->adapter->exitFullScreen(); + break; default: Q_UNREACHABLE(); } diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 934303722..c7625d209 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -224,6 +224,7 @@ public: DownloadMediaToDisk, InspectElement, + ExitFullScreen, WebActionCount }; |