     [ dim>> ] [ thumb-dim ] [ orientation>> ] tri [ n*v ] keep set-axis
     [ ceiling ] map >>dim drop ;
 
+: slider-enabled? ( slider -- ? )
+    visible-portion 1 = not ;
+
 : layout-thumb ( slider -- )
     [ thumb>> ] keep
-    [ visible-portion 1 = not >>visible? drop ]
+    [ slider-enabled? >>visible? drop ]
     [ layout-thumb-loc ]
     [ layout-thumb-dim ]
     2tri ;


: <slide-button-pen> ( orientation left right -- pen )
    [ horizontal = ] 2dip ?
    [ f f ] [ theme-image <image-pen> f ] bi* <button-paint> ;

TUPLE: slide-button < repeat-button ;


    "vertical-scroller-downarrow-clicked"
    <slide-button> ;

TUPLE: slider-pen enabled disabled ;

: <slider-pen> ( orientation -- pen )
    {
        { horizontal [
            "horizontal-scroller-left" theme-image
            "horizontal-scroller-middle" theme-image
            "horizontal-scroller-right" theme-image
            "horizontal-scroller-right-disabled" theme-image
        ] }
        { vertical [
            "vertical-scroller-top" theme-image
            "vertical-scroller-middle" theme-image
            "vertical-scroller-bottom" theme-image
            "vertical-scroller-bottom-disabled" theme-image
        ] }
    } case
    [ <tile-pen> ] bi-curry@ 2bi \ slider-pen boa ;

: slider-pen ( slider pen -- pen )
    [ slider-enabled? ] [ [ enabled>> ] [ disabled>> ] bi ] bi* ? ;

M: slider-pen draw-interior
    dupd slider-pen draw-interior ;

M: slider-pen draw-boundary
    dupd slider-pen draw-boundary ;

M: slider-pen pen-pref-dim
    enabled>> pen-pref-dim ;

M: slider pref-dim*
    [ dup interior>> pen-pref-dim ] [ drop { 100 100 } ] [ orientation>> ] tri
