GNOME Bugzilla – Bug 79229
GtkScale with a big number of digits and value pos set to GTK_POS_TOP/BOTTOM is panted incorrectly
Last modified: 2016-06-08 01:34:25 UTC
If you create a scale with big number of widgets and set value pos to GTK_POS_TOP or GGTK_POS_BOTTOM, it's value image will be cut. But a scale with value pos set ot GTK_POS_TOP/BOTTOM will be resized to display all the value. Test case. -------- #include <gtk/gtk.h> int main (int argc, char** argv) { GtkWidget *window; GtkWidget *widget; GtkWidget *hbox; gtk_init (&argc, &argv); widget = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1.0,1.0,1.0,1.0,1.0,10.0))); gtk_scale_set_digits (GTK_SCALE (widget), 10); gtk_scale_set_value_pos (GTK_SCALE (widget), GTK_POS_TOP); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_add (GTK_CONTAINER (window), widget); gtk_widget_show_all (window); gtk_main(); }
Created attachment 7812 [details] See this attachment for incorrect painting (GTK_POS_TOP)
Created attachment 7813 [details] See this attachment for the correct painting (GTK_POS_LEFT).
Not entirely trivial to fix - the problem is that the space is reserved by GtkRange::calc-border, which only has the idea that there is a border on each side, not that the contents of the border might be wider than the scale. There's another bug that should be fixed at the same time as fixing this - if the upper/lower of the scale change, gtk_widget_queue_resize() should be called.
*** Bug 349067 has been marked as a duplicate of this bug. ***