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 527499 - FileFilter combo becames too wide
FileFilter combo becames too wide
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.12.x
Other All
: Normal trivial
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
: 531654 534329 549470 567782 574482 580208 603768 (view as bug list)
Depends on: 101968
Blocks:
 
 
Reported: 2008-04-11 09:17 UTC by Dubon
Modified: 2010-08-19 23:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Dialog screenshot (13.10 KB, image/png)
2008-04-11 09:20 UTC, Dubon
  Details
a pygtk example demonstrating the bug (467 bytes, text/x-python)
2008-05-22 10:55 UTC, Danielle Madeley
  Details
Use an ellipsized cell renderer for the filter combo box. (2.28 KB, patch)
2008-05-22 12:28 UTC, Jan Arne Petersen
none Details | Review
a dodgy patch that pokes around in size-request (2.70 KB, patch)
2008-05-22 14:16 UTC, Danielle Madeley
needs-work Details | Review

Description Dubon 2008-04-11 09:17:31 UTC
Please describe the problem:
When there are a lot of file extension in filter, the width of the combo can make the dialog bigger than the screen. Besides, this dialog can not be resized.

Steps to reproduce:
1. Open a FileChooserDialog in a context with a long filter. For example, uploading images to flickr (http://flickr.com/photos/upload/).


Actual results:
The FileChooserDialog gets bigger than screen.

Expected results:
The file filter appears partially. For example, ending with dots (...)

Does this happen every time?
Yes

Other information:
Comment 1 Dubon 2008-04-11 09:20:22 UTC
Created attachment 109045 [details]
Dialog screenshot
Comment 2 Danielle Madeley 2008-05-22 10:55:31 UTC
Created attachment 111330 [details]
a pygtk example demonstrating the bug

This can be easily demonstrated using a simple PyGTK+ program.
Comment 3 Jan Arne Petersen 2008-05-22 11:24:40 UTC
*** Bug 534329 has been marked as a duplicate of this bug. ***
Comment 4 Danielle Madeley 2008-05-22 11:25:31 UTC
I see two possible solutions to this problem:

 1. change gtkfilechooserdefault.c to use a full model and cell renderers and set text ellipsizing on the GtkComboBox

 2. add a property to GtkComboBox to ellipsize text when in text mode.

1. is probably easiest, because it can be pushed out in a point-release of GTK+.
Comment 5 Jan Arne Petersen 2008-05-22 12:28:42 UTC
Created attachment 111336 [details] [review]
Use an ellipsized cell renderer for the filter combo box.
Comment 6 Danielle Madeley 2008-05-22 12:56:25 UTC
I just wrote a patch more or less exactly like this, but I don't think it's correct since filters that are a sensible length will now appear in a really big combo box, rather than one that is a useful size.

In effect the combo box needs to be set to not expand, but have a size clamp beyond which point it will ellipsize.
Comment 7 Jan Arne Petersen 2008-05-22 13:33:29 UTC
> In effect the combo box needs to be set to not expand, but have a size clamp
> beyond which point it will ellipsize.

That is already solved by extended layout (bug 101968).
Comment 8 Danielle Madeley 2008-05-22 14:12:17 UTC
I've not yet looked at how to use extended layout yet, is there any documentation on it?
Comment 9 Danielle Madeley 2008-05-22 14:16:03 UTC
Created attachment 111339 [details] [review]
a dodgy patch that pokes around in size-request

Ok, this is a dodgy patch that is very similar to 111336, but it doesn't set the combo to expand. It currently uses ::size-request to clamp the requisition width to 400px and set ellipsizing.
Comment 10 Jan Arne Petersen 2008-05-22 15:12:44 UTC
Extended layout is not commited to SVN trunk yet ...
Comment 11 Danielle Madeley 2008-05-22 15:21:39 UTC
I am aware of this, but any solution that lands now should be mindful of a superior solution in the future.
Comment 12 Arthit Suriyawongkul 2008-05-22 17:50:16 UTC
When filter text has been ellipsized,
do it possible to has the full text in tool tip balloon ?
So user can know what the full text is.
Comment 13 Yevgen Muntyan 2008-09-10 05:12:08 UTC
*** Bug 549470 has been marked as a duplicate of this bug. ***
Comment 14 Alberto Ruiz 2008-12-03 15:52:28 UTC
Any updates in this bug?
Comment 15 Federico Mena Quintero 2009-01-14 20:36:04 UTC
*** Bug 531654 has been marked as a duplicate of this bug. ***
Comment 16 Federico Mena Quintero 2009-01-14 21:00:36 UTC
*** Bug 567782 has been marked as a duplicate of this bug. ***
Comment 17 Dubon 2009-01-14 22:42:02 UTC
I saw bug title was changed. I think it is becomes or gets. Sorry.
Comment 18 Matthias Clasen 2009-03-11 16:37:19 UTC
*** Bug 574482 has been marked as a duplicate of this bug. ***
Comment 19 Claudio Saavedra 2009-04-25 12:02:20 UTC
*** Bug 580208 has been marked as a duplicate of this bug. ***
Comment 20 Marcus Carlson 2009-07-17 20:09:45 UTC
Can't we just skip showing the file extension and only show this via tooltips?

A partial fix would be to only have one of the lowercase / uppercase extensions.
Comment 21 Florent V. 2009-09-24 19:36:09 UTC
Couldn't there be a simple fix like trimming the text length to an arbitrary number of characters?

This bug has been bothering me for quite a while. I've tried to report it before, but once spent one hour trying (unsuccessfully at that time) to identify how the relevant GTK widget was named. (I should have searched bugzilla for "flickr", would have been more efficient.)

A partial fix would be better than nothing.
Comment 22 Christian Persch 2009-12-04 08:08:12 UTC
*** Bug 603768 has been marked as a duplicate of this bug. ***
Comment 23 Tristan Van Berkom 2010-04-22 03:51:40 UTC
Note, although significant progress has been made in this 
direction in the native-layout branch; the cell renderer work
particularly still needs attention.

Combo boxes are tied into cell renderers so to make them
behave "naturally" we're going to block on more work on cell
renderers...
Comment 24 Tristan Van Berkom 2010-08-19 23:11:08 UTC
Now we have height-for-width resizing combo boxes (with their underlying cellviews
and renderers and popup menus).

Set the combo box to ellipsize, the combo will be allocated the width of the
largest item in the file-filter list and start to ellipsize once it spans 
the entire file list (the dialog will not grow for the sake of the file
filter combo).
Comment 25 Alberto Ruiz 2010-08-19 23:14:13 UTC
@Tristan:

You are my hero.