[gtk+/wip/otte/icon-size: 12/20] cellrendererspinner: Don't track old icon size



commit 3e76b20394c8e9c57ada23268d039ef8f6b8a566
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 23 19:59:27 2017 +0100

    cellrendererspinner: Don't track old icon size
    
    It was only used to avoid gtk_icon_size_lookup() calls and those aren't
    expensive.

 gtk/gtkcellrendererspinner.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcellrendererspinner.c b/gtk/gtkcellrendererspinner.c
index 527a745..54b1cbd 100644
--- a/gtk/gtkcellrendererspinner.c
+++ b/gtk/gtkcellrendererspinner.c
@@ -66,7 +66,7 @@ struct _GtkCellRendererSpinnerPrivate
 {
   gboolean active;
   guint pulse;
-  GtkIconSize icon_size, old_icon_size;
+  GtkIconSize icon_size;
   gint size;
 };
 
@@ -162,7 +162,6 @@ gtk_cell_renderer_spinner_init (GtkCellRendererSpinner *cell)
 {
   cell->priv = gtk_cell_renderer_spinner_get_instance_private (cell);
   cell->priv->pulse = 0;
-  cell->priv->old_icon_size = GTK_ICON_SIZE_INVALID;
   cell->priv->icon_size = GTK_ICON_SIZE_MENU;
 }
 
@@ -188,9 +187,6 @@ gtk_cell_renderer_spinner_update_size (GtkCellRendererSpinner *cell,
 {
   GtkCellRendererSpinnerPrivate *priv = cell->priv;
 
-  if (priv->old_icon_size == priv->icon_size)
-    return;
-
   if (!gtk_icon_size_lookup (priv->icon_size, &priv->size, NULL))
     {
       g_warning ("Invalid icon size %u", priv->icon_size);
@@ -251,7 +247,6 @@ gtk_cell_renderer_spinner_set_property (GObject      *object,
       case PROP_SIZE:
         if (priv->icon_size != g_value_get_enum (value))
           {
-            priv->old_icon_size = priv->icon_size;
             priv->icon_size = g_value_get_enum (value);
             g_object_notify (object, "size");
           }


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