From 1c626386968ff277812bed871b044cf8f74bf18e Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Sun, 4 May 2025 15:50:33 -0400 Subject: [PATCH] Fix issue with Mixer key events and Track Label Button focus (#7870) A follow up to #7762 to fix various issues involving key events and focus grabbing problems. --- src/gui/MixerChannelView.cpp | 4 ++++ src/gui/SampleTrackWindow.cpp | 2 +- src/gui/instrument/InstrumentTrackWindow.cpp | 4 ++-- src/gui/tracks/TrackLabelButton.cpp | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/MixerChannelView.cpp b/src/gui/MixerChannelView.cpp index 13b18ce4b..3391affce 100644 --- a/src/gui/MixerChannelView.cpp +++ b/src/gui/MixerChannelView.cpp @@ -235,6 +235,10 @@ void MixerChannelView::keyPressEvent(QKeyEvent* ke) { m_fader->adjustByDialog(); } + else + { + ke->ignore(); + } } void MixerChannelView::setChannelIndex(int index) diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index eb09a2097..921ab3fce 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -267,7 +267,7 @@ void SampleTrackWindow::closeEvent(QCloseEvent* ce) hide(); } - m_stv->m_tlb->setFocus(); + m_stv->setFocus(); m_stv->m_tlb->setChecked(false); } diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 0446e857e..f6a0d6955 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -539,8 +539,8 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event ) hide(); } - m_itv->m_tlb->setFocus(); - m_itv->m_tlb->setChecked( false ); + m_itv->setFocus(); + m_itv->m_tlb->setChecked(false); } diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index c203fad8c..12b4dc4b4 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -47,6 +47,7 @@ TrackLabelButton::TrackLabelButton( TrackView * _tv, QWidget * _parent ) : m_iconName() { setAcceptDrops( true ); + setFocusPolicy(Qt::NoFocus); setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) ); setToolButtonStyle( Qt::ToolButtonTextBesideIcon );