[gtk] scale: Fix value widget measurement
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] scale: Fix value widget measurement
- Date: Fri, 9 Aug 2019 15:15:26 +0000 (UTC)
commit 87aeec2b63bdc1cd10305df9efc16e1ee3096e21
Author: Timm Bäder <mail baedert org>
Date: Fri Aug 9 14:26:57 2019 +0200
scale: Fix value widget measurement
Since we set the size request of the label, the later measure()
call would return at least the size we set, making the size only ever
grow.
gtk/gtkscale.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 7f8aa1e071..9a51d1eafb 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -253,6 +253,7 @@ update_label_request (GtkScale *scale)
highest_value = gtk_adjustment_get_upper (adjustment);
old_text = g_strdup (gtk_label_get_label (GTK_LABEL (priv->value_widget)));
+ gtk_widget_set_size_request (priv->value_widget, -1, -1);
text = gtk_scale_format_value (scale, lowest_value);
gtk_label_set_label (GTK_LABEL (priv->value_widget), text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]