Revert incomplete changes
parent
a552625ee3
commit
0714bb7a86
|
@ -1,7 +1,6 @@
|
||||||
! Copyright (C) 2005, 2007 Slava Pestov.
|
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io kernel math namespaces math.vectors ui.gadgets
|
USING: io kernel math namespaces math.vectors ui.gadgets ;
|
||||||
dlists ;
|
|
||||||
IN: ui.gadgets.incremental
|
IN: ui.gadgets.incremental
|
||||||
|
|
||||||
! Incremental layout allows adding lines to panes to be O(1).
|
! Incremental layout allows adding lines to panes to be O(1).
|
||||||
|
@ -15,14 +14,12 @@ IN: ui.gadgets.incremental
|
||||||
! New gadgets are added at
|
! New gadgets are added at
|
||||||
! incremental-cursor gadget-orientation v*
|
! incremental-cursor gadget-orientation v*
|
||||||
|
|
||||||
TUPLE: incremental cursor queue ;
|
TUPLE: incremental cursor ;
|
||||||
|
|
||||||
: <incremental> ( pack -- incremental )
|
: <incremental> ( pack -- incremental )
|
||||||
dup pref-dim <dlist> {
|
dup pref-dim
|
||||||
set-gadget-delegate
|
{ set-gadget-delegate set-incremental-cursor }
|
||||||
set-incremental-cursor
|
incremental construct ;
|
||||||
set-incremental-queue
|
|
||||||
} incremental construct ;
|
|
||||||
|
|
||||||
M: incremental pref-dim*
|
M: incremental pref-dim*
|
||||||
dup gadget-layout-state [
|
dup gadget-layout-state [
|
||||||
|
@ -43,17 +40,17 @@ M: incremental pref-dim*
|
||||||
swap set-rect-loc ;
|
swap set-rect-loc ;
|
||||||
|
|
||||||
: prefer-incremental ( gadget -- )
|
: prefer-incremental ( gadget -- )
|
||||||
dup forget-pref-dim dup pref-dim swap set-rect-dim ;
|
dup forget-pref-dim dup pref-dim over set-rect-dim
|
||||||
|
layout ;
|
||||||
|
|
||||||
: add-incremental ( gadget incremental -- )
|
: add-incremental ( gadget incremental -- )
|
||||||
not-in-layout
|
not-in-layout
|
||||||
2dup incremental-queue push-front
|
2dup (add-gadget)
|
||||||
add-gadget ;
|
over prefer-incremental
|
||||||
|
|
||||||
: (add-incremental) ( gadget incremental -- )
|
|
||||||
2dup incremental-loc
|
2dup incremental-loc
|
||||||
tuck update-cursor
|
tuck update-cursor
|
||||||
prefer-incremental ;
|
dup prefer-incremental
|
||||||
|
gadget-parent [ invalidate* ] when* ;
|
||||||
|
|
||||||
: clear-incremental ( incremental -- )
|
: clear-incremental ( incremental -- )
|
||||||
not-in-layout
|
not-in-layout
|
||||||
|
|
Loading…
Reference in New Issue