]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/widgets/TabWidget.cpp
Add a man file.
[PrivacyBrowserPC.git] / src / widgets / TabWidget.cpp
index a5ecefc3b96579b75f1e0b5404b7753f2c720322..5ef7fc5aa5c36e1513c3b25bbc53dde44512dcc6 100644 (file)
@@ -219,6 +219,14 @@ PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const
             emit hideProgressBar();
     });
 
+    // Update the zoom factor when changed by CTRL-Scrolling.  This can be modified when <https://redmine.stoutner.com/issues/845> is fixed.
+    connect(webEnginePagePointer, &QWebEnginePage::contentsSizeChanged, [webEnginePagePointer, this] ()
+    {
+        // Only update the zoom factor action text if this is the current tab.
+        if (webEnginePagePointer == currentWebEnginePagePointer)
+            emit updateZoomFactorAction(webEnginePagePointer->zoomFactor());
+    });
+
     // Display find text results.
     connect(webEnginePagePointer, SIGNAL(findTextFinished(const QWebEngineFindTextResult &)), this, SLOT(findTextFinished(const QWebEngineFindTextResult &)));
 
@@ -977,15 +985,21 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin
                 // Update the notification when the download progresses.
                 connect(webEngineDownloadItemPointer, &QWebEngineDownloadItem::downloadProgress, [fileDownloadNotificationPointer, saveFileName] (qint64 bytesReceived, qint64 totalBytes)
                 {
-                    // Calculate the download percentage.
-                    int downloadPercentage = 100 * bytesReceived / totalBytes;
-
                     // Set the new text.  Total bytes will be 0 if the download size is unknown.
                     if (totalBytes > 0)
+                    {
+                        // Calculate the download percentage.
+                        int downloadPercentage = 100 * bytesReceived / totalBytes;
+
+                        // Set the file download notification text.
                         fileDownloadNotificationPointer->setText(i18nc("Download progress notification text", "%1\% of %2 downloaded (%3 of %4 bytes)", downloadPercentage, saveFileName,
                                                                     bytesReceived, totalBytes));
+                    }
                     else
+                    {
+                        // Set the file download notification text.
                         fileDownloadNotificationPointer->setText(i18nc("Download progress notification text", "%1:  %2 bytes downloaded", saveFileName, bytesReceived));
+                    }
 
                     // Display the updated notification.
                     fileDownloadNotificationPointer->update();