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/taskbarcontainer.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/taskbarcontainer.cpp')
-rw-r--r-- | kicker/taskbar/taskbarcontainer.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kicker/taskbar/taskbarcontainer.cpp b/kicker/taskbar/taskbarcontainer.cpp index 5a75f7c15..030a565dc 100644 --- a/kicker/taskbar/taskbarcontainer.cpp +++ b/kicker/taskbar/taskbarcontainer.cpp @@ -74,6 +74,8 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverrid settingsObject = new TaskBarSettings(TDESharedConfig::openConfig(configFile)); globalSettingsObject = new TaskBarSettings(TDESharedConfig::openConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME)); + setAcceptDrops(true); // Always enabled to activate task during drag&drop. + setBackgroundOrigin( AncestorOrigin ); uint margin; @@ -327,3 +329,42 @@ void TaskBarContainer::setBackground() { taskBar->setBackground(); } + +void TaskBarContainer::dragEnterEvent( TQDragEnterEvent* e ) +{ + // ignore all drags other than tasks + if (!TaskDrag::canDecode(e)) + { + return; + } + + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + e->accept(); + } + } +} + +void TaskBarContainer::dragLeaveEvent( TQDragLeaveEvent* e ) +{ + TQFrame::dragLeaveEvent( e ); +} + +void TaskBarContainer::dropEvent( TQDropEvent* e ) +{ + // ignore all drags other than tasks + if (!TaskDrag::canDecode(e)) + { + return; + } + + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + if (taskBar->taskMoveHandler(taskBar->mapFrom(this, e->pos()), TaskDrag::decode(e))) { + e->accept(); + } + } + } +}
\ No newline at end of file |