[LyX/master] Keep zoom label width constant (#12186)

Juergen Spitzmueller spitz at lyx.org
Mon Mar 8 06:29:08 UTC 2021


commit b9fb2a236e43683942c4bf64c5a79feac4aa355f
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Mar 8 07:33:37 2021 +0100

    Keep zoom label width constant (#12186)
---
 src/frontends/qt/GuiView.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 30de824..e7a129b 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -657,6 +657,11 @@ GuiView::GuiView(int id)
 
 	zoom_value_ = new QLabel(statusBar());
 	zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom)));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+	zoom_value_->setMinimumWidth(fm.horizontalAdvance("000%"));
+#else
+	zoom_value_->setMinimumWidth(fm.width("000%"));
+#endif
 	statusBar()->addPermanentWidget(zoom_value_);
 	zoom_value_->setEnabled(currentBufferView());
 


More information about the lyx-cvs mailing list