From 06a2930749299b4a2811b924699d6cab9d048f1b Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 27 Feb 2023 18:33:22 +0100 Subject: [PATCH] Fix track handles dissapearing (#6334) --- include/TrackContainerView.h | 2 -- src/gui/editors/TrackContainerView.cpp | 18 +++++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index d53291c33d7..b2b51e1616e 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -168,8 +168,6 @@ public slots: protected: static const int DEFAULT_PIXELS_PER_BAR = 16; - void resizeEvent( QResizeEvent * ) override; - TimePos m_currentPosition; diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 38a6a36d5b2..71902d20117 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;