Made scrollers disappear when disabled

locals-and-roots
nicolas-p 2016-04-23 10:47:52 +02:00 committed by John Benediktsson
parent 365c8d08d2
commit e8c60ca890
2 changed files with 11 additions and 9 deletions

View File

@ -3,8 +3,8 @@
USING: accessors arrays combinators combinators.short-circuit
kernel math.rectangles math.vectors models models.product
models.range namespaces sequences ui.gadgets ui.gadgets.frames
ui.gadgets.grids ui.gadgets.sliders ui.gadgets.viewports
ui.gestures ;
ui.gadgets.grids ui.gadgets.private ui.gadgets.sliders
ui.gadgets.viewports ui.gestures ;
IN: ui.gadgets.scrollers
TUPLE: scroller < frame column-header viewport x y follows ;
@ -96,10 +96,12 @@ M: rect update-scroller swap (scroll>rect) ;
M: f update-scroller drop (update-scroller) ;
M: scroller layout*
[ call-next-method ] [
dup follows>>
[ update-scroller ] [ >>follows drop ] 2bi
] bi ;
{
[ call-next-method ]
[ dup follows>> [ update-scroller ] [ >>follows drop ] 2bi ]
[ [ x>> ] [ y>> ] bi [ forget-pref-dim ] bi@ ]
[ call-next-method ]
} cleave ;
M: scroller focusable-child*
viewport>> ;

View File

@ -224,8 +224,9 @@ M: slider-pen pen-pref-dim
enabled>> pen-pref-dim ;
M: slider pref-dim*
[ dup interior>> pen-pref-dim ] [ drop { 100 100 } ] [ orientation>> ] tri
set-axis ;
[ slider-enabled? [ { 14 14 } ] [ { 0 0 } ] if ]
[ drop { 100 100 } ]
[ orientation>> ] tri set-axis ;
PRIVATE>
@ -234,7 +235,6 @@ PRIVATE>
swap >>model
16 >>line
dup orientation>> {
[ <slider-pen> >>interior ]
[ <thumb> >>thumb ]
[ <elevator> >>elevator ]
[ drop dup add-thumb-to-elevator 1 track-add ]