[Top][All Lists]

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

Re: Gtk scrollbar: thumb too short

From: Stefan Monnier
Subject: Re: Gtk scrollbar: thumb too short
Date: Mon, 07 Apr 2003 12:57:02 -0400

> >     > 3.  Make the GTK scrollbar more customizable so that it can optionally
> >     >     handle a character based approach and hence behave, within Emacs,
> >     >     more like the native scrollbar than the pixel based variant of the
> >     >     GTK scrollbar.
> > 
> >     I think this is the only reasonable solution.
> > 
> > I agree with Miles--this is the only right way.
> > 
> > Owen, would you please implement this facility in the GTK scroll bar?
> I don't think there has been a satisfactory explanation of how you
> are going to deal with minimum size issues; which for some themes
> occur on quite moderately sized buffers. (As I said earlier, for
> Red Hat's default theme, the minimum scrollbar thumb size is
> ~30 pixels)

IIUC, the scrollbar widget has the following:

        minimum thumb size
        thumb size
        thumb position

Where minimum-thumb-size is (for all intents and purposes here) a constant.
Let's simplify things and subtract minimum thumb size from the current
thumb size and from the total, we get:

        thumb size
        thumb position

        0 <= thumb-size <= total-size
        thumb-size + thumb-position <= total-size

What we need is that when the mouse is moved such that
thumb-size+thumb-position would become larger than total-size,
[the scrollbar should behave as if] thumb-size is reduced to
total-size - thumb-position.

> I also am not convinced that the behavior is right from the point of
> view of a user; the ends of the scrollbar should be the ends
> of the scrollbar.

Total agreement ;-) : the user shouldn't be prevented from moving the
thumb-position to the end (i.e. to toal-size) just because the thumb-size
is currently non-zero.

> However, I was reminded this morning that a facility that allows
> you to implement your desired behavior was actually added prior
> to GTK+-2.2.
> If you connect to the "adjust_bounds" signal on GtkRange (the 
> base class for GtkScrollbar), this gives you the chance, when
> the user clicks the arrows or drags the thumb, to adjust
> the bounds and/or page size *before* GTK+ clamps the position.
> So, it should be pretty trivial to make the thumb shrink as the 
> user drags past the end position of the scrollbar.

That sounds like it might indeed do the trick.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]