Skip to content

Commit

Permalink
Fix track handles dissapearing (#6338)
Browse files Browse the repository at this point in the history
  • Loading branch information
allejok96 authored Aug 16, 2024
1 parent bda1a9c commit 58ce9b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 0 additions & 2 deletions include/TrackContainerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ public slots:
protected:
static const int DEFAULT_PIXELS_PER_BAR = 128;

void resizeEvent( QResizeEvent * ) override;

TimePos m_currentPosition;


Expand Down
18 changes: 5 additions & 13 deletions src/gui/editors/TrackContainerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,23 @@ 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);
m_scrollLayout->setSpacing( 0 );
m_scrollLayout->setSizeConstraint( QLayout::SetMinAndMaxSize );

m_scrollArea->setWidget( scrollContent );
m_scrollArea->setWidgetResizable(true);

m_scrollArea->show();
m_rubberBand->hide();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 58ce9b4

Please sign in to comment.