[gtk+] cssimagebuiltin: Remove icons that don't draw anything anymore



commit a72c4576b2815c96b55164ebe27ad62f40108da7
Author: Benjamin Otte <otte redhat com>
Date:   Tue May 3 12:57:50 2016 +0200

    cssimagebuiltin: Remove icons that don't draw anything anymore

 gtk/gtkcheckbutton.c     |    4 ++--
 gtk/gtkcssimagebuiltin.c |    6 ++----
 gtk/gtkcsstypesprivate.h |    2 --
 gtk/gtkmodelbutton.c     |    6 ++----
 gtk/gtkrender.c          |    8 ++++----
 5 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 03e8ddb..a274524 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -127,11 +127,11 @@ gtk_check_button_update_node_state (GtkWidget *widget)
    * way to update the icon
    */
   if (state & GTK_STATE_FLAG_CHECKED)
-    image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED : 
GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED;
+    image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
   else if (state & GTK_STATE_FLAG_INCONSISTENT)
     image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT : 
GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT;
   else
-    image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
+    image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
   gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (priv->indicator_gadget), image_type);
 
   gtk_css_gadget_set_state (priv->indicator_gadget, state);
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index 5b059db..3a65747 100644
--- a/gtk/gtkcssimagebuiltin.c
+++ b/gtk/gtkcssimagebuiltin.c
@@ -863,19 +863,17 @@ gtk_css_image_builtin_draw (GtkCssImage            *image,
   case GTK_CSS_IMAGE_BUILTIN_NONE:
     break;
   case GTK_CSS_IMAGE_BUILTIN_CHECK:
-  case GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED:
   case GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT:
     gtk_css_image_builtin_draw_check (image, cr,
                                       width, height,
-                                      image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED,
+                                      image_type == GTK_CSS_IMAGE_BUILTIN_CHECK,
                                       image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT);
     break;
   case GTK_CSS_IMAGE_BUILTIN_OPTION:
-  case GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED:
   case GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT:
     gtk_css_image_builtin_draw_option (image, cr,
                                        width, height,
-                                       image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED,
+                                       image_type == GTK_CSS_IMAGE_BUILTIN_OPTION,
                                        image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT);
     break;
   case GTK_CSS_IMAGE_BUILTIN_ARROW_UP:
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 857c823..3f5ce93 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -233,10 +233,8 @@ enum { /*< skip >*/
 typedef enum /*< skip >*/ {
   GTK_CSS_IMAGE_BUILTIN_NONE,
   GTK_CSS_IMAGE_BUILTIN_CHECK,
-  GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED,
   GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT,
   GTK_CSS_IMAGE_BUILTIN_OPTION,
-  GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED,
   GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT,
   GTK_CSS_IMAGE_BUILTIN_ARROW_UP,
   GTK_CSS_IMAGE_BUILTIN_ARROW_DOWN,
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 0e941c2..209f60d 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -210,12 +210,11 @@ gtk_model_button_update_state (GtkModelButton *button)
       if (button->active && !button->menu_name)
         {
           indicator_state |= GTK_STATE_FLAG_CHECKED;
-          image_type = GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED;
+          image_type = GTK_CSS_IMAGE_BUILTIN_CHECK;
         }
       else
         {
           indicator_state &= ~GTK_STATE_FLAG_CHECKED;
-          image_type = GTK_CSS_IMAGE_BUILTIN_CHECK;
         }
     }
   if (button->role == GTK_BUTTON_ROLE_RADIO)
@@ -223,12 +222,11 @@ gtk_model_button_update_state (GtkModelButton *button)
       if (button->active && !button->menu_name)
         {
           indicator_state |= GTK_STATE_FLAG_CHECKED;
-          image_type = GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED;
+          image_type = GTK_CSS_IMAGE_BUILTIN_OPTION;
         }
       else
         {
           indicator_state &= ~GTK_STATE_FLAG_CHECKED;
-          image_type = GTK_CSS_IMAGE_BUILTIN_OPTION;
         }
     }
 
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 42cd58f..1c515c1 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -52,9 +52,9 @@ gtk_do_render_check (GtkStyleContext *context,
   if (state & GTK_STATE_FLAG_INCONSISTENT)
     image_type = GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT;
   else if (state & GTK_STATE_FLAG_CHECKED)
-    image_type = GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED;
-  else
     image_type = GTK_CSS_IMAGE_BUILTIN_CHECK;
+  else
+    image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
 
   gtk_css_style_render_icon (gtk_style_context_lookup_style (context), cr, x, y, width, height, image_type);
 }
@@ -117,9 +117,9 @@ gtk_do_render_option (GtkStyleContext *context,
   if (state & GTK_STATE_FLAG_INCONSISTENT)
     image_type = GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT;
   else if (state & GTK_STATE_FLAG_CHECKED)
-    image_type = GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED;
-  else
     image_type = GTK_CSS_IMAGE_BUILTIN_OPTION;
+  else
+    image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
 
   gtk_css_style_render_icon (gtk_style_context_lookup_style (context), cr, x, y, width, height, image_type);
 }


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