diff --git a/ChangeLog.old b/ChangeLog.old index 9e33959c4..f9ed32886 100644 --- a/ChangeLog.old +++ b/ChangeLog.old @@ -158,6 +158,11 @@ * plugins/flp_import/unrtf/convert.c: Avoid compile warnings +2009-01-03 Paul Giblock + + * src/gui/widgets/automatable_button.cpp: + fix drag support for button groups + 2008-12-22 Tobias Doerffel * CMakeLists.txt: diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index 776c0fc4f..d0687a0a6 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -32,7 +32,7 @@ #include "engine.h" #include "embed.h" #include "MainWindow.h" - +#include "string_pair_drag.h" @@ -115,6 +115,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) if( _me->button() == Qt::LeftButton && ! ( _me->modifiers() & Qt::ControlModifier ) ) { + // User simply clicked, toggle if needed if( isCheckable() ) { toggle(); @@ -123,8 +124,23 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) } else { - AutomatableModelView::mousePressEvent( _me ); - QPushButton::mousePressEvent( _me ); + // Ctrl-clicked, need to prepare drag-drop + if( m_group ) + { + // A group, we must get process it instead + AutomatableModelView* groupView = (AutomatableModelView*)m_group; + new stringPairDrag( "automatable_model", + QString::number( groupView->modelUntyped()->id() ), + QPixmap(), widget() ); + // TODO: ^^ Maybe use a predefined icon instead of the button they happened to select + _me->accept(); + } + else + { + // Otherwise, drag the standalone button + AutomatableModelView::mousePressEvent( _me ); + QPushButton::mousePressEvent( _me ); + } } }