Merge branch 'variable-tab-widget'

This commit is contained in:
Johannes Lorenz
2019-07-22 01:22:10 +02:00
2 changed files with 19 additions and 3 deletions

View File

@@ -319,8 +319,8 @@ QSize TabWidget::minimumSizeHint() const
for ( widgetStack::const_iterator it = m_widgets.begin();
it != m_widgets.end(); ++it )
{
maxWidth = std::max(maxWidth, it->w->width());
maxHeight = std::max(maxHeight, it->w->height());
maxWidth = std::max(maxWidth, it->w->minimumSizeHint().width());
maxHeight = std::max(maxHeight, it->w->minimumSizeHint().height());
}
// "-1" :
// in "addTab", under "Position tab's window", the widget is
@@ -335,7 +335,21 @@ QSize TabWidget::minimumSizeHint() const
QSize TabWidget::sizeHint() const
{
return minimumSizeHint();
if (m_resizable)
{
int maxWidth = 0, maxHeight = 0;
for ( widgetStack::const_iterator it = m_widgets.begin();
it != m_widgets.end(); ++it )
{
maxWidth = std::max(maxWidth, it->w->sizeHint().width());
maxHeight = std::max(maxHeight, it->w->sizeHint().height());
}
// "-1" :
// in "addTab", under "Position tab's window", the widget is
// moved up by 1 pixel
return QSize(maxWidth + 4, maxHeight + m_tabbarHeight - 1);
}
else { return QWidget::sizeHint(); }
}

View File

@@ -1461,6 +1461,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
adjustTabSize(m_ssView);
adjustTabSize(instrumentFunctions);
adjustTabSize(m_effectView);
// stupid bugfix, no one knows why
m_effectView->resize(INSTRUMENT_WIDTH - 4, INSTRUMENT_HEIGHT - 4 - 1);
adjustTabSize(m_midiView);
adjustTabSize(m_miscView);