[gtk+/gtk-style-context: 150/206] GtkWidget: Create GtkStyle on top of GtkStyleContext.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 150/206] GtkWidget: Create GtkStyle on top of GtkStyleContext.
- Date: Mon, 23 Aug 2010 17:27:32 +0000 (UTC)
commit 516ebf173fc4f5a90a0e0f4f06da9ac38a588bc4
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Aug 2 16:14:17 2010 +0200
GtkWidget: Create GtkStyle on top of GtkStyleContext.
gtk/gtkwidget.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 18f2681..9c3e63e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6366,7 +6366,7 @@ gtk_widget_set_parent (GtkWidget *widget,
}
context = g_object_get_qdata (G_OBJECT (widget),
- quark_style_context);
+ quark_style_context);
if (context)
{
GtkWidgetPath *path;
@@ -6496,9 +6496,23 @@ gtk_widget_ensure_style (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
+ if (!widget->style ||
+ !gtk_style_has_context (widget->style))
+ {
+ GtkStyle *style;
+
+ style = g_object_new (GTK_TYPE_STYLE,
+ "context", gtk_widget_get_style_context (widget),
+ NULL);
+
+ gtk_widget_set_style_internal (widget, style, TRUE);
+ }
+
+#if 0
if (!GTK_WIDGET_USER_STYLE (widget) &&
!gtk_widget_has_rc_style (widget))
gtk_widget_reset_rc_style (widget);
+#endif
}
/* Look up the RC style for this widget, unsetting any user style that
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]