GNOME Bugzilla – Bug 421813
GtkFilechooser size unusable
Last modified: 2009-01-14 20:39:28 UTC
Using the filechooser is currently suboptimal. The place where to choose files is way to small. ~30% of the space of the dialog show the files (compared to the kde filechooser where it is about 70%). The stuff above and below the choosing area is to much and to big. Same goes for places. Other information:
Created attachment 85168 [details] FileChooser of gEdit A screenshot of the GtkFilechooser of gEdit
Created attachment 85170 [details] Screenshot of kwrite Screenshot of the filechooser of kwrite
Fixed in trunk (see commits 22116, 22117, 22118, 22119): 2009-01-14 Federico Mena Quintero <federico@novell.com> Remember the file chooser's geometry across invocations. * gtk/gtkfilechoosersettings.h (struct _GtkFileChooserSettings): New fields geometry_x, geometry_y, geometry_width, geometry_height. (_gtk_file_chooser_settings_get_geometry): New prototype. (_gtk_file_chooser_settings_set_geometry): New prototype. * gtk/gtkfilechoosersettings.c (GEOMETRY_X_KEY, GEOMETRY_Y_KEY, GEOMETRY_WIDTH_KEY, GEOMETRY_HEIGTH_KEY): New key names. (ensure_settings_read): Read the geometry keys. (_gtk_file_chooser_settings_save): Save the geometry keys. (_gtk_file_chooser_settings_init): Initialize the geometry keys to "don't have this value". (_gtk_file_chooser_settings_get_geometry): New public function. (_gtk_file_chooser_settings_set_geometry): New public function. * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_map): Don't change the default size in ::map() so we don't flicker... (gtk_file_chooser_default_realize): ... so do it in ::realize() instead, when the window is not yet visible. This avoids a dialog-that-resizes when you first pop up the file chooser. (emit_default_size_changed): Just emit the signal; don't check for the widget's state so we can be emitted during the initial ::realize() when we are not mapped yet. (update_preview_widget_visibility): Only emit default_size_changed if the widget is not mapped, to avoid resizing the dialog while it is visible. * gtk/gtkfilechooserdialog.c (file_chooser_widget_default_size_changed): Simply resize the dialog to the default size without any fancy clamping. Also, leave in place ifdef-ed out code to restore the file chooser's position in addition to its size. The code to restore the position doesn't quite work yet, but we'll leave it in as a reference. * gtk/gtkfilechooserdefault.c (save_dialog_geometry): New function. (settings_save): Save the dialog's geometry. (gtk_file_chooser_default_get_default_size): Load the geometry from the settings. If it was already saved, return that instead of computing an ad-hoc size.