From 3df12cd87674fdfbc2afa21584e1f3e558fa873b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 13 Apr 2013 15:00:04 -0500 Subject: Add menu items to rearrange taskbar entries Make taskbar drag and drop moving more robust This resolves Bug 1103 --- kicker/taskmanager/taskrmbmenu.cpp | 11 ++++++++++- kicker/taskmanager/taskrmbmenu.h | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'kicker/taskmanager') diff --git a/kicker/taskmanager/taskrmbmenu.cpp b/kicker/taskmanager/taskrmbmenu.cpp index c910c5f9d..f92719f47 100644 --- a/kicker/taskmanager/taskrmbmenu.cpp +++ b/kicker/taskmanager/taskrmbmenu.cpp @@ -38,10 +38,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "taskrmbmenu.h" #include "taskrmbmenu.moc" -TaskRMBMenu::TaskRMBMenu(const Task::List& theTasks, bool show, TQWidget *parent, const char *name) +TaskRMBMenu::TaskRMBMenu(const Task::List& theTasks, bool show, TQPopupMenu* moveMenu, TQWidget *parent, const char *name) : TQPopupMenu( parent, name ) , tasks( theTasks ) , showAll( show ) + , taskMoveMenu( moveMenu ) { assert(tasks.count() > 0); if (tasks.count() == 1) @@ -57,6 +58,7 @@ TaskRMBMenu::TaskRMBMenu(const Task::List& theTasks, bool show, TQWidget *parent TaskRMBMenu::TaskRMBMenu(Task::Ptr task, bool show, TQWidget *parent, const char *name) : TQPopupMenu( parent, name ) , showAll( show ) + , taskMoveMenu( NULL ) { fillMenu(task); } @@ -106,6 +108,13 @@ void TaskRMBMenu::fillMenu(Task::Ptr t) insertSeparator(); + if (taskMoveMenu) { + taskMoveMenu->reparent(this, taskMoveMenu->getWFlags(), taskMoveMenu->geometry().topLeft(), FALSE); + insertItem(i18n("Move Task Button"), taskMoveMenu); + + insertSeparator(); + } + id = insertItem(SmallIcon("fileclose"), i18n("&Close"), t, TQT_SLOT(close())); setItemEnabled(id, !checkActions || t->info().actionSupported(NET::ActionClose)); } diff --git a/kicker/taskmanager/taskrmbmenu.h b/kicker/taskmanager/taskrmbmenu.h index d95230f9b..76b209ca7 100644 --- a/kicker/taskmanager/taskrmbmenu.h +++ b/kicker/taskmanager/taskrmbmenu.h @@ -32,7 +32,7 @@ class KDE_EXPORT TaskRMBMenu : public TQPopupMenu Q_OBJECT public: - TaskRMBMenu(const Task::List&, bool showAll = true, TQWidget *parent = 0, const char *name = 0); + TaskRMBMenu(const Task::List&, bool showAll = true, TQPopupMenu* moveMenu = NULL, TQWidget *parent = 0, const char *name = 0); TaskRMBMenu(Task::Ptr, bool showAll = true, TQWidget *parent = 0, const char *name = 0); private: @@ -54,6 +54,7 @@ private slots: private: Task::List tasks; bool showAll; + TQPopupMenu* taskMoveMenu; }; #endif -- cgit v1.2.1