[gtk+/gtk-style-context: 155/206] GtkWidget: Set style context direction.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 155/206] GtkWidget: Set style context direction.
- Date: Mon, 23 Aug 2010 17:27:57 +0000 (UTC)
commit b28f46c9e2190d8d22fbf2edba1c5bd5fdcba6b0
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Aug 2 17:24:27 2010 +0200
GtkWidget: Set style context direction.
gtk/gtkwidget.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 633a46e..d491198 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8660,7 +8660,17 @@ gtk_widget_set_direction (GtkWidget *widget,
}
if (old_dir != gtk_widget_get_direction (widget))
- gtk_widget_emit_direction_changed (widget, old_dir);
+ {
+ GtkStyleContext *context;
+
+ context = g_object_get_qdata (G_OBJECT (widget), quark_style_context);
+
+ if (context)
+ gtk_style_context_set_direction (context,
+ gtk_widget_get_direction (widget));
+
+ gtk_widget_emit_direction_changed (widget, old_dir);
+ }
}
/**
@@ -11655,7 +11665,11 @@ gtk_widget_get_style_context (GtkWidget *widget)
GtkCssProvider *default_provider;
GtkWidgetPath *path;
- context = g_object_new (GTK_TYPE_STYLE_CONTEXT, NULL);
+ context = g_object_new (GTK_TYPE_STYLE_CONTEXT,
+ "direction", gtk_widget_get_direction (widget),
+ NULL);
+
+
g_object_set_qdata_full (G_OBJECT (widget),
quark_style_context, context,
(GDestroyNotify) g_object_unref);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]