From acdb7dae4e469504aaffad1ac8bd10d4a03bf3e4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Nov 2015 09:51:37 -0500 Subject: [PATCH] Cosmetic: Avoid an explicit state variable Using the state of the context makes it more obviously correct. --- gtk/gtklistbox.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 82d759e141..9b963d97f9 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);