         t >>root?
     thumb-theme ;
 
-: slide-by ( amount slider -- )
-    gadget-model move-by ;
+: slide-by ( amount slider -- ) gadget-model move-by ;
 
-: slide-by-page ( amount slider -- )
-    gadget-model move-by-page ;
+: slide-by-page ( amount slider -- ) gadget-model move-by-page ;
 
 : compute-direction ( elevator -- -1/1 )
     dup find-slider swap hand-click-rel


TUPLE: elevator < gadget direction ;

: find-elevator ( gadget -- elevator/f )
    [ elevator? ] find-parent ;

TUPLE: slider < frame elevator thumb saved line ;

: find-slider ( gadget -- slider/f )
    [ slider? ] find-parent ;

: elevator-length ( slider -- n )
    dup slider-elevator rect-dim
    swap gadget-orientation v. ;

: min-thumb-dim 15 ;

: slider-value ( gadget -- n ) gadget-model range-value >fixnum ;

: slider-page ( gadget -- n ) gadget-model range-page-value ;

: slider-max ( gadget -- n ) gadget-model range-max-value ;

: slider-max* ( gadget -- n ) gadget-model range-max-value* ;

: thumb-dim ( slider -- h )
    dup slider-page over slider-max 1 max / 1 min

    { T{ button-down } [ elevator-click ] }
} set-gestures

: <elevator> ( vector -- elevator )
  elevator new-gadget
    swap             >>orientation
    lowered-gradient >>interior ;

: (layout-thumb) ( slider n -- n thumb )
    over gadget-orientation n*v swap slider-thumb ;
