[gtk+] Cosmetic: Avoid explicit state variables
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Cosmetic: Avoid explicit state variables
- Date: Sat, 14 Nov 2015 17:57:16 +0000 (UTC)
commit 93629325d52edd583e951f5921bcffe0f1c05e2e
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 14 10:30:47 2015 -0500
Cosmetic: Avoid explicit state variables
Using the state of the context makes this more obviously correct.
gtk/gtkviewport.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 6b8ac24..93a1e9e 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -1016,7 +1016,6 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
GtkViewport *viewport = GTK_VIEWPORT (widget);
GtkViewportPrivate *priv = viewport->priv;
GtkStyleContext *context;
- GtkStateFlags state;
GtkBorder padding, border;
GtkWidget *child;
gint child_min, child_nat;
@@ -1027,12 +1026,11 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
minimum = 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
context = gtk_widget_get_style_context (GTK_WIDGET (widget));
- state = gtk_widget_get_state_flags (GTK_WIDGET (widget));
- gtk_style_context_get_padding (context, state, &padding);
+ gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
if (priv->shadow_type != GTK_SHADOW_NONE)
{
- gtk_style_context_get_border (context, state, &border);
+ gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]