From 018da97075a2ae3687d7fc43b3d40323804f8087 Mon Sep 17 00:00:00 2001 From: Nikhil Tanwar <2002nikhiltanwar@gmail.com> Date: Sun, 5 Sep 2021 14:51:26 +0530 Subject: [PATCH] Added condition to zoom in/out only for the current tab --- src/zimview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zimview.cpp b/src/zimview.cpp index 40b0b7a..85f1856 100644 --- a/src/zimview.cpp +++ b/src/zimview.cpp @@ -20,6 +20,8 @@ ZimView::ZimView(TabBar *tabBar, QWidget *parent) auto app = KiwixApp::instance(); connect(app->getAction(KiwixApp::ZoomInAction), &QAction::triggered, this, [=]() { + if (mp_tabBar->currentZimView() != this) + return; auto zoomFactor = mp_webView->zoomFactor(); zoomFactor += 0.1; zoomFactor = max(min(zoomFactor, 5.0), 0.25); @@ -29,6 +31,8 @@ ZimView::ZimView(TabBar *tabBar, QWidget *parent) }); connect(app->getAction(KiwixApp::ZoomOutAction), &QAction::triggered, this, [=]() { + if (mp_tabBar->currentZimView() != this) + return; auto zoomFactor = mp_webView->zoomFactor(); zoomFactor -= 0.1; zoomFactor = max(min(zoomFactor, 5.0), 0.25);