]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/views/BrowserView.cpp
Add full screen support. https://redmine.stoutner.com/issues/832
[PrivacyBrowserPC.git] / src / views / BrowserView.cpp
index 6bdbda6536cc2dcea6f421267ccc8a5781860959..e7f238fc9beacb174d292a77d6c6e5fb58d6ebe3 100644 (file)
@@ -59,6 +59,9 @@ BrowserView::BrowserView(QWidget *parent) : QWidget(parent)
     // Set the WebEngine page.
     webEngineViewPointer->setPage(webEnginePagePointer);
 
+    // Handle full screen requests.
+    connect(webEnginePagePointer, SIGNAL(fullScreenRequested(QWebEngineFullScreenRequest)), this, SLOT(fullScreenRequested(QWebEngineFullScreenRequest)));
+
     // Get handles for the aspects of the WebEngine.
     webEngineHistoryPointer = webEnginePagePointer->history();
     webEngineSettingsPointer = webEngineViewPointer->settings();
@@ -461,6 +464,15 @@ void BrowserView::forward() const
     webEngineViewPointer->forward();
 }
 
+void BrowserView::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest) const
+{
+    // Make it so.
+    emit fullScreenRequested(fullScreenRequest.toggleOn());
+
+    // Accept the request.
+    fullScreenRequest.accept();
+}
+
 void BrowserView::home() const
 {
     // Load the homepage.