[gtk+] Cosmetic: Avoid an explicit state variable



commit acdb7dae4e469504aaffad1ac8bd10d4a03bf3e4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Nov 14 09:51:37 2015 -0500

    Cosmetic: Avoid an explicit state variable
    
    Using the state of the context makes it more obviously correct.

 gtk/gtklistbox.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 82d759e..9b963d9 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -3141,21 +3141,20 @@ gtk_list_box_row_draw (GtkWidget *widget,
                        cairo_t   *cr)
 {
   GtkListBoxRow *row = GTK_LIST_BOX_ROW (widget);
-  GtkAllocation allocation = {0};
-  GtkStyleContext* context;
-  GtkStateFlags state;
-  GtkBorder border;
+  GtkAllocation allocation;
+  GtkStyleContext *context;
 
   gtk_widget_get_allocation (widget, &allocation);
   context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
 
   gtk_render_background (context, cr, 0, 0, allocation.width, allocation.height);
   gtk_render_frame (context, cr, 0, 0, allocation.width, allocation.height);
 
   if (gtk_widget_has_visible_focus (GTK_WIDGET (row)))
     {
-      gtk_style_context_get_border (context, state, &border);
+      GtkBorder border;
+
+      gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
       gtk_render_focus (context, cr, border.left, border.top,
                         allocation.width - border.left - border.right,
                         allocation.height - border.top - border.bottom);


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