[gtk+/rendering-cleanup-next: 88/155] checkbutton: Remove excessive is_drawable() check



commit 79196cc188da554b62e8fe69b693a9b6b2240dbc
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 8 14:55:53 2010 +0200

    checkbutton: Remove excessive is_drawable() check

 gtk/gtkcheckbutton.c |  100 ++++++++++++++++++++++++--------------------------
 1 files changed, 48 insertions(+), 52 deletions(-)
---
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 35c7e34..294fe7d 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -135,59 +135,55 @@ gtk_check_button_paint (GtkWidget    *widget,
 			GdkRectangle *area)
 {
   GtkCheckButton *check_button = GTK_CHECK_BUTTON (widget);
-  
-  if (gtk_widget_is_drawable (widget))
-    {
-      gint border_width;
-      gint interior_focus;
-      gint focus_width;
-      gint focus_pad;
-	  
-      gtk_widget_style_get (widget,
-			    "interior-focus", &interior_focus,
-			    "focus-line-width", &focus_width,
-			    "focus-padding", &focus_pad,
-			    NULL);
+  gint border_width;
+  gint interior_focus;
+  gint focus_width;
+  gint focus_pad;
+      
+  gtk_widget_style_get (widget,
+                        "interior-focus", &interior_focus,
+                        "focus-line-width", &focus_width,
+                        "focus-padding", &focus_pad,
+                        NULL);
 
-      gtk_check_button_draw_indicator (check_button, area);
+  gtk_check_button_draw_indicator (check_button, area);
 
-      border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-      if (gtk_widget_has_focus (widget))
-	{
-          GtkStateType state;
-          GtkStyle *style;
-	  GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
-          GdkWindow *window;
-
-          style = gtk_widget_get_style (widget);
-          window = gtk_widget_get_window (widget);
-          state = gtk_widget_get_state (widget);
-
-	  if (interior_focus && child && gtk_widget_get_visible (child))
-            {
-              GtkAllocation child_allocation;
-
-              gtk_widget_get_allocation (child, &child_allocation);
-              gtk_paint_focus (style, window, state,
-                               area, widget, "checkbutton",
-                               child_allocation.x - focus_width - focus_pad,
-                               child_allocation.y - focus_width - focus_pad,
-                               child_allocation.width + 2 * (focus_width + focus_pad),
-                               child_allocation.height + 2 * (focus_width + focus_pad));
-            }
-	  else
-            {
-              GtkAllocation allocation;
-
-              gtk_widget_get_allocation (widget, &allocation);
-              gtk_paint_focus (style, window, state,
-                               area, widget, "checkbutton",
-                               allocation.x + border_width,
-                               allocation.y + border_width,
-                               allocation.width - 2 * border_width,
-                               allocation.height - 2 * border_width);
-            }
-	}
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+  if (gtk_widget_has_focus (widget))
+    {
+      GtkStateType state;
+      GtkStyle *style;
+      GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+      GdkWindow *window;
+
+      style = gtk_widget_get_style (widget);
+      window = gtk_widget_get_window (widget);
+      state = gtk_widget_get_state (widget);
+
+      if (interior_focus && child && gtk_widget_get_visible (child))
+        {
+          GtkAllocation child_allocation;
+
+          gtk_widget_get_allocation (child, &child_allocation);
+          gtk_paint_focus (style, window, state,
+                           area, widget, "checkbutton",
+                           child_allocation.x - focus_width - focus_pad,
+                           child_allocation.y - focus_width - focus_pad,
+                           child_allocation.width + 2 * (focus_width + focus_pad),
+                           child_allocation.height + 2 * (focus_width + focus_pad));
+        }
+      else
+        {
+          GtkAllocation allocation;
+
+          gtk_widget_get_allocation (widget, &allocation);
+          gtk_paint_focus (style, window, state,
+                           area, widget, "checkbutton",
+                           allocation.x + border_width,
+                           allocation.y + border_width,
+                           allocation.width - 2 * border_width,
+                           allocation.height - 2 * border_width);
+        }
     }
 }
 



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