[gtk+] filechooserwidget: icon size is always 16



commit 67268bcc23dc8408fa7fc2450cf7b7dbb7966ef6
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Nov 14 19:48:59 2017 -0500

    filechooserwidget: icon size is always 16

 gtk/gtkfilechooserwidget.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index ffcd594..0394ba9 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -342,7 +342,6 @@ struct _GtkFileChooserWidgetPrivate {
   guint location_changed_id;
 
   gulong settings_signal_id;
-  int icon_size;
 
   GSource *focus_entry_idle;
 
@@ -436,8 +435,7 @@ enum {
 
 #define DEFAULT_RECENT_FILES_LIMIT 50
 
-/* Icon size for if we can't get it from the theme */
-#define FALLBACK_ICON_SIZE 16
+#define ICON_SIZE 16
 
 #define PREVIEW_HBOX_SPACING 12
 #define NUM_LINES 45
@@ -2547,8 +2545,8 @@ set_icon_cell_renderer_fixed_size (GtkFileChooserWidget *impl)
 
   gtk_cell_renderer_get_padding (priv->list_pixbuf_renderer, &xpad, &ypad);
   gtk_cell_renderer_set_fixed_size (priv->list_pixbuf_renderer,
-                                    xpad * 2 + priv->icon_size,
-                                    ypad * 2 + priv->icon_size);
+                                    xpad * 2 + ICON_SIZE,
+                                    ypad * 2 + ICON_SIZE);
 }
 
 static gboolean
@@ -3721,15 +3719,9 @@ static void
 change_icon_theme (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = impl->priv;
-  gint width, height;
 
   profile_start ("start", NULL);
 
-  if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
-    priv->icon_size = MAX (width, height);
-  else
-    priv->icon_size = FALLBACK_ICON_SIZE;
-
   /* the first cell in the first column is the icon column, and we have a fixed size there */
   set_icon_cell_renderer_fixed_size (impl);
 
@@ -4951,7 +4943,7 @@ file_system_model_set (GtkFileSystemModel *model,
         {
           if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON))
             {
-              g_value_take_object (value, _gtk_file_info_get_icon (info, priv->icon_size, 
gtk_widget_get_scale_factor (GTK_WIDGET (impl))));
+              g_value_take_object (value, _gtk_file_info_get_icon (info, ICON_SIZE, 
gtk_widget_get_scale_factor (GTK_WIDGET (impl))));
             }
           else
             {
@@ -8643,7 +8635,6 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl)
   priv->select_multiple = FALSE;
   priv->show_hidden = FALSE;
   priv->show_size_column = TRUE;
-  priv->icon_size = FALLBACK_ICON_SIZE;
   priv->load_state = LOAD_EMPTY;
   priv->reload_state = RELOAD_EMPTY;
   priv->pending_select_files = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]