Skip to content

Commit 3d17200

Browse files
CYBERDEViLNLzonkmachine
authored andcommitted
Better ghost notes context menu handling.
1 parent 9981b76 commit 3d17200

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/tracks/Pattern.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -676,20 +676,13 @@ void PatternView::constructContextMenu( QMenu * _cm )
676676
connect( a, SIGNAL( triggered( bool ) ),
677677
this, SLOT( openInPianoRoll() ) );
678678

679-
if( gui->pianoRoll()->currentPattern() && !m_pat->empty() )
680-
{
681-
QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ),
679+
QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ),
682680
tr( "Set as ghost in piano-roll" ), _cm );
683-
_cm->insertAction( _cm->actions()[1], b );
684-
connect( b, SIGNAL( triggered( bool ) ),
685-
this, SLOT( setGhostInPianoRoll() ) );
686-
_cm->insertSeparator( _cm->actions()[2] );
687-
}
688-
else
689-
{
690-
_cm->insertSeparator( _cm->actions()[1] );
691-
}
692-
681+
if( m_pat->empty() ) { b->setEnabled( false ); }
682+
_cm->insertAction( _cm->actions()[1], b );
683+
connect( b, SIGNAL( triggered( bool ) ),
684+
this, SLOT( setGhostInPianoRoll() ) );
685+
_cm->insertSeparator( _cm->actions()[2] );
693686
_cm->addSeparator();
694687

695688
_cm->addAction( embed::getIconPixmap( "edit_erase" ),

0 commit comments

Comments
 (0)