Fix bug 2819817: main window scrollbars
Fix problem with main-window scrollbars not adjusting when toggling off-screen children. Seems like Qt bug #260116.
This commit is contained in:
@@ -1083,17 +1083,25 @@ void MainWindow::help()
|
||||
|
||||
void MainWindow::toggleWindow( QWidget * _w )
|
||||
{
|
||||
if( m_workspace->activeSubWindow() != _w->parentWidget()
|
||||
|| _w->parentWidget()->isHidden() )
|
||||
QWidget * parent = _w->parentWidget();
|
||||
|
||||
if( m_workspace->activeSubWindow() != parent
|
||||
|| parent->isHidden() )
|
||||
{
|
||||
_w->parentWidget()->show();
|
||||
parent->show();
|
||||
_w->show();
|
||||
_w->setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
_w->parentWidget()->hide();
|
||||
parent->hide();
|
||||
}
|
||||
|
||||
// Workaround for Qt Bug #260116
|
||||
m_workspace->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_workspace->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_workspace->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||
m_workspace->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user