[gtk/wip/baedert/for-master: 3/15] scale: Properly update when inverted



commit 0a96c3f06213bef4f46f4357a4dd786d97518d83
Author: Timm Bäder <mail baedert org>
Date:   Fri Aug 9 19:36:01 2019 +0200

    scale: Properly update when inverted
    
    Just queue_resize()ing the range itself doesn't work as it will just
    re-allocate all the child widgets (i.e. just the trough) to its old
    position and size.

 gtk/gtkrange.c | 2 +-
 gtk/gtkscale.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index d8532ca289..0dffe25dab 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -781,7 +781,7 @@ gtk_range_set_inverted (GtkRange *range,
       update_fill_position (range);
       update_highlight_position (range);
 
-      gtk_widget_queue_resize (GTK_WIDGET (range));
+      gtk_widget_queue_resize (priv->trough_widget);
 
       g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_INVERTED]);
     }
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 538b86ac59..c7922e8591 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -304,6 +304,12 @@ gtk_scale_notify (GObject    *object,
 
       _gtk_range_set_stop_values (GTK_RANGE (scale), values, n);
 
+      if (priv->top_marks_widget)
+        gtk_widget_queue_resize (priv->top_marks_widget);
+
+      if (priv->bottom_marks_widget)
+        gtk_widget_queue_resize (priv->bottom_marks_widget);
+
       g_free (values);
     }
   else if (strcmp (pspec->name, "adjustment"))


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