diff --git a/ChangeLog b/ChangeLog index 86f8933f9..86169a008 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-08-05 Tobias Doerffel + * src/gui/widgets/automatable_button.cpp: + show context-menu of button-group if a button is part of it + * plugins/sf2_player/sf2_player.cpp: - query data from correct model when activating reverb (closes #2035134) - convert from note-play-handle's volume to MIDI-velocity when calling diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index cbed8467b..bf7f1dad4 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -87,33 +87,25 @@ void automatableButton::update( void ) void automatableButton::contextMenuEvent( QContextMenuEvent * _me ) { -/* if( model()->nullTrack() && - ( m_group == NULL || m_group->model()->nullTrack() ) )*/ - if( m_group != NULL && !m_group->model()->isAutomated() ) - { - QPushButton::contextMenuEvent( _me ); - return; - } - // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent( NULL ); - QString targetName; if ( m_group != NULL ) { - targetName = m_group->model()->displayName(); + captionMenu contextMenu( m_group->model()->displayName() ); + m_group->addDefaultActions( &contextMenu ); + contextMenu.exec( QCursor::pos() ); } else { - targetName = model()->displayName(); + captionMenu contextMenu( model()->displayName() ); + addDefaultActions( &contextMenu ); + contextMenu.exec( QCursor::pos() ); } - captionMenu contextMenu( targetName ); - addDefaultActions( &contextMenu ); - contextMenu.exec( QCursor::pos() ); } @@ -142,9 +134,10 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) void automatableButton::mouseReleaseEvent( QMouseEvent * _me ) { - // TODO: Fix this. for example: LeftDown, RightDown, Both Released causes two events - // or - pressing down then releasing outside of the bbox causes click event. - emit clicked(); + if( _me && _me->button() == Qt::LeftButton ) + { + emit clicked(); + } }