Fix track handles dissapearing (#6338)

This commit is contained in:
Alex
2024-08-16 18:50:39 +02:00
committed by GitHub
parent bda1a9c37e
commit 58ce9b476a
2 changed files with 5 additions and 15 deletions

View File

@@ -168,8 +168,6 @@ public slots:
protected:
static const int DEFAULT_PIXELS_PER_BAR = 128;
void resizeEvent( QResizeEvent * ) override;
TimePos m_currentPosition;

View File

@@ -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;