commit 663f198001d3b5fbd8bdbf7ab078e25aa862aa2f
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Mar 14 09:42:28 2021 +0100
Properly set minimum width with QToolButton
---
src/frontends/qt/GuiView.cpp | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 39d5c4d..451b292 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -677,11 +677,10 @@ GuiView::GuiView(int id)
zoom_value_->setAutoRaise(true);
zoom_value_->setPopupMode(QToolButton::InstantPopup);
zoom_value_->setFixedHeight(fm.height());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
- zoom_value_->setMinimumWidth(fm.horizontalAdvance("000%"));
-#else
- zoom_value_->setMinimumWidth(fm.width("000%"));
-#endif
+ // Get sensible minimum width to heep the size constant
+ zoom_value_->setText(toqstr("000%"));
+ int const mw = zoom_value_->width();
+ zoom_value_->setMinimumWidth(mw);
statusBar()->addPermanentWidget(zoom_value_);
zoom_value_->setEnabled(currentBufferView());
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs