GtkRange rewrite



Hi,

I finally got annoyed enough to put GtkRange out of its misery. This
cuts the code size of range/scale/scrollbar as a group by 1/3 or so, 
and makes the code reasonably understandable. Well, I understand it
now anyway. It should also save space at runtime since there aren't
all those extra GdkWindows floating around.

The patch adds the double scroll stepper arrows for all the NeXT fans
out there. No style property for it yet, trivial to add though. I'm
stuck on the fact that my best names for the properties are
"has_stepper_a", "has_stepper_b", "has_stepper_c", "has_stepper_d" and
figure someone has a better idea.

It's also trivial to add a slider_size_fixed style property to
scrollbar, I think some systems have fixed-sized sliders? Well, if not
now GTK can have that...

GtkScale::digits and GtkRange::update_policy are broken at the moment,
but otherwise I think it's working fine. I could use some docs on what
the update policies are supposed to do, should be trivial to
implement. For digits, I'm just building up the nerve to type in the
sprintf/scanf hack from the old range code. ;-)

Oh, GtkScale focus drawing seems really lame both in CVS and in my
patch, though differently lame. Basically it's invisible in the CVS
version and looks ugly in mine. So we should fix that.

ChangeLog appended, patch at http://pobox.com/~hp/rangerewrite.patch, 
since it's 180K or so.

Havoc

2001-05-20  Havoc Pennington  <hp pobox com>

        * gtk/gtkstyle.c (gtk_default_draw_slider): was not properly
          using
        its x/y arguments

        * gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
        gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
        gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
        gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
        gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and
        subclasses.

        Notable changes in the process:
         
        - stepper_size style property is the height for vertical 
          ranges, width for horizontal; the other dimension matches
          the trough size
        - add ability to do NeXT-style steppers (and several other
          styles
          that don't make any sense)
        - added min_slider_length property to GtkScrollbar
        - cleaned some private (or at least useless) functions out of
          gtkscale.h
        - moved bindings to GtkScale from subclasses, even arrow keys,
          since blind users don't know scale orientation.
        








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