Tasklist: Add option to have icon-only buttons, without the labels
Submitted by fr33domlover
Created attachment 285577 patch which adds icon-only mode via wnck_tasklist_set_button_content()
Even on desktop and big laptop screens, having more than a certain easily reached number of windows causes the text labels to be truncated and it's more confusing than useful. The icons themselves, as visual elements, already give most of the needed info about the window, once you get familiar with the app icons (which happens quickly).
In addition, in some apps, and especially in RTL locales and/or when having RTL and LTR language mix in the window title, the labels in the tasklist (which contain the window title) end up being confusing and make the whole tasklist less clear visually.
Icons-only also allow having just a single desktop panel instead of two, and are friendly to small screens, since you can easily have many windows without overloading the tasklist.
XFCE has this option but it nearly reinvents WnckTaskList. Having this here will save the reinvention and allow the feature to easily be added to GNOME, MATE, etc. too (just by adding a panel menu option to switch between icon-and-label and icon-only, and letting libwnck do all the work).
The attached patch is an initial attempt to add this functionality to libwnck. I tested it with ./test-tasklist which I updated to use the new function. However I didn't check how it works when icon-only mode is toggled at runtime yet (this would require a bit more sophisticated test, or running with a modified panel which has the new options added).
Changes which may need attention:
- Icon-only mode uses larger icons (usually 32x32) and not the (usually 16x16) icons used in the regular icon-and-label mode. This is also what XFCE does.
- In test.tasklist.c, the 'icon-size' option now refers to the bigger 32x32 icons used for icon-only mode, while 'mini-icon-size' which is a new option refers to the 16x16 icons used with labels as before. Of couse the exact sizes can be customized as before.
- I added just a setter function for the icon-only mode, without a getter, to be consistent with the existing WnckTasklist API. If needed, a getter can be added easily.
- Rather than using a gboolean, the mode is set using an enum so that new options (such as label-only or any other creative/random idea) could be more easily added in the future. It also seems right because "icon and label" and "icon only" don't sound like universal opposites :-)
Patch 285577, "patch which adds icon-only mode via wnck_tasklist_set_button_content()":