"Show Only Icons" tasks in Panel Task Manager

Mario Palomo mariopal at gmail.com
Mon Apr 13 02:53:54 CEST 2009


Hi,

I use a narrow vertical Panel and the text of the items in the Task
Manager are not very useful to me (only 2 or 3 characters), but I see
a *small* icon and the 2 or 3 characters I don't need. I think is
better to see only a *big* icon for every task, so I have touch a
little the file 'abstracttaskitem.cpp', and if I've configured the
Grouping Strategy to ManualGrouping, I don't show the text: only a big
icon (I've used the option to Grouping Strategy because I use this
option too, and the other KDE4 user in the system don't have this
option and have a horizontal Panel). I am happy with the result.

I think that the developers of the Tasks applet could include a "Show
only icons" option for me and others (some users of the Panel in
horizontal position may want this option too: I've discover in
screenshots that Windows 7 show the tasks only with icons). If you
want to see the modifications made to the code by a non-KDE4 developer
that see the code for the first time, here is :-)

Index: abstracttaskitem.cpp
===================================================================
--- abstracttaskitem.cpp        (revision 951443)
+++ abstracttaskitem.cpp        (working copy)
@@ -493,6 +493,8 @@
         painter->drawPixmap(iconRect(bounds).topLeft(), result);
     }

+if (   m_applet->groupManager().groupingStrategy()
+    != TaskManager::GroupManager::ManualGrouping) { //By Mario
     painter->setPen(QPen(textColor(), 1.0));

     QRect rect = textRect(bounds).toRect();
@@ -527,6 +529,7 @@
             painter->drawText(rect, Qt::AlignCenter,
QString::number(groupItem->memberList().count()));
         }
     }
+}//By Mario
 }

 QTextOption AbstractTaskItem::textOption() const
@@ -766,7 +769,10 @@
     QRectF bounds(b);
     const int right = bounds.right();
     //leave enough space for the text. useful in vertical panel
+if (   m_applet->groupManager().groupingStrategy()
+    != TaskManager::GroupManager::ManualGrouping) { //By Mario
     bounds.setWidth(qMax(bounds.width() / 3,
qMin(minimumSize().height(), bounds.width())));
+}//By Mario

     //restore right position if the layout is RTL
     if (QApplication::layoutDirection() == Qt::RightToLeft) {


I hope you have in mind my suggestion. Greetings,

Mario


More information about the Plasma-devel mailing list