From 4f49140a94423a49b410073fdf6fa0222f187ef9 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sun, 15 Nov 2009 04:49:23 +0000 Subject: [PATCH] start drag animation immediately in mouseMoveEvent, rather than waiting for dragMove/dragLeave event. Removed some obsolete commented lines. Removed useless Oxygen:: namespace prefix svn path=/trunk/KDE/kdebase/workspace/; revision=1049351 --- clients/oxygen/oxygenclient.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index a08257d7d2..d1a78e6693 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -1472,8 +1472,22 @@ namespace Oxygen // note: the pixmap is moved just above the pointer on purpose // because overlapping pixmap and pointer slows down the pixmap alot. - //drag->setHotSpot( QPoint( event->pos().x() - geometry.left(), geometry.height() ) ); drag->setHotSpot( QPoint( event->pos().x() - geometry.left(), -1 ) ); + + // must start animation immediatly rather than waiting for next drag-move or drag-leave evnet. + // however it depends on where the point is located. + if( itemData_[itemClicked].boundingRect_.contains( dragPoint_ ) ) + { + + itemData_.animate( AnimationTypes( AnimationMove|AnimationSameTarget ), sourceItem_ ); + + } else { + + itemData_.animate( AnimationTypes(AnimationLeave|AnimationSameTarget), sourceItem_ ); + + } + + drag->exec( Qt::MoveAction ); // detach tab from window @@ -1534,7 +1548,7 @@ namespace Oxygen if( itemData_.animationType() & AnimationSameTarget ) { - itemData_.animate( Oxygen::AnimationTypes(AnimationLeave|AnimationSameTarget), sourceItem_ ); + itemData_.animate( AnimationTypes(AnimationLeave|AnimationSameTarget), sourceItem_ ); } else if( itemData_.animated() ) {