From bcc6df00e58cb8f914aebbb3c6152a84849d0e82 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Nov 2015 10:30:16 -0500 Subject: [PATCH] Cosmetic: Avoid explicit state variables Using the state of the context makes this more obviously correct. --- gtk/gtktoolbar.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 57bfcb4dcb..ccf7a48004 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -3575,7 +3575,6 @@ _gtk_toolbar_paint_space_line (GtkWidget *widget, { GtkOrientation orientation; GtkStyleContext *context; - GtkStateFlags state; GtkBorder padding; gint width, height; const gdouble start_fraction = (SPACE_LINE_START / SPACE_LINE_DIVISION); @@ -3585,11 +3584,11 @@ _gtk_toolbar_paint_space_line (GtkWidget *widget, orientation = toolbar ? toolbar->priv->orientation : GTK_ORIENTATION_HORIZONTAL; - context = gtk_widget_get_style_context (widget); - state = gtk_widget_get_state_flags (widget); width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); - gtk_style_context_get_padding (context, state, &padding); + + context = gtk_widget_get_style_context (widget); + gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding); if (orientation == GTK_ORIENTATION_HORIZONTAL) {