]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiViewSource.cpp
index 0875c82df33430c4df6cb98d21d3935f2dbba215..b2df874437206bde096e139e8559bd5bab06ac1b 100644 (file)
@@ -115,6 +115,9 @@ static bool getContent(BufferView const * view, Buffer::OutputWhat output,
        view->buffer().getSourceCode(ostr, format, par_begin, par_end + 1,
                                     output, master);
        docstring s = ostr.str();
+       // FIXME THREAD
+       // Could this be private to this particular dialog? We could have
+       // more than one of these, in different windows.
        static size_t crc = 0;
        size_t newcrc = crcCheck(s);
        if (newcrc == crc && !force_getcontent)
@@ -228,13 +231,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 +250,6 @@ GuiViewSource::GuiViewSource(GuiView & parent,
 {
        widget_ = new ViewSourceWidget;
        setWidget(widget_);
-       connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
-               widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
 }