[LyX/master] Fix zoom slider with mouse wheel

Juergen Spitzmueller spitz at lyx.org
Sun Mar 7 14:13:40 UTC 2021


commit 128346d03d85ac4b6b758caa6b7c4e61b7513703
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Mar 7 15:18:28 2021 +0100

    Fix zoom slider with mouse wheel
---
 src/frontends/qt/GuiView.cpp |    8 ++++++++
 src/frontends/qt/GuiView.h   |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index e9ab64b..5e68603 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -644,6 +644,7 @@ GuiView::GuiView(int id)
 	statusBar()->addPermanentWidget(zoomslider);
 
 	connect(zoomslider, SIGNAL(sliderMoved(int)), this, SLOT(zoomSliderMoved(int)));
+	connect(zoomslider, SIGNAL(valueChanged(int)), this, SLOT(zoomValueChanged(int)));
 	connect(this, SIGNAL(currentZoomChanged(int)), zoomslider, SLOT(setValue(int)));
 
 	int const iconheight = max(int(d.normalIconSize), fm.height());
@@ -756,6 +757,13 @@ void GuiView::zoomSliderMoved(int value)
 }
 
 
+void GuiView::zoomValueChanged(int value)
+{
+	if (value != lyxrc.currentZoom)
+		zoomSliderMoved(value);
+}
+
+
 QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 {
 	QVector<GuiWorkArea*> areas;
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index 4f92e31..0b2650f 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -245,6 +245,8 @@ private Q_SLOTS:
 	///
 	void zoomSliderMoved(int);
 	///
+	void zoomValueChanged(int);
+	///
 	void on_currentWorkAreaChanged(GuiWorkArea *);
 	///
 	void onBufferViewChanged();


More information about the lyx-cvs mailing list