From be6dc7dd5dc10f79efaaaa2525b2ba77d0b02c46 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 7 Mar 2021 17:21:52 +0100 Subject: [PATCH] Show zoom value in statusbar --- src/frontends/qt/GuiView.cpp | 7 +++++-- src/frontends/qt/GuiView.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index e542dc99c9..f8929a227a 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -654,6 +654,10 @@ GuiView::GuiView(int id) connect(zoomslider, SIGNAL(valueChanged(int)), this, SLOT(zoomValueChanged(int))); connect(this, SIGNAL(currentZoomChanged(int)), zoomslider, SLOT(setValue(int))); + zoom_value_ = new QLabel(statusBar()); + zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom))); + statusBar()->addPermanentWidget(zoom_value_); + int const iconheight = max(int(d.normalIconSize), fm.height()); QSize const iconsize(iconheight, iconheight); @@ -758,8 +762,7 @@ void GuiView::zoomSliderMoved(int value) DispatchResult dr; dispatch(FuncRequest(LFUN_BUFFER_ZOOM, convert(value)), dr); currentWorkArea()->scheduleRedraw(true); - message(bformat(_("Zoom level is now %1$d% (default value: %2$d%)"), - value, lyxrc.defaultZoom)); + zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), value))); } diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h index 0b2650f79c..6109460dd4 100644 --- a/src/frontends/qt/GuiView.h +++ b/src/frontends/qt/GuiView.h @@ -493,6 +493,8 @@ private: QLabel * read_only_; /// Statusbar widget that shows version control status QLabel * version_control_; + /// Statusbar widget that shows zoom value + QLabel * zoom_value_; /// The rate from which the actual zoom value is calculated /// from the default zoom pref -- 2.39.5