After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 79229 - GtkScale with a big number of digits and value pos set to GTK_POS_TOP/BOTTOM is panted incorrectly
GtkScale with a big number of digits and value pos set to GTK_POS_TOP/BOTTOM ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkRange
2.0.x
Other All
: Low minor
: Small fix
Assigned To: gtk-bugs
gtk-bugs
: 349067 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-04-19 13:45 UTC by Vitaly Tishkov
Modified: 2016-06-08 01:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
See this attachment for incorrect painting (GTK_POS_TOP) (1.20 KB, image/png)
2002-04-19 13:46 UTC, Vitaly Tishkov
Details
See this attachment for the correct painting (GTK_POS_LEFT). (1.95 KB, image/png)
2002-04-19 13:49 UTC, Vitaly Tishkov
Details

Description Vitaly Tishkov 2002-04-19 13:45:24 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();
}
Comment 1 Vitaly Tishkov 2002-04-19 13:46:33 UTC
Created attachment 7812 [details]
See this attachment for incorrect painting (GTK_POS_TOP)
Comment 2 Vitaly Tishkov 2002-04-19 13:49:19 UTC
Created attachment 7813 [details]
See this attachment for the correct painting (GTK_POS_LEFT).
Comment 3 Owen Taylor 2003-08-15 21:42:44 UTC
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.
Comment 4 Matthias Clasen 2006-08-05 18:49:04 UTC
*** Bug 349067 has been marked as a duplicate of this bug. ***