[gtk+] csstypes: Propagate NTH_CHILD and NTH_LAST_CHILD to siblings
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] csstypes: Propagate NTH_CHILD and NTH_LAST_CHILD to siblings
- Date: Mon, 9 Nov 2015 00:49:47 +0000 (UTC)
commit 4141a7d7c8a949585d5bfdc997c7651c5e3fc49f
Author: Benjamin Otte <otte redhat com>
Date: Mon Nov 9 01:38:39 2015 +0100
csstypes: Propagate NTH_CHILD and NTH_LAST_CHILD to siblings
Otherwise, we'd have to mark eveyr child on changes, and it's far easier
to do that once we actually validate.
gtk/gtkcsstypes.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcsstypes.c b/gtk/gtkcsstypes.c
index e14ab2c..2e93cbc 100644
--- a/gtk/gtkcsstypes.c
+++ b/gtk/gtkcsstypes.c
@@ -34,11 +34,16 @@ _gtk_css_change_for_sibling (GtkCssChange match)
| GTK_CSS_CHANGE_NTH_LAST_CHILD \
| GTK_CSS_CHANGE_STATE )
+#define KEEP_STATES ( ~(BASE_STATES|GTK_CSS_CHANGE_SOURCE|GTK_CSS_CHANGE_PARENT_STYLE) \
+ | GTK_CSS_CHANGE_NTH_CHILD \
+ | GTK_CSS_CHANGE_NTH_LAST_CHILD)
+
#define SIBLING_SHIFT 8
- return (match & ~(BASE_STATES|GTK_CSS_CHANGE_SOURCE|GTK_CSS_CHANGE_PARENT_STYLE)) | ((match & BASE_STATES)
<< SIBLING_SHIFT);
+ return (match & KEEP_STATES) | ((match & BASE_STATES) << SIBLING_SHIFT);
#undef BASE_STATES
+#undef KEEP_STATES
#undef SIBLING_SHIFT
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]