diff --git a/extra/ui/gadgets/sliders/sliders.factor b/extra/ui/gadgets/sliders/sliders.factor index 641883e7e1..7904a9ab66 100755 --- a/extra/ui/gadgets/sliders/sliders.factor +++ b/extra/ui/gadgets/sliders/sliders.factor @@ -138,10 +138,11 @@ M: elevator layout* [ swap find-slider slide-by-line ] curry [ set-gadget-orientation ] keep ; -: elevator, ( orientation -- ) - dup g-> set-slider-elevator - swap g-> set-slider-thumb add-gadget - @center frame, ; +: elevator, ( gadget orientation -- gadget ) + tuck >>elevator + swap >>thumb + dup elevator>> over thumb>> add-gadget + @center grid-add* ; : ( -- button ) { 0 1 } arrow-left -1 ; @@ -149,26 +150,12 @@ M: elevator layout* : ( -- button ) { 0 1 } arrow-right 1 ; -: build-x-slider ( slider -- slider ) - [ - @left frame, - { 0 1 } elevator, - @right frame, - ] make-gadget ; inline - : ( -- button ) { 1 0 } arrow-up -1 ; : ( -- button ) { 1 0 } arrow-down 1 ; -: build-y-slider ( slider -- slider ) - [ - @top frame, - { 1 0 } elevator, - @bottom frame, - ] make-gadget ; inline - : ( range orientation -- slider ) slider new-frame swap >>orientation @@ -176,10 +163,16 @@ M: elevator layout* 32 >>line ; : ( range -- slider ) - { 1 0 } build-x-slider ; + { 1 0 } + @left grid-add* + { 0 1 } elevator, + @right grid-add* ; : ( range -- slider ) - { 0 1 } build-y-slider ; + { 0 1 } + @top grid-add* + { 1 0 } elevator, + @bottom grid-add* ; M: slider pref-dim* dup call-next-method