aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/webview.cpp')
-rw-r--r--src/webengine/webview.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 8ae7eeb..b7258ea 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -182,33 +182,33 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
createWindow(QWebEnginePage::WebBrowserWindow)->load(ctxdata.linkUrl());
});
}
+ } else {
+ menu = page()->createStandardContextMenu();
+ }
- // zoom widget
- {
- menu->addSeparator();
+ // zoom widget
+ {
+ menu->addSeparator();
- auto *zoomSlider = new QSlider(Qt::Horizontal);
- zoomSlider->setMinimum(5);
- zoomSlider->setMaximum(50);
- zoomSlider->setValue(zoomFactor() * 10);
+ auto *zoomSlider = new QSlider(Qt::Horizontal);
+ zoomSlider->setMinimum(5);
+ zoomSlider->setMaximum(50);
+ zoomSlider->setValue(zoomFactor() * 10);
- auto *zoomAction = menu->addAction(tr("Zoom: %1x").arg(zoomFactor()));
- connect(zoomAction, &QAction::triggered, this, [zoomSlider]() {
- zoomSlider->setValue(10);
- });
+ auto *zoomAction = menu->addAction(tr("Zoom: %1x").arg(zoomFactor()));
+ connect(zoomAction, &QAction::triggered, this, [zoomSlider]() {
+ zoomSlider->setValue(10);
+ });
- connect(zoomSlider, &QSlider::valueChanged, this, [this, zoomAction](int value) {
- zoomAction->setText(tr("Zoom: %1x").arg(static_cast<qreal>(value) / 10));
- setZoomFactor(static_cast<qreal>(value) / 10);
- });
+ connect(zoomSlider, &QSlider::valueChanged, this, [this, zoomAction](int value) {
+ zoomAction->setText(tr("Zoom: %1x").arg(static_cast<qreal>(value) / 10));
+ setZoomFactor(static_cast<qreal>(value) / 10);
+ });
- auto *zoomWidgetAction = new QWidgetAction(this);
- zoomWidgetAction->setDefaultWidget(zoomSlider);
+ auto *zoomWidgetAction = new QWidgetAction(this);
+ zoomWidgetAction->setDefaultWidget(zoomSlider);
- menu->addAction(zoomWidgetAction);
- }
- } else {
- menu = page()->createStandardContextMenu();
+ menu->addAction(zoomWidgetAction);
}
menu->setMinimumWidth(250);