[gtk+] stylecontext: Add a flag to force style_updated() emission
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] stylecontext: Add a flag to force style_updated() emission
- Date: Wed, 14 Nov 2012 12:27:53 +0000 (UTC)
commit 6d3b4d93821fdcb3a4fca506c487a6319a73ec6c
Author: Benjamin Otte <otte redhat com>
Date: Wed Nov 14 13:24:58 2012 +0100
stylecontext: Add a flag to force style_updated() emission
This is used in gtk_widget_reset_style() (via GTK_CSS_CHANGE_ANY) now,
and that makes GtkSettings font related changes work again.
gtk/gtkcsstypesprivate.h | 5 +++--
gtk/gtkstylecontext.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 55ad3b5..ab360ef 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -49,10 +49,11 @@ typedef enum { /*< skip >*/
GTK_CSS_CHANGE_PARENT_SIBLING_STATE = (1 << 15),
/* add more */
GTK_CSS_CHANGE_SOURCE = (1 << 16),
- GTK_CSS_CHANGE_ANIMATE = (1 << 17)
+ GTK_CSS_CHANGE_ANIMATE = (1 << 17),
+ GTK_CSS_CHANGE_FORCE_INVALIDATE = (1 << 18)
} GtkCssChange;
-#define GTK_CSS_CHANGE_ANY ((1 << 18) - 1)
+#define GTK_CSS_CHANGE_ANY ((1 << 19) - 1)
#define GTK_CSS_CHANGE_ANY_SELF (GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE)
#define GTK_CSS_CHANGE_ANY_SIBLING (GTK_CSS_CHANGE_SIBLING_CLASS | GTK_CSS_CHANGE_SIBLING_NAME | \
GTK_CSS_CHANGE_SIBLING_POSITION | GTK_CSS_CHANGE_SIBLING_STATE)
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index c0253a4..8a193cc 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3180,7 +3180,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
_gtk_bitmask_free (animation_changes);
}
- if (!_gtk_bitmask_is_empty (changes))
+ if (!_gtk_bitmask_is_empty (changes) || (change & GTK_CSS_CHANGE_FORCE_INVALIDATE))
gtk_style_context_do_invalidate (context);
change = _gtk_css_change_for_child (change);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]