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 129020 - The default size of GtkFileChooser(Dialog) seems to be not correct.
The default size of GtkFileChooser(Dialog) seems to be not correct.
Status: RESOLVED INVALID
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.3.x
Other All
: Normal normal
: ---
Assigned To: Soren Sandmann Pedersen
Soren Sandmann Pedersen
AP3
: 132479 132669 (view as bug list)
Depends on:
Blocks: 128692 133624
 
 
Reported: 2003-12-10 19:24 UTC by Jan Arne Petersen
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch should fix the hpaned parameter (horizontal size). (1.73 KB, patch)
2003-12-10 19:32 UTC, Jan Arne Petersen
committed Details | Review
This patch uses gtk_widget_set_size_request calls to set the minimum height of the lists to 180 pixels. (4.24 KB, patch)
2003-12-11 20:13 UTC, Jan Arne Petersen
none Details | Review
Additional patch... (945 bytes, patch)
2004-02-26 17:04 UTC, Morten Welinder
none Details | Review
patch (5.01 KB, patch)
2004-03-09 18:34 UTC, Soren Sandmann Pedersen
none Details | Review

Description Jan Arne Petersen 2003-12-10 19:24:40 UTC
The default size of the dialog seems to be too small.
The "Delete Bookmark" button is hidden behind the hpaned gutter (at last on
my desktop) by default. It is possible to shrink the bookmark or file list
completly. Less than 1 row is shown in the file list by default (without a
gtk_window_set_default_size call).
Comment 1 Jan Arne Petersen 2003-12-10 19:32:21 UTC
Created attachment 22300 [details] [review]
This patch should fix the hpaned parameter (horizontal size).
Comment 2 Jan Arne Petersen 2003-12-11 20:13:14 UTC
Created attachment 22350 [details] [review]
This patch uses gtk_widget_set_size_request calls to set the minimum height of the lists to 180 pixels.
Comment 3 Jan Arne Petersen 2003-12-11 20:28:42 UTC
The minimum and default size with the second patch is now similar to
the size of GtkFileSelection. I think that should be an acceptable
solution as long as there is no better way to solve it.
If required we could add a gtk_window_set_default_size call in
GtkFileChooserDialog to make the default size a bit larger than the
minimum size.
Comment 4 bill.haneman 2003-12-11 20:39:10 UTC
hmm, seems still sort of hard-wired to me.
Can we base the minimum size (reliably) on the current font size,
etc., in accordance with the theme?  So that even if a large-size
theme (thick focus lines, etc.) is chosen, with a large font, the list
has some minimum number of lines visible (say, three? )?  Just
wondering how this will play with both small screens and really big
fonts and focus lines (i.e. low-vision themes).
Comment 5 Jan Arne Petersen 2003-12-11 21:29:16 UTC
It is possible to let the size request depend on the font size:

  test_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
                                "text", "TEST LINE",
                                NULL);
  gtk_cell_renderer_get_size (test_renderer, impl->list, NULL,
                              NULL, NULL, NULL, &test_height);
  g_object_unref (test_renderer);
  gtk_widget_set_size_request (impl->list, -1, test_height * 5);

This seems to be a good approximation (although a font size > 40 shows
only 4.75 lines) but I don't know if such a hack is really a good
solution.
Comment 6 Matthias Clasen 2003-12-13 00:05:46 UTC
A "proper" solution would depend on bug 101859, so we will probably
have to get by with the hack for a few years.
Comment 7 Federico Mena Quintero 2004-01-06 04:15:54 UTC
I applied the pack1/pack2 patch (22300).  Thanks, Jan Arne.
Comment 8 Federico Mena Quintero 2004-01-27 19:32:08 UTC
See bug #129318 for a proposed "visible-rows" API for GtkTreeView.
Comment 9 Federico Mena Quintero 2004-01-29 18:43:33 UTC
*** Bug 132669 has been marked as a duplicate of this bug. ***
Comment 10 Morten Welinder 2004-01-29 18:50:47 UTC
>  test_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
>                                "text", "TEST LINE",
>                                NULL);

Code that does this is not going to work very well in a multiscreen
setup.  Unless you install it also in the screen-change signal handler.
Basically you don't know what screen to do the sizing on at this stage.
Comment 11 Federico Mena Quintero 2004-02-14 01:24:03 UTC
Fixed on CVS.

2004-02-13  Federico Mena Quintero  <federico@ximian.com>

	Fix #129020.

	* gtk/gtkfilechooserdialog.c
	(set_default_size): New function, sets a reasonable default size
	for the window.
	(gtk_file_chooser_dialog_realize): New function, call
	set_default_size().
	(gtk_file_chooser_dialog_style_set): Likewise.
	(gtk_file_chooser_dialog_screen_changed): Likewise.

	* tests/testfilechooser.c (main): Don't set a default size for the
	dialog.
Comment 12 Martin Kretzschmar 2004-02-14 11:51:53 UTC
*** Bug 132479 has been marked as a duplicate of this bug. ***
Comment 13 Morten Welinder 2004-02-26 17:04:41 UTC
Created attachment 24815 [details] [review]
Additional patch...
Comment 14 Morten Welinder 2004-02-26 17:07:03 UTC
The current implementation essentially ignores the size the widget wants
to have, ie., MAX prevails.  That's wrong.  For example, add a 100 pixel
wide preview and the default size does not change.

With my extra patch (which assumes the panes to be empty when called
-- is that right?) will _add_ the width of a smaller number of characters.
Comment 15 Morten Welinder 2004-02-26 17:44:17 UTC
Lowering priority to normal since the current size isn't absurd.
Comment 16 Luis Villa 2004-03-01 22:08:25 UTC
Removing the TARGET keyword too; it's no longer a showstopper, though
I suppose fixing the problem Morten has described would be nice.
Comment 17 Soren Sandmann Pedersen 2004-03-09 18:18:48 UTC
What about simply realizing the dialog before setting the size? Ie.,
something like the patch I'll attach.
Comment 18 Soren Sandmann Pedersen 2004-03-09 18:34:42 UTC
Created attachment 25397 [details] [review]
patch
Comment 19 Jonathan Blandford 2004-03-10 19:02:04 UTC
The clamp-to-screen part of the patch is good.  I was going to write
something similar but never got the time.  I don't think that doing
the realize in set_default_size is correct, as that gets called a lot
(like from size_request).
Comment 20 Soren Sandmann Pedersen 2004-03-12 22:41:49 UTC
I have committed the "clamp to screen" part of the patch, but that
isn't a full fix, because the dialog still comes up way too big on my
screen.


Fri Mar 12 23:37:15 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkfilechooserdialog.c
	(file_chooser_widget_default_realized_size_changed): Clamp the
	new size to the screen.

Comment 21 bill.haneman 2004-03-13 12:15:42 UTC
how does the new patch behave with large fonts + small screens?
I would think 800x600 with 16 point fonts or 1024x768 with 18 point
fonts would be a good worst-case target.  
Comment 22 Jonathan Blandford 2004-04-14 19:27:15 UTC
So, I'm losing track of what this bug is about.  I'd really like to close this
and reopen bugs with individual issues.  Søren, what is the issue with clamping
it to the screen?
Comment 23 Elijah Newren 2004-06-19 18:45:00 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 24 Federico Mena Quintero 2004-06-22 20:42:16 UTC
Yeah, let's close this down and open individual issues; it's too confusing.