Fix -1 offset in plugin tab

In the instrument plugin tab, there was an orange stripe for
TripleOscillator. This was because internally, TabWidget moves up the
widget by 1 (TabWidget.cpp, line 89).

The size of the whole window is:

```
widget->height() + m_tabbarHeight - 1
```

So this code adds an offset of "-1" to the necessary computations.
This commit is contained in:
Johannes Lorenz
2019-04-20 13:23:42 +02:00
parent d52c220a5c
commit 91099e28d5
2 changed files with 12 additions and 3 deletions

View File

@@ -321,7 +321,10 @@ QSize TabWidget::minimumSizeHint() const
maxWidth = std::max(maxWidth, it->w->width());
maxHeight = std::max(maxHeight, it->w->height());
}
return QSize(maxWidth + 4, maxHeight + m_tabbarHeight);
// "-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::minimumSizeHint();

View File

@@ -1439,7 +1439,10 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
m_tabWidget = new TabWidget( "", this, true, true );
m_tabWidget->setMinimumHeight( INSTRUMENT_HEIGHT + GRAPHIC_TAB_HEIGHT - 4 );
// "-1" :
// in "TabWidget::addTab", under "Position tab's window", the widget is
// moved up by 1 pixel
m_tabWidget->setMinimumHeight( INSTRUMENT_HEIGHT + GRAPHIC_TAB_HEIGHT - 4 - 1 );
// create tab-widgets
@@ -1857,7 +1860,10 @@ void InstrumentTrackWindow::viewPrevInstrument()
void InstrumentTrackWindow::adjustTabSize(QWidget *w)
{
w->setMinimumSize(INSTRUMENT_WIDTH - 4, INSTRUMENT_HEIGHT - 4);
// "-1" :
// in "TabWidget::addTab", under "Position tab's window", the widget is
// moved up by 1 pixel
w->setMinimumSize(INSTRUMENT_WIDTH - 4, INSTRUMENT_HEIGHT - 4 - 1);
}
#include "InstrumentTrack.moc"