From f3d5a95bb2472c907bb9bb7d07dc622413e3accb Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 31 Oct 2021 13:43:27 +0100 Subject: [PATCH] Redraw all work areas while zooming (#12334) --- src/frontends/qt/GuiView.cpp | 17 ++++++++++++++--- src/frontends/qt/GuiView.h | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index 9aa325f483..1068bdd556 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -786,7 +786,7 @@ void GuiView::zoomSliderMoved(int value) { DispatchResult dr; dispatch(FuncRequest(LFUN_BUFFER_ZOOM, convert(value)), dr); - currentWorkArea()->scheduleRedraw(true); + scheduleRedrawWorkAreas(); zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), value))); } @@ -802,7 +802,7 @@ void GuiView::zoomInPressed() { DispatchResult dr; dispatch(FuncRequest(LFUN_BUFFER_ZOOM_IN), dr); - currentWorkArea()->scheduleRedraw(true); + scheduleRedrawWorkAreas(); } @@ -810,7 +810,7 @@ void GuiView::zoomOutPressed() { DispatchResult dr; dispatch(FuncRequest(LFUN_BUFFER_ZOOM_OUT), dr); - currentWorkArea()->scheduleRedraw(true); + scheduleRedrawWorkAreas(); } @@ -823,6 +823,17 @@ void GuiView::showZoomContextMenu() } +void GuiView::scheduleRedrawWorkAreas() +{ + for (int i = 0; i < d.tabWorkAreaCount(); i++) { + TabWorkArea* ta = d.tabWorkArea(i); + for (int u = 0; u < ta->count(); u++) { + ta->workArea(u)->scheduleRedraw(true); + } + } +} + + QVector GuiView::GuiViewPrivate::guiWorkAreas() { QVector areas; diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h index 657634c9fe..c16b5570e3 100644 --- a/src/frontends/qt/GuiView.h +++ b/src/frontends/qt/GuiView.h @@ -288,6 +288,9 @@ private: /// TabWorkArea * addTabWorkArea(); + /// + void scheduleRedrawWorkAreas(); + /// connect to signals in the given BufferView void connectBufferView(BufferView & bv); /// disconnect from signals in the given BufferView