diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 9bdcdcab68d..010cda60280 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -168,8 +168,6 @@ public slots: protected: static const int DEFAULT_PIXELS_PER_BAR = 128; - void resizeEvent( QResizeEvent * ) override; - TimePos m_currentPosition; diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 60a46838041..39eb41f34db 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -89,11 +89,15 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : m_tc->setHook( this ); //keeps the direction of the widget, undepended on the locale setLayoutDirection( Qt::LeftToRight ); + + // The main layout - by default it only contains the scroll area, + // but SongEditor uses the layout to add a TimeLineWidget on top auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); layout->addWidget( m_scrollArea ); + // The widget that will contain all TrackViews auto scrollContent = new QWidget; m_scrollLayout = new QVBoxLayout( scrollContent ); m_scrollLayout->setContentsMargins(0, 0, 0, 0); @@ -101,6 +105,7 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : m_scrollLayout->setSizeConstraint( QLayout::SetMinAndMaxSize ); m_scrollArea->setWidget( scrollContent ); + m_scrollArea->setWidgetResizable(true); m_scrollArea->show(); m_rubberBand->hide(); @@ -254,10 +259,6 @@ void TrackContainerView::scrollToTrackView( TrackView * _tv ) void TrackContainerView::realignTracks() { - m_scrollArea->widget()->setFixedWidth(width()); - m_scrollArea->widget()->setFixedHeight( - m_scrollArea->widget()->minimumSizeHint().height()); - for (const auto& trackView : m_trackViews) { trackView->show(); @@ -447,15 +448,6 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) -void TrackContainerView::resizeEvent( QResizeEvent * _re ) -{ - realignTracks(); - QWidget::resizeEvent( _re ); -} - - - - RubberBand *TrackContainerView::rubberBand() const { return m_rubberBand;