[gtk+] range: Stack widgets properly



commit cf1cd19b6184113068bf94feef7e6e42c53b4883
Author: Benjamin Otte <otte redhat com>
Date:   Sun Nov 5 04:00:33 2017 +0100

    range: Stack widgets properly
    
    The trough widgets have the slider on top of the fill level and the
    hilight widget. Make sure the widget stacking respects that.
    
    This is particularly relevant because picking event targets should pick
    the slider and not the hilight widget.

 gtk/gtkrange.c |    4 ++--
 gtk/gtkscale.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index b9ddad5..0b8f6f7 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -1125,7 +1125,7 @@ gtk_range_set_show_fill_level (GtkRange *range,
   if (show_fill_level)
     {
       priv->fill_widget = gtk_gizmo_new ("fill", NULL, NULL, NULL);
-      gtk_widget_set_parent (priv->fill_widget, priv->trough_widget);
+      gtk_widget_insert_after (priv->fill_widget, priv->trough_widget, NULL);
       update_fill_position (range);
     }
   else
@@ -3010,7 +3010,7 @@ _gtk_range_set_has_origin (GtkRange *range,
   if (has_origin)
     {
       priv->highlight_widget = gtk_gizmo_new ("highlight", NULL, NULL, NULL);
-      gtk_widget_set_parent (priv->highlight_widget, priv->trough_widget);
+      gtk_widget_insert_before (priv->highlight_widget, priv->trough_widget, priv->slider_widget);
 
       update_highlight_position (range);
     }
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 5e9259e..fa09f95 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -87,9 +87,9 @@
  * │   ╰── mark
  * ├── [value]
  * ├── trough
- * │   ├── slider
+ * │   ├── [fill]
  * │   ├── [highlight]
- * │   ╰── [fill]
+ * │   ╰── slider
  * ╰── marks.bottom
  *     ├── mark
  *     ┊    ├── indicator


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