GNOME Bugzilla – Bug 165770
file dialog doesn't use 16x16 icons, but scaled 24x24
Last modified: 2007-08-03 21:39:38 UTC
The file dialog scales down 24x24px versions which results in blurry images. There are 16x16px icons in gnome icon theme, it should make use of these. Other information: attached is a comparsion mockup.
Created attachment 36750 [details] Scaled icons vs crisp 16x16px icons
Two things: 1. We used GTK_ICON_SIZE_SMALL_TOOLBAR, which defaults to 18x18 unless themes override those values. I've made the file chooser use GTK_ICON_SIZE_MENU, which defaults to 16x16. 2. There is no GTK_ICON_SIZE_WHATEVER_WOULD_LOOK_GOOD_ON_A_TREEVIEW :) I guess such a beast would depend on the font size or something. The fix described in (1) is now in HEAD and gtk-2-6.
The fix (1) was not applied to gtkfilechooserbutton - take a look at the gnome-search-tool "look in folder" button. The icons are still scaled down. I guess the fix is as simple as Index: gtkfilechooserbutton.c =================================================================== RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserbutton.c,v retrieving revision 1.26 diff -u -p -r1.26 gtkfilechooserbutton.c --- gtkfilechooserbutton.c 6 Jan 2005 06:25:30 -0000 1.26 +++ gtkfilechooserbutton.c 9 Feb 2005 15:39:58 -0000 @@ -413,7 +413,7 @@ gtk_file_chooser_button_init (GtkFileCho gtk_widget_show (sep); image = gtk_image_new_from_stock (GTK_STOCK_OPEN, - GTK_ICON_SIZE_SMALL_TOOLBAR); + GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_widget_show (image);
Forgot one : Index: gtk/gtkfilechooserbutton.c =================================================================== RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserbutton.c,v retrieving revision 1.26 diff -p -u -r1.26 gtkfilechooserbutton.c --- gtk/gtkfilechooserbutton.c 6 Jan 2005 06:25:30 -0000 1.26 +++ gtk/gtkfilechooserbutton.c 9 Feb 2005 15:59:37 -0000 @@ -413,7 +413,7 @@ gtk_file_chooser_button_init (GtkFileCho gtk_widget_show (sep); image = gtk_image_new_from_stock (GTK_STOCK_OPEN, - GTK_ICON_SIZE_SMALL_TOOLBAR); + GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_widget_show (image); @@ -1043,7 +1043,7 @@ change_icon_theme (GtkFileChooserButton settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button))); - if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_SMALL_TOOLBAR, + if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height)) priv->icon_size = MAX (width, height); else
Not sure about this one. The icon appears in a button, so maybe it should use GTK_ICON_SIZE_BUTTON ? That would go from 18->20 instead of 18->16, though.
Matthias, I'd like to see only 16x16 and 24x24 bitmaps used for small icons everywhere. Anything else will simply be blurry. For 32x32 and above, the vector icon (which are being phased in git) will do the job.
So, what is the decision ? This makes the file chooser button look weird - Just compare the "Look in folder" button of the gnome-search-tool with any file selector (opening/saving)
2005-02-11 Matthias Clasen <mclasen@redhat.com> Complete the fix for #165770, Vincent Untz: * gtk/gtkfilechooserbutton.c (FALLBACK_ICON_SIZE): Make the fallback size be 16, to be equal to the default for GTK_ICON_SIZE_MENU (in gtkiconfactory.c:init_icon_sizes()). (gtk_file_chooser_button_init): (change_icon_theme): Use GTK_ICON_SIZE_MENU instead of GTK_ICON_SIZE_SMALL_TOOLBAR.
I *think* you got the wrong Vincent, but hey, that happens ;-)
Actually we forgot another one : Index: gtkpathbar.c =================================================================== RCS file: /cvs/gnome/gtk+/gtk/gtkpathbar.c,v retrieving revision 1.37 diff -u -p -r1.37 gtkpathbar.c --- gtkpathbar.c 6 Jan 2005 01:46:39 -0000 1.37 +++ gtkpathbar.c 11 Feb 2005 15:49:09 -0000 @@ -54,7 +54,7 @@ typedef enum { static guint path_bar_signals [LAST_SIGNAL] = { 0 }; /* Icon size for if we can't get it from the theme */ -#define FALLBACK_ICON_SIZE 20 +#define FALLBACK_ICON_SIZE 16 typedef struct _ButtonData ButtonData; @@ -835,7 +835,7 @@ change_icon_theme (GtkPathBar *path_bar) settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (path_bar))); - if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_BUTTON, &width, &height)) + if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height)) path_bar->icon_size = MAX (width, height); else path_bar->icon_size = FALLBACK_ICON_SIZE; I think that's the last one (notice that it has the nice side-effect of shrinking the path bar by a few pixels - which looks nicer)...
I reopen the bug, according last comment. Vincent, could you confirm this bug still exist?
already fixed in cvs.
sorry to reopen it but I just saw the edit button in filechooser of gtk-2.10 is has the same bug. I attach a screenshot
Created attachment 70888 [details] new filechooser