From 7b7f96164495137d79b57f16257e915f64cc68b5 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Tue, 11 Oct 2022 20:11:09 +0300 Subject: Add "Move Task Button" action to group tasks This resolves issue TDE/tde#98. Also contains some identation fixes. Signed-off-by: Mavridis Philippe --- kicker/taskmanager/taskrmbmenu.cpp | 77 +++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 35 deletions(-) (limited to 'kicker') diff --git a/kicker/taskmanager/taskrmbmenu.cpp b/kicker/taskmanager/taskrmbmenu.cpp index 55db3a6b7..cdc6e4532 100644 --- a/kicker/taskmanager/taskrmbmenu.cpp +++ b/kicker/taskmanager/taskrmbmenu.cpp @@ -121,22 +121,22 @@ void TaskRMBMenu::fillMenu(Task::Ptr t) void TaskRMBMenu::fillMenu() { - int id; - setCheckable( true ); + int id; + setCheckable( true ); Task::List::iterator itEnd = tasks.end(); for (Task::List::iterator it = tasks.begin(); it != itEnd; ++it) { - Task::Ptr t = (*it); + Task::Ptr t = (*it); - id = insertItem( TQIconSet( t->pixmap() ), - t->visibleNameWithState(), - new TaskRMBMenu(t, this) ); - setItemChecked( id, t->isActive() ); - connectItem( id, t, TQT_SLOT( activateRaiseOrIconify() ) ); - } + id = insertItem( TQIconSet( t->pixmap() ), + t->visibleNameWithState(), + new TaskRMBMenu(t, this) ); + setItemChecked( id, t->isActive() ); + connectItem( id, t, TQT_SLOT( activateRaiseOrIconify() ) ); + } - insertSeparator(); + insertSeparator(); bool enable = false; @@ -159,48 +159,55 @@ void TaskRMBMenu::fillMenu() enable = false; - id = insertItem( i18n( "Mi&nimize All" ), this, TQT_SLOT( slotMinimizeAll() ) ); + id = insertItem( i18n( "Mi&nimize All" ), this, TQT_SLOT( slotMinimizeAll() ) ); itEnd = tasks.end(); for (Task::List::iterator it = tasks.begin(); it != itEnd; ++it) { - if( !(*it)->isIconified() ) { - enable = true; - break; - } - } - setItemEnabled( id, enable ); + if( !(*it)->isIconified() ) { + enable = true; + break; + } + } + setItemEnabled( id, enable ); - enable = false; + enable = false; - id = insertItem( i18n( "Ma&ximize All" ), this, TQT_SLOT( slotMaximizeAll() ) ); + id = insertItem( i18n( "Ma&ximize All" ), this, TQT_SLOT( slotMaximizeAll() ) ); itEnd = tasks.end(); for (Task::List::iterator it = tasks.begin(); it != itEnd; ++it) { if( !(*it)->isMaximized() ) { - enable = true; - break; - } - } - setItemEnabled( id, enable ); + enable = true; + break; + } + } + setItemEnabled( id, enable ); - enable = false; + enable = false; - id = insertItem( i18n( "&Restore All" ), this, TQT_SLOT( slotRestoreAll() ) ); + id = insertItem( i18n( "&Restore All" ), this, TQT_SLOT( slotRestoreAll() ) ); itEnd = tasks.end(); for (Task::List::iterator it = tasks.begin(); it != itEnd; ++it) { - if( (*it)->isIconified() || (*it)->isMaximized() ) { - enable = true; - break; - } - } - setItemEnabled( id, enable ); + if( (*it)->isIconified() || (*it)->isMaximized() ) { + enable = true; + break; + } + } + setItemEnabled( id, enable ); + + insertSeparator(); + + enable = false; - insertSeparator(); + if (taskMoveMenu) { + taskMoveMenu->reparent(this, taskMoveMenu->getWFlags(), taskMoveMenu->geometry().topLeft(), FALSE); + insertItem(i18n("Move Task Button"), taskMoveMenu); - enable = false; + insertSeparator(); + } - insertItem( SmallIcon( "window-close" ), i18n( "&Close All" ), this, TQT_SLOT( slotCloseAll() ) ); + insertItem( SmallIcon( "window-close" ), i18n( "&Close All" ), this, TQT_SLOT( slotCloseAll() ) ); } TQPopupMenu* TaskRMBMenu::makeAdvancedMenu(Task::Ptr t) -- cgit v1.2.1