Allow instrument views to grow with contents
Make InstrumentTrackWindow as large as the InstrumentView requires
This commit is contained in:
@@ -34,7 +34,6 @@ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) :
|
||||
PluginView( _Instrument, _parent )
|
||||
{
|
||||
setModel( _Instrument );
|
||||
setFixedSize( 250, 250 );
|
||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
}
|
||||
|
||||
|
||||
@@ -1326,7 +1326,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
this, SLOT( textChanged( const QString & ) ) );
|
||||
|
||||
m_nameLineEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));
|
||||
nameAndChangeTrackLayout->addWidget(m_nameLineEdit);
|
||||
nameAndChangeTrackLayout->addWidget(m_nameLineEdit, 1);
|
||||
|
||||
|
||||
// set up left/right arrows for changing instrument
|
||||
@@ -1438,8 +1438,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
generalSettingsLayout->addLayout( basicControlsLayout );
|
||||
|
||||
|
||||
m_tabWidget = new TabWidget( "", this, true );
|
||||
m_tabWidget->setFixedHeight( INSTRUMENT_HEIGHT + GRAPHIC_TAB_HEIGHT - 4 );
|
||||
m_tabWidget = new TabWidget( "", this, true, true );
|
||||
m_tabWidget->setMinimumHeight( INSTRUMENT_HEIGHT + GRAPHIC_TAB_HEIGHT - 4 );
|
||||
|
||||
|
||||
// create tab-widgets
|
||||
@@ -1474,18 +1474,16 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
|
||||
// setup piano-widget
|
||||
m_pianoView = new PianoView( this );
|
||||
m_pianoView->setFixedSize( INSTRUMENT_WIDTH, PIANO_HEIGHT );
|
||||
m_pianoView->setMinimumHeight( PIANO_HEIGHT );
|
||||
m_pianoView->setMaximumHeight( PIANO_HEIGHT );
|
||||
|
||||
vlayout->addWidget( generalSettingsWidget );
|
||||
vlayout->addWidget( m_tabWidget );
|
||||
vlayout->addWidget( m_tabWidget, 1 );
|
||||
vlayout->addWidget( m_pianoView );
|
||||
|
||||
|
||||
setModel( _itv->model() );
|
||||
|
||||
updateInstrumentView();
|
||||
|
||||
setFixedWidth( INSTRUMENT_WIDTH );
|
||||
resize( sizeHint() );
|
||||
|
||||
QMdiSubWindow * subWin = gui->mainWindow()->addWindowedWidget( this );
|
||||
@@ -1501,7 +1499,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
systemMenu->actions().at( 4 )->setVisible( false ); // Maximize
|
||||
|
||||
subWin->setWindowIcon( embed::getIconPixmap( "instrument_track" ) );
|
||||
subWin->setFixedSize( subWin->size() );
|
||||
subWin->setMinimumSize( subWin->size() );
|
||||
subWin->hide();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user