summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 2fbf0ecb..f10ddbb0 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -427,12 +427,14 @@ void QQuickWebEngineViewPrivate::close()
void QQuickWebEngineViewPrivate::requestFullScreen(bool fullScreen)
{
- Q_EMIT e->fullScreenRequested(fullScreen);
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineFullScreenRequest request(this, fullScreen);
+ Q_EMIT q->fullScreenRequested(request);
}
bool QQuickWebEngineViewPrivate::isFullScreen() const
{
- return e->isFullScreen();
+ return m_isFullScreen;
}
void QQuickWebEngineViewPrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
@@ -821,15 +823,11 @@ qreal QQuickWebEngineView::zoomFactor() const
return d->adapter->currentZoomFactor();
}
-void QQuickWebEngineViewExperimental::setIsFullScreen(bool fullscreen)
-{
- d_ptr->m_isFullScreen = fullscreen;
- emit isFullScreenChanged();
-}
-bool QQuickWebEngineViewExperimental::isFullScreen() const
+bool QQuickWebEngineView::isFullScreen() const
{
- return d_ptr->m_isFullScreen;
+ Q_D(const QQuickWebEngineView);
+ return d->m_isFullScreen;
}
void QQuickWebEngineViewExperimental::setExtraContextMenuEntriesComponent(QQmlComponent *contextMenuExtras)
@@ -947,6 +945,15 @@ void QQuickWebEngineView::goBackOrForward(int offset)
d->adapter->navigateToIndex(index);
}
+void QQuickWebEngineView::fullScreenCancelled()
+{
+ Q_D(QQuickWebEngineView);
+ if (d->m_isFullScreen) {
+ d->m_isFullScreen = false;
+ Q_EMIT isFullScreenChanged();
+ }
+}
+
void QQuickWebEngineView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
QQuickItem::geometryChanged(newGeometry, oldGeometry);
@@ -1010,6 +1017,26 @@ void QQuickWebEngineView::componentComplete()
d->ensureContentsAdapter();
}
+QQuickWebEngineFullScreenRequest::QQuickWebEngineFullScreenRequest()
+ : viewPrivate(0)
+ , m_toggleOn(false)
+{
+}
+
+QQuickWebEngineFullScreenRequest::QQuickWebEngineFullScreenRequest(QQuickWebEngineViewPrivate *viewPrivate, bool toggleOn)
+ : viewPrivate(viewPrivate)
+ , m_toggleOn(toggleOn)
+{
+}
+
+void QQuickWebEngineFullScreenRequest::accept()
+{
+ if (viewPrivate && viewPrivate->m_isFullScreen != m_toggleOn) {
+ viewPrivate->m_isFullScreen = m_toggleOn;
+ Q_EMIT viewPrivate->q_ptr->isFullScreenChanged();
+ }
+}
+
QQuickWebEngineViewExperimental::QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate *viewPrivate)
: q_ptr(0)
, d_ptr(viewPrivate)