[gtk+/wip/listbox] GtkWidget: Change which states propagate



commit 3d26ff4f063fcb764213b9a54421ed0aa4ec0807
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Jun 10 17:02:34 2013 +0200

    GtkWidget: Change which states propagate
    
    Historically the following states propagated to children:
      GTK_STATE_FLAG_ACTIVE
      GTK_STATE_FLAG_PRELIGHT
      GTK_STATE_FLAG_SELECTED
      GTK_STATE_FLAG_INSENSITIVE
      GTK_STATE_FLAG_INCONSISTENT
      GTK_STATE_FLAG_BACKDROP
    
    However, several of these are problematic on containers like GtkListBox.
    For instance, if a row is ACTIVE or SELECTED then all children (like e.g
    a button) inside the row will *also* look active/selected. This is almost
    never right. The right way to theme this is to catch e.g. SELECTED on the
    container itself and set e.g. the color and let the children inherit
    the color instead of the flag.
    
    We now propagate only these flags:
      GTK_STATE_FLAG_INSENSITIVE
      GTK_STATE_FLAG_BACKDROP
    
    Which make sense to be recursive as they really affect every widget
    inside the container.
    
    However, this is a CSS theme break, and while most things continue working
    as-is some themes may need minor tweaks.

 gtk/gtkwidget.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3ddd36a..c78522f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -385,12 +385,7 @@
  * </refsect2>
  */
 
-/* Add flags here that should not be propagated to children. By default,
- * all flags will be set on children (think prelight or active), but we
- * might want to not do this for some.
- */
-#define GTK_STATE_FLAGS_DONT_PROPAGATE (GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_DIR_LTR | 
GTK_STATE_FLAG_DIR_RTL)
-#define GTK_STATE_FLAGS_DO_PROPAGATE (~GTK_STATE_FLAGS_DONT_PROPAGATE)
+#define GTK_STATE_FLAGS_DO_PROPAGATE (GTK_STATE_FLAG_INSENSITIVE|GTK_STATE_FLAG_BACKDROP)
 
 #define WIDGET_CLASS(w)         GTK_WIDGET_GET_CLASS (w)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]