After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736195 - Tasklist: Add option to have icon-only buttons, without the labels
Tasklist: Add option to have icon-only buttons, without the labels
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: tasklist
unspecified
Other All
: Normal enhancement
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-06 15:44 UTC by fr33domlover
Modified: 2018-01-24 13:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch which adds icon-only mode via wnck_tasklist_set_button_content() (20.89 KB, patch)
2014-09-06 15:44 UTC, fr33domlover
needs-work Details | Review
screenshots from test-tasklist (129.08 KB, application/x-gzip)
2014-09-07 23:14 UTC, fr33domlover
  Details
patch with FULL and getter (21.34 KB, patch)
2014-09-07 23:22 UTC, fr33domlover
none Details | Review
patch with FULL and getter (21.36 KB, patch)
2014-09-07 23:33 UTC, fr33domlover
none Details | Review
patch (22.82 KB, patch)
2014-09-08 18:00 UTC, fr33domlover
none Details | Review
Tasklist: Add option to have just icons inside buttons, without labels (23.10 KB, patch)
2014-10-22 22:06 UTC, Marco Trevisan (Treviño)
none Details | Review
Tasklist: Add option to have just icons inside buttons, without labels (23.22 KB, patch)
2014-11-03 02:09 UTC, fr33domlover
none Details | Review

Description fr33domlover 2014-09-06 15:44:34 UTC
Created attachment 285577 [details] [review]
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 :-)
Comment 1 Marco Trevisan (Treviño) 2014-09-07 17:13:34 UTC
Review of attachment 285577 [details] [review]:

From a first look, it mostly looks fine, but I've two comments:
 1. You should also add a getter for the button content type
 2. Running ./test-tasklist -c here leads to a tasklist with emtpy buttons.

Instead, if move to the full version at runtime (using a timeout or an event, for example), it works fine (although in that case there's too much horizontal padding).
Do you get the same?

::: libwnck/tasklist.h
@@ +97,3 @@
+typedef enum {
+  WNCK_TASKLIST_ICON_ONLY,
+  WNCK_TASKLIST_ICON_AND_LABEL,

What about calling it FULL instead of ICON_AND_LABEL?

@@ +121,3 @@
                                     GtkOrientation orient);
+void wnck_tasklist_set_button_content (WnckTasklist *tasklist,
+                                       WnckTasklistButtonContent content);

Having a wnck_tasklist_get_button_content would be nice as well.
Comment 2 fr33domlover 2014-09-07 23:14:20 UTC
Created attachment 285625 [details]
screenshots from test-tasklist
Comment 3 fr33domlover 2014-09-07 23:19:27 UTC
Hmmm wonderful, my comment text got deleted after uploading the screenshots :-D

I'm testing with GTK 3.4 and Glib 2.32. Icons are present. How do I switch mode at runtime?

Problems I see:

- icon-only buttons can be forced to always be squares, it looks strange to let them be rectangles
- "-c -v" doesn't cause the window to have a single column as it probably should

I think I did take care of padding (maybe I missed a spot) but I didn't touch the gtk box packing, I'll try to change it too.
Comment 4 fr33domlover 2014-09-07 23:22:56 UTC
Created attachment 285627 [details] [review]
patch with FULL and getter

One more thing, maybe the icons should be centered in icon-only mode. Do you see the same results I see?
Comment 5 fr33domlover 2014-09-07 23:33:04 UTC
Created attachment 285628 [details] [review]
patch with FULL and getter
Comment 6 fr33domlover 2014-09-07 23:36:39 UTC
Another idea I see in XFCE... make the icons always squares but instead of centering them, let them scale to fill the available space according to panel height (or width, in vertical mode).
Comment 7 Marco Trevisan (Treviño) 2014-09-08 07:26:04 UTC
(In reply to comment #6)
> Another idea I see in XFCE... make the icons always squares but instead of
> centering them, let them scale to fill the available space according to panel
> height (or width, in vertical mode).

Agree. You can add this as another mode, if you want to keep the current way as well.
Comment 8 fr33domlover 2014-09-08 18:00:27 UTC
Created attachment 285666 [details] [review]
patch

I added test-tasklist commandline options to set window dimensions. It allows setting the size to cause a single-row tasklist, which otherwise I couldn't get without editing the size in source code. I also changed the gtk_box packing.

It seems that the initial window works, and when things behave strangely, they behave in the same way in FULL mode. Maybe I should try this in a real panel, because in the test-tasklist window the buttons stretch as much as they can (in both modes) and don't have a maximal size like they do in real panels.

I tried testing on my desktop but then I realized it uses libwnck 2 and not 3. But I could try GNOME 3 fallback session in a VM.

Are the results better now?

The minimal padding of the buttons is okay (just enough for the square icons), but I can't test maximal size because in both FULL and ICON_ONLY mode, the buttons in test-tasklist stretch to fill the window. Is there a way to test this other than trying with a real panel (like GNOME fallback)?
Comment 9 fr33domlover 2014-10-16 19:00:09 UTC
Hello, are there any updates? Is the patch good in its current form?

If necessary, I'd like to try it in action with a real panel (e.g. with GNOME fallback or Cinnamon) - but is there a way for me to change the label on/off mode in real time?
Comment 10 Marco Trevisan (Treviño) 2014-10-22 22:04:35 UTC
Hi, sorry for the late reply.

I've tried again this patch (this version doesn't merge anymore to trunk btw, I had to use a slightly different patch that I'm attaching here).

By changing the mode at run-time I meant using something like http://pastebin.ubuntu.com/8632682/

Code looks fine, but for some reason I'm getting empty buttons by launching the test case (they only show when changed by that timeout)...

Have you been running this on gtk3?
Comment 11 Marco Trevisan (Treviño) 2014-10-22 22:06:00 UTC
Created attachment 289176 [details] [review]
Tasklist: Add option to have just icons inside buttons,  without labels
Comment 12 fr33domlover 2014-11-02 22:43:48 UTC
I just tried with a fresh GNOME 3.14 (running in Classic mode, but I hope it doesn't matter).

I do see the icons, but they disappear when I shrink the tasklist window - looks like something changed in the way GTK+ handles allocation, or maybe it's a change in libwnck itself. Previously the window would simply refuse to get too small, but now if it gets very close the minimum allowed, the icons disappear. When enlarging again, they re-appear.

What are you using for the test? I'm using GNOME 3.14 from Debian Testing, with libwnck being the only part built from git. I made a fresh VM so everything has default settings.

I'll try to fix the disappearing icon issue.
Comment 13 fr33domlover 2014-11-03 02:09:52 UTC
Created attachment 289859 [details] [review]
Tasklist: Add option to have just icons inside buttons, without labels

This patch now adds extra width padding to avoid the icon hiding. It adds a fixed amount, and not something more sophisticated - e.g. GTK+ image padding values or something - but it seems to fit best since the other values there are fixed too.

After the technical issues are solved, cosmetic idea: Replace (or add) the default icon image with 32x32 size, otherwise the 16x16 one is scaled x2 in icon-only mode and looks blurry. It probably needs 1-2 lines of code to choose the right image.
Comment 14 Marco Trevisan (Treviño) 2014-11-04 13:33:17 UTC
Same issue here... I still don't see the icons until I don't slightly resize the test-tasklist weindow.

Also, when resizing the window to make it wider (when both in single and multiple column mode), the buttons don't keep the squared aspect ratio (which I guess is expected).
Comment 15 GNOME Infrastructure Team 2018-01-24 13:53:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libwnck/issues/130.