Horizontal scrollbar showing

Bug #592470 reported by Jan
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cardapio
Won't Fix
Low
Unassigned

Bug Description

If item names are too long, a horizontal scrollbar shows. This is quite annoying especially for search results, whose title can get quite long. Entries overflowing just does not look good. It reminds me of CSS bugs and text-overflow:ellipsis. ;)

Deactivating the horizontal scrollbar and instead having the item name be truncated and an ellipsis appended would be much more aesthetic.

summary: - Horizontal scrollbar showiing
+ Horizontal scrollbar showing
Revision history for this message
Thiago Teixeira (tvst) wrote :

The problem here is deciding what is the maximum amount of text that would fit on the button without causing a scrollbar to appear. So long as I don't have to redraw each button several times to find out, I am up for fixing it.

If anyone has any ideas about the best way to fix this, please post here :)

Changed in cardapio:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Thiago Teixeira (tvst) wrote :

Actually let me rephrase the post above, because it turned out pretty ambiguous...

The problem with your proposed solution (i.e. adding ellipses) boils down to deciding what is the maximum amount of text that would fit on a button without causing a scrollbar to appear. I don't want this amount to be hard-coded. So, I am only willing to fix this bug if there is some way to figure out the optimal text length (without having to redraw each button several times to find out, of course). For all I know, GTK does not offer much help here.

If anyone has any ideas about the best way to fix this, please post here :)

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

It does not have to be hard-coded (as far as I think things are possible ;)
The right edge of each button just gets aligned with the right edge of the main window. If any button label is longer than the button itself, the overflowing text is hidden and replaced by an ellipsis. There is no need to decide what is the maximum amount of text because the button width automatically gets adjusted according to window width and if text overflows (cuts + adds ellipsis) or not (everything’s fine).

Plus, that way the buttons do not look weirdly cut off like now. :)

Revision history for this message
Thiago Teixeira (tvst) wrote :

The problem is that GTK's "ellipsize" method requires as an input parameter the number of characters at which the ellipsis should take place. I will keep looking for a solution, but right now this bug is low on my priority list. I'm trying to fix bug #593141, for example :)

Revision history for this message
ScayTrase (scaytrase) wrote :

I have a suggestion that when the program descriptions overflow one line they could be optionally displayed as multiline text (optionally).

for example default pidgin menu element in russian locale:

Клиент обмена мгновенными сообщениями Pidgin
->
Клиент обмена мгновенными
сообщениями Pidgin

If you truncate this text you will lose word "pidgin" anyway.

Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

In the minimal-layout branch I have come up with a solution that hits two birds with a stone:
Deactivating the horizontal scrollbar completely (so that overflowing text is simply hidden) and setting the vertical scrollbar to always show.

This also makes the interface less jumpy when searching. Normally the scrollbars disappear and reappear all the time while typing.

And really, how often is the horizontal scrollbar used anyway? The only things that overflow are web search results. I suggest we make the change. You can try it out in the linked branch.

Changed in cardapio:
status: Confirmed → In Progress
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

The patch for trunk.

But there is a problem in that the section view now resizes to the width of its content. Luckily only once, not when searching. I don’t know how to force width, that would be the solution.

Changed in cardapio:
assignee: nobody → Jan-Christoph Borchardt (jancborchardt)
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Oops, this is _almost_ fixed. The only problem is that the menu width now depends on the width of the longest item, i. e. you can not resize it to be smaller than that. This could be a problem especially with long translations.

Fix: Be able to resize Cardapio anyway, something like overflow:hidden in CSS ;)
Real fix: Be able to resize Cardapio and have the items be dynamically ellipsized, text-overflow:ellipsis ;)

I thought the not-real fix would be easy but I can’t seem to find anything.

Changed in cardapio:
status: In Progress → Fix Released
status: Fix Released → In Progress
Revision history for this message
Thiago Teixeira (tvst) wrote :

Yep, I remember going through similar steps before and finding that there is no "good" solution.

The main problem is that Gtk doesn't seem to have a way to say "ellipsize if necessary, and *never* show a horizontal scrollbar". Instead, if you want to ellipsize you need to specify the number of characters before the ellipsis -- which, of course, varies depending on font family, font size, and parent widget size. Argh.

Changed in cardapio:
assignee: Jan-Christoph Borchardt (jancborchardt) → nobody
Thiago Teixeira (tvst)
Changed in cardapio:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.