]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.cpp
On Mac, moving down a paragraph should place the cursor at the end of the current...
[lyx.git] / src / frontends / qt4 / GuiViewSource.cpp
index 0875c82df33430c4df6cb98d21d3935f2dbba215..edc1deaa1bb71395b08f9d7fe9d19b9706f404a1 100644 (file)
@@ -228,13 +228,16 @@ void ViewSourceWidget::updateDefaultFormat()
 }
 
 
-void ViewSourceWidget::dockLocationChanged(Qt::DockWidgetArea area)
+void ViewSourceWidget::resizeEvent (QResizeEvent * event)
 {
-       if (area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea) {
+       QSize const & formSize = formLayout->sizeHint();
+       // minimize the size of the part that contains the buttons
+       if (width() * formSize.height() < height() * formSize.width()) {
                layout_->setDirection(QBoxLayout::TopToBottom);
        } else {
                layout_->setDirection(QBoxLayout::LeftToRight);
        }
+       QWidget::resizeEvent(event);
 }
 
 
@@ -244,8 +247,6 @@ GuiViewSource::GuiViewSource(GuiView & parent,
 {
        widget_ = new ViewSourceWidget;
        setWidget(widget_);
-       connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
-               widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
 }