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 165770 - file dialog doesn't use 16x16 icons, but scaled 24x24
file dialog doesn't use 16x16 icons, but scaled 24x24
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.6.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2005-01-31 05:00 UTC by Jakub Steiner
Modified: 2007-08-03 21:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Scaled icons vs crisp 16x16px icons (18.31 KB, image/png)
2005-01-31 05:01 UTC, Jakub Steiner
Details
new filechooser (23.69 KB, image/png)
2006-08-14 20:16 UTC, Baptiste Mille-Mathias
Details

Description Jakub Steiner 2005-01-31 05:00:33 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.
Comment 1 Jakub Steiner 2005-01-31 05:01:16 UTC
Created attachment 36750 [details]
Scaled icons vs crisp 16x16px icons
Comment 2 Federico Mena Quintero 2005-02-01 23:56:56 UTC
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.
Comment 3 Vincent Noel 2005-02-09 15:40:28 UTC
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);
Comment 4 Vincent Noel 2005-02-09 15:59:57 UTC
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
Comment 5 Matthias Clasen 2005-02-09 16:11:13 UTC
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.
Comment 6 Jakub Steiner 2005-02-09 16:21:27 UTC
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.
Comment 7 Vincent Noel 2005-02-10 17:57:41 UTC
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)
Comment 8 Matthias Clasen 2005-02-11 06:19:19 UTC
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. 
Comment 9 Vincent Noel 2005-02-11 13:14:18 UTC
I *think* you got the wrong Vincent, but hey, that happens ;-)
Comment 10 Vincent Noel 2005-02-11 15:50:02 UTC
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)...
Comment 11 Baptiste Mille-Mathias 2006-08-11 06:31:01 UTC
I reopen the bug, according last comment.

Vincent, could you confirm this bug still exist?
Comment 12 Matthias Clasen 2006-08-14 19:53:35 UTC
already fixed in cvs.
Comment 13 Baptiste Mille-Mathias 2006-08-14 20:14:50 UTC
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 
Comment 14 Baptiste Mille-Mathias 2006-08-14 20:16:24 UTC
Created attachment 70888 [details]
new filechooser