[LyX/master] Revert "Attempt to align slider and buttons in a widget"

Juergen Spitzmueller spitz at lyx.org
Tue Mar 9 13:45:05 UTC 2021


commit dee329a21fb3a734a460e46d0eb6abc2514083c8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Mar 9 14:50:23 2021 +0100

    Revert "Attempt to align slider and buttons in a widget"
    
    This reverts commit ad44f4f4483e1b7c2a358c8b6f28d7f9efdf40ff.
---
 src/frontends/qt/GuiView.cpp |   18 +++++++++---------
 src/frontends/qt/GuiView.h   |    3 ---
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 3dfad25..679d84d 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -629,9 +629,6 @@ GuiView::GuiView(int id)
 
 	QFontMetrics const fm(statusBar()->fontMetrics());
 
-	zoomwidget_ = new QWidget(statusBar());
-	zoomwidget_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-	QHBoxLayout * zoomlayout = new QHBoxLayout(zoomwidget_);
 	zoom_slider_ = new QSlider(Qt::Horizontal, statusBar());
 	// Small size slider for macOS to prevent the status bar from enlarging
 	zoom_slider_->setAttribute(Qt::WA_MacSmallSize);
@@ -664,11 +661,12 @@ GuiView::GuiView(int id)
 	zoom_out_->setFixedSize(QSize(fm.height(), fm.height()));
 	zoom_out_->setFlat(true);
 
-	zoomlayout->addWidget(zoom_out_);
-	zoomlayout->addWidget(zoom_slider_);
-	zoomlayout->addWidget(zoom_in_);
-	zoomwidget_->setEnabled(currentBufferView());
-	statusBar()->addPermanentWidget(zoomwidget_);
+	statusBar()->addPermanentWidget(zoom_out_);
+	zoom_out_->setEnabled(currentBufferView());
+	statusBar()->addPermanentWidget(zoom_slider_);
+	zoom_slider_->setEnabled(currentBufferView());
+	zoom_in_->setEnabled(currentBufferView());
+	statusBar()->addPermanentWidget(zoom_in_);
 
 	connect(zoom_slider_, SIGNAL(sliderMoved(int)), this, SLOT(zoomSliderMoved(int)));
 	connect(zoom_slider_, SIGNAL(valueChanged(int)), this, SLOT(zoomValueChanged(int)));
@@ -1402,8 +1400,10 @@ void GuiView::onBufferViewChanged()
 	// Buffer-dependent dialogs must be updated. This is done here because
 	// some dialogs require buffer()->text.
 	updateDialogs();
-	zoomwidget_->setEnabled(currentBufferView());
+	zoom_slider_->setEnabled(currentBufferView());
 	zoom_value_->setEnabled(currentBufferView());
+	zoom_in_->setEnabled(currentBufferView());
+	zoom_out_->setEnabled(currentBufferView());
 }
 
 
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index fc37bf4..728ed0d 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -29,7 +29,6 @@ class QPushButton;
 class QLabel;
 class QShowEvent;
 class QSlider;
-class QWidget;
 
 
 namespace lyx {
@@ -508,8 +507,6 @@ private:
 	QPushButton * zoom_in_;
 	/// Zoom out ("-") Button
 	QPushButton * zoom_out_;
-	/// The frame all slider elements are embedded in
-	QWidget * zoomwidget_;
 
 	/// The rate from which the actual zoom value is calculated
 	/// from the default zoom pref


More information about the lyx-cvs mailing list