Skip to content

Commit

Permalink
Better ghost notes context menu handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
CYBERDEViLNL authored and zonkmachine committed Feb 8, 2019
1 parent 9981b76 commit 3d17200
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/tracks/Pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ),
Expand Down

0 comments on commit 3d17200

Please sign in to comment.