! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Would like to see an option to display the applications in a grid layout
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-whiskermenu-plugin
Component:
General

Comments

Description huntantr 2019-07-03 14:49:06 CEST
Currently on the menu, the applications are shown in a list layout, would like to see an option to change this to a gird layout instead. With an option to specify the number of columns.
Comment 1 Git Bot editbugs 2019-12-31 11:39:56 CET
Graeme Gott referenced this bugreport in commit 0b767f6391b7d5ad59c79aff19ba66d34c0de44a

Add option to show as icons. (bug #15675)

https://git.xfce.org/panel-plugins/xfce4-whiskermenu-plugin/commit?id=0b767f6391b7d5ad59c79aff19ba66d34c0de44a
Comment 2 Graeme Gott editbugs 2019-12-31 11:43:06 CET
I could not make the columns stretchy (without messy and hackish code that was too brittle for my tastes), so you can't choose the number of columns. But other than that, you can now show the launchers as a grid of icons.
Comment 3 huntantr 2020-01-24 18:10:58 CET
That's great thanks. Can't wait to try it out. I'm assuming this will be in v2.3.5, when will that be available, and how can I get it?
Comment 4 Graeme Gott editbugs 2020-01-24 19:46:27 CET
This will be in the next feature release (v2.3.5 was just a bugfix release and is already available), which won't be done for a few weeks yet. How you get it depends upon what distro you are using (I have a PPA for Ubuntu, and packages from OBS), or you can compile it from source.
Comment 5 huntantr 2020-01-24 19:53:30 CET
I'm running Linux Mint XFCE. I don't mind installing a PPA to get the version that has this feature to test it out.
Comment 6 huntantr 2020-01-24 20:01:24 CET
Just to be clear it is 19.3 of linux mint.
Comment 7 Graeme Gott editbugs 2020-01-24 20:17:20 CET
The version with this feature isn't finished yet. When it is released, you can get it from my PPA: https://launchpad.net/~gottcode/+archive/ubuntu/gcppa
Comment 8 Landry Breuil editbugs 2020-02-11 15:51:13 CET
Fwiw, this seems to be the new default when updating from 2.3.5 to 2.4.0 which might confuse users - and on top of that, display of labels is broken because of issues with recent pango 1.44 that also affected thunar (cf https://bugzilla.xfce.org/show_bug.cgi?id=16310 and https://bugzilla.xfce.org/show_bug.cgi?id=15856 for the thunar issue/fix) - the end result is https://yoona.everdot.org/linux/xfce4/whiskermenu-git-2020-02-10.jpg which is 'unfortunate'.

should i file a new issue with this ? a probable fix is to apply a variation of https://git.xfce.org/xfce/thunar/commit?id=3eb6e78cf4aeacdebaa425af00556db4d73f6bcb to whiskermenu..
Comment 9 Landry Breuil editbugs 2020-02-11 16:13:17 CET
https://github.com/linuxmint/nemo/pull/2261/files has a similar fix for nemo - there's not much pango specific code in whiskermenu sadly, so some boilerplate looks necessary to disable hyphens via g_object_set() in the ctor in launcher-icon-view.cpp
Comment 10 Graeme Gott editbugs 2020-02-11 16:49:25 CET
Created attachment 9441 
Fix hyphenated words with Pango 1.44

Yikes. I don't have that with my pango 1.44 install, so I can't be sure I've fixed it. Does this patch work for those affected?
Comment 11 huntantr 2020-02-11 16:50:53 CET
Looks good on my machine. I don't see the same problem as Landry. I'm running Linux Mint 19.3.
Comment 12 Landry Breuil editbugs 2020-02-11 17:34:50 CET
Still a bit awkward with that patch, which gives https://imgur.com/u1Cw3s7.png here.
Comment 13 Landry Breuil editbugs 2020-02-11 17:36:16 CET
the strange thing is that i thought trying larger icons would help, but the size of the 'square' for the icon+label stays the same so text ends up hyphenated anyway, whatever the icon size..
Comment 14 Landry Breuil editbugs 2020-02-11 17:42:47 CET
not sure but on the other occurences (ie thunar for example), the attributes were set on the global view, not cell by cell.. trying
```
+#if PANGO_VERSION_CHECK(1,44,0)
+       PangoAttrList* attrs = pango_attr_list_new();
+       pango_attr_list_insert(attrs, pango_attr_insert_hyphens_new(false));
+
+       g_object_set(m_icon_renderer, "attributes", attrs, nullptr);
+       pango_attr_list_unref(attrs);
+#endif
```

but that didnt help either.
Comment 15 Graeme Gott editbugs 2020-02-11 17:48:48 CET
What's really strange is this shouldn't be possible. In git commit 98a6cf3bc74f5c8722f5338c7272d6e8fc74ce3b I made my custom icon renderer set a minimum width quite a bit bigger than the actual icon size. You are definitely using 2.4.0 and not a previous git version, correct?

Maybe try this:
```
+#if PANGO_VERSION_CHECK(1,44,0)
+       PangoAttrList* attrs = pango_attr_list_new();
+       pango_attr_list_insert(attrs, pango_attr_insert_hyphens_new(false));
+
+       g_object_set(cell_layout, "attributes", attrs, nullptr);
+       pango_attr_list_unref(attrs);
+#endif
```
Comment 16 Graeme Gott editbugs 2020-02-11 18:07:00 CET
Hm, setting the attrs directly on the cell_layout spams the debug console with the fact that GtkIconView has no property named "attributes". Which makes sense, since that is a GtkCellRendererText property to set Pango attributes.
Comment 17 Graeme Gott editbugs 2020-02-12 00:17:56 CET
Created attachment 9444 
Set icon renderer stretch property in constructor

Looking at the code, the only way it could be finding the smaller minimum width is if it somehow isn't setting the "stretch" property correctly. Does setting the property in this manner fix the bug?
Comment 18 Graeme Gott editbugs 2020-02-12 10:42:31 CET
Created attachment 9446 
Always set natural width

It seems more likely that the issue is the cell not having the proper natural width.
Comment 19 Öyvind Saether 2020-02-12 12:59:01 CET
Created attachment 9447 
xfce4-whiskermenu-plugin git + attachment 9446 

> Created attachment 9446 
> Always set natural width

Looks perfect with this patch.

I have the pango-1.44.7. On my system The icon view is all 
me-
ss-
ed-
up
in current git master - the patch in attachment 9446  makes the icon view look perfect.
Comment 20 Graeme Gott editbugs 2020-02-12 13:12:07 CET
Good to know!

In your screenshot there are still some hyphenated words. What happens if you also use the pango patch?
Comment 21 Öyvind Saether 2020-02-12 13:40:00 CET
Created attachment 9448 
attachment 9441  has no effect

attachment 9441  does not appear to have any effect, not that I can see,  anyway. So I guess it's not perfect, 

Angry
Drunke-
n
Dwarve-

and

Aura
Kingdo-
m

stand out as particularly ridiculous (if there's room for  Kingdo- then there's surely room for Kingdom and no need to add a -).

Perhaps I used the wrong patch, but I don't see any other patch mentioning  Pango than attachment 9441  ?
Comment 22 Öyvind Saether 2020-02-12 13:43:11 CET
Created attachment 9449 
git master with no patches for reference

Just a screenshot of git master without any of the patches for reference.  attachment 9446  is clearly a huge improvement even if the hyphen issue isn't resolved
Comment 23 Graeme Gott editbugs 2020-02-12 14:54:32 CET
Created attachment 9450 
Add more padding to icon columns

Does increasing the icon column width help with the hyphenation?
Comment 24 Landry Breuil editbugs 2020-02-12 15:11:26 CET
looks great here with attachments 9450 & 9446, no hyphenation here.
```
        if (icon_renderer->stretch)
        {
-               width += 76 - (icon_renderer->size / 2);
+               width += 76 - (icon_renderer->size / 4);
+               if (natural)
+               {
+                       *natural = (width * 2) - 1;
+               }
        }
```

on a sidenote i fail to see what 'display as tree' does, seems to be the same as 'display as list' here but maybe that's because my menu is default/doesnt have subcategories/folders.
Comment 25 Öyvind Saether 2020-02-12 16:22:59 CET
Created attachment 9451 
Increasing the icon column width DOES help with the hyphenation

There is still hyphenation but there's less of it with wider columns. It doesn't solve it completely BUT I do believe it is as good as it gets with attachment 9450  because .. any wider would probably be too wide columns (which would not be good?)

as for Landry Breuil's question
> on a sidenote i fail to see what 'display as tree' does, seems to be the
> same as 'display as list' here but maybe that's because my menu is
> default/doesnt have subcategories/folders.

You can see what the tree view does in this image:

https://linuxreviews.org/images/thumb/3/3e/Xfce4-whiskermenu-2.4.0-tree-view.jpg/960px-Xfce4-whiskermenu-2.4.0-tree-view.jpg

There is a patch which adds some sub categories to garcon at 
https://bugzilla.xfce.org/show_bug.cgi?id=16432

Tree view will obviously do nothing if you don't have any sub-categories. Having them makes the menu a bit more organized but it doesn't solve all that much. Steam, for example, has every single game install a desktop file with "Categories=Game" while most native Linux packages have "Categories=Game;ArcadeGame;" or "Categories=Game;StrategyGame;" or something like that which makes it possible to put them in sub-folders.
Comment 26 Graeme Gott editbugs 2020-02-12 18:24:23 CET
I have merged those patches (attachments 9446 & 9450) into git and will soon be making a bugfix release that contains them. Thanks for testing!
Comment 27 Landry Breuil editbugs 2020-02-13 09:47:46 CET
Thanks, can confirm 2.4.1 is fine here, updated the package in the OpenBSD ports tree :)

Bug #15675

Reported by:
huntantr
Reported on: 2019-07-03
Last modified on: 2020-02-13

People

Assignee:
Graeme Gott
CC List:
2 users

Version

Attachments

Fix hyphenated words with Pango 1.44 (1.60 KB, patch)
2020-02-11 16:49 CET , Graeme Gott
no flags
Set icon renderer stretch property in constructor (2.15 KB, patch)
2020-02-12 00:17 CET , Graeme Gott
no flags
Always set natural width (731 bytes, patch)
2020-02-12 10:42 CET , Graeme Gott
no flags
xfce4-whiskermenu-plugin git + attachment 9446 (273.46 KB, image/jpeg)
2020-02-12 12:59 CET , Öyvind Saether
no flags
attachment 9441 has no effect (972.17 KB, image/jpeg)
2020-02-12 13:40 CET , Öyvind Saether
no flags
git master with no patches for reference (377.51 KB, image/jpeg)
2020-02-12 13:43 CET , Öyvind Saether
no flags
Add more padding to icon columns (763 bytes, patch)
2020-02-12 14:54 CET , Graeme Gott
no flags
Increasing the icon column width DOES help with the hyphenation (487.81 KB, image/jpeg)
2020-02-12 16:22 CET , Öyvind Saether
no flags

Additional information