diff options
author | Timothy Pearson <[email protected]> | 2013-04-12 16:49:43 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-04-12 16:49:43 -0500 |
commit | 18098b4c7042e7ce2f965964bb8977b4f17b9842 (patch) | |
tree | 5208af2813df58ff9ef7d5c878a516bd54c368d9 /kicker/taskbar/taskcontainer.cpp | |
parent | b28da13a4da674958eea60d6be6594766e42c757 (diff) | |
download | tdebase-18098b4c7042e7ce2f965964bb8977b4f17b9842.tar.gz tdebase-18098b4c7042e7ce2f965964bb8977b4f17b9842.zip |
Add initial taskbar drag and drop support
This partially resolves Bug 1103
Save horizontal space around TDE Menu button when text is in use and Kicker is greater than one line in height
Diffstat (limited to 'kicker/taskbar/taskcontainer.cpp')
-rw-r--r-- | kicker/taskbar/taskcontainer.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp index d63166bb8..484a85659 100644 --- a/kicker/taskbar/taskcontainer.cpp +++ b/kicker/taskbar/taskcontainer.cpp @@ -1393,12 +1393,19 @@ void TaskContainer::publishIconGeometry( TQPoint global ) void TaskContainer::dragEnterEvent( TQDragEnterEvent* e ) { - // ignore task drags and applet drags - if (TaskDrag::canDecode(e) || PanelDrag::canDecode(e)) + // ignore applet drags + if (PanelDrag::canDecode(e)) { return; } + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + e->accept(); + } + } + // if a dragitem is held for over a taskbutton for two seconds, // activate corresponding window if (m_filteredTasks.isEmpty()) @@ -1415,6 +1422,27 @@ void TaskContainer::dragEnterEvent( TQDragEnterEvent* e ) TQToolButton::dragEnterEvent( e ); } +void TaskContainer::dropEvent( TQDropEvent* e ) +{ + // Ignore all drops except tasks + if (!TaskDrag::canDecode(e)) { + return; + } + + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + if (taskBar->taskMoveHandler(TQWidget::mapTo(taskBar, e->pos()), TaskDrag::decode(e))) { + e->accept(); + } + } + } + + dragSwitchTimer.stop(); + + TQToolButton::dropEvent( e ); +} + void TaskContainer::dragLeaveEvent( TQDragLeaveEvent* e ) { dragSwitchTimer.stop(); |