From 91f750d2c28756ca8fe6c44ddd9694e5f5aab8ec Mon Sep 17 00:00:00 2001 From: Fawn Date: Thu, 13 Mar 2025 11:12:33 -0600 Subject: [PATCH] Fix track operations widget vertical alignment (#7765) In #7708, the track operations widget was given a centered vertical alignment in order to fix an aesthetic layout issue. This is being reverted, since it is possible to resize tracks, and all the other track interface elements are top-aligned. --- src/gui/tracks/TrackOperationsWidget.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index 04b171a41..559796b87 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -83,7 +83,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : // buttons in a layout. auto operationsWidget = new QWidget(this); auto operationsLayout = new QHBoxLayout(operationsWidget); - operationsLayout->setContentsMargins(0, 0, 0, 0); + operationsLayout->setContentsMargins(0, 3, 0, 0); operationsLayout->setSpacing(2); m_trackOps = new QPushButton(operationsWidget); @@ -131,7 +131,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : operationsLayout->addWidget(muteWidget); operationsLayout->addWidget(soloWidget); - layout->addWidget(operationsWidget, 0, Qt::AlignCenter | Qt::AlignLeading); + layout->addWidget(operationsWidget, 0, Qt::AlignTop | Qt::AlignLeading); connect( this, SIGNAL(trackRemovalScheduled(lmms::gui::TrackView*)), m_trackView->trackContainerView(), @@ -145,11 +145,6 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : } - - - - - /*! \brief Respond to trackOperationsWidget mouse events * * If it's the left mouse button, and Ctrl is held down, and we're @@ -180,8 +175,6 @@ void TrackOperationsWidget::mousePressEvent( QMouseEvent * me ) } - - /*! * \brief Repaint the trackOperationsWidget * @@ -222,17 +215,9 @@ bool TrackOperationsWidget::confirmRemoval() mb.setCheckBox(askAgainCheckBox); mb.setDefaultButton(QMessageBox::Cancel); - int answer = mb.exec(); - - if( answer == QMessageBox::Ok ) - { - return true; - } - return false; + return mb.exec() == QMessageBox::Ok; } - - /*! \brief Clone this track * */ @@ -270,7 +255,6 @@ void TrackOperationsWidget::clearTrack() } - /*! \brief Remove this track from the track list * */ @@ -324,6 +308,7 @@ void TrackOperationsWidget::resetClipColors() Engine::getSong()->setModified(); } + /*! \brief Update the trackOperationsWidget context menu * * For all track types, we have the Clone and Remove options. @@ -390,7 +375,6 @@ void TrackOperationsWidget::toggleRecording( bool on ) } - void TrackOperationsWidget::recordingOn() { toggleRecording( true );