From 6fc9ade4094f770bf8326f961eae6bea48e4dfd8 Mon Sep 17 00:00:00 2001 From: CYBERDEViLNL Date: Wed, 6 Feb 2019 16:00:33 +0100 Subject: [PATCH] Better ghost notes context menu handling. --- src/tracks/Pattern.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 33044cf3b7e..32baf0b1484 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -676,20 +676,13 @@ void PatternView::constructContextMenu( QMenu * _cm ) connect( a, SIGNAL( triggered( bool ) ), this, SLOT( openInPianoRoll() ) ); - if( gui->pianoRoll()->currentPattern() && !m_pat->empty() ) - { - QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ), + QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ), tr( "Set as ghost in piano-roll" ), _cm ); - _cm->insertAction( _cm->actions()[1], b ); - connect( b, SIGNAL( triggered( bool ) ), - this, SLOT( setGhostInPianoRoll() ) ); - _cm->insertSeparator( _cm->actions()[2] ); - } - else - { - _cm->insertSeparator( _cm->actions()[1] ); - } - + if( m_pat->empty() ) { b->setEnabled( false ); } + _cm->insertAction( _cm->actions()[1], b ); + connect( b, SIGNAL( triggered( bool ) ), + this, SLOT( setGhostInPianoRoll() ) ); + _cm->insertSeparator( _cm->actions()[2] ); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "edit_erase" ),