mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Another try at making the source view dock arrange itself.
The idea is to minimize the size of the form that contains the buttons. Since I do not really know what I am doing, I will revert if problems occur.
This commit is contained in:
parent
249d96ed94
commit
151960440e
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,6 +40,10 @@ public:
|
||||
///
|
||||
void setBufferView(BufferView const * bv);
|
||||
|
||||
protected:
|
||||
///
|
||||
void resizeEvent (QResizeEvent * event);
|
||||
|
||||
public Q_SLOTS:
|
||||
/// update content
|
||||
void updateView();
|
||||
@ -49,8 +53,6 @@ public Q_SLOTS:
|
||||
void updateDefaultFormat();
|
||||
///
|
||||
void contentsChanged();
|
||||
///
|
||||
void dockLocationChanged(Qt::DockWidgetArea area);
|
||||
|
||||
private:
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user