From 63ea29972ad2ebe6c2b701c3ead56de3e42b73e9 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria <sam@Tintin.local> Date: Mon, 4 May 2009 18:41:31 -0500 Subject: [PATCH] frp initialization fixes --- extra/ui/frp/frp.factor | 11 +++++++---- extra/ui/gadgets/comboboxes/comboboxes.factor | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/extra/ui/frp/frp.factor b/extra/ui/frp/frp.factor index 699d034c72..76f746de71 100644 --- a/extra/ui/frp/frp.factor +++ b/extra/ui/frp/frp.factor @@ -1,7 +1,7 @@ -USING: accessors arrays colors fonts kernel models +USING: accessors arrays colors fonts kernel math models models.product monads sequences ui.gadgets ui.gadgets.buttons ui.gadgets.editors ui.gadgets.line-support ui.gadgets.tables -ui.gadgets.tracks ui.render ui.gadgets.scrollers ; +ui.gadgets.tracks ui.render ui.gadgets.scrollers ui.baseline-alignment ; QUALIFIED: make IN: ui.frp @@ -23,7 +23,7 @@ M: frp-table row-color color-quot>> [ call( a -- b ) ] [ drop f ] if* ; : <frp-list> ( model -- table ) <frp-table> [ 1array ] >>quot ; : <frp-list*> ( -- table ) f <model> <frp-list> ; -: <frp-field> ( -- field ) f <model> <model-field> ; +: <frp-field> ( -- field ) "" <model> <model-field> ; ! Layout utilities @@ -42,8 +42,11 @@ M: gadget -> dup make:, output-model ; M: model -> dup , ; M: table -> dup , selected-value>> ; + +! : <spacer> ( -- ) <gadget> ,( 100% 100% ) ; +! Add a % object as a possibility for pref-dim : <box> ( gadgets type -- track ) - [ { } make:make ] dip <track> swap [ f track-add ] each ; inline + [ { } make:make ] dip <track> +baseline+ >>align swap [ f track-add ] each ; inline : <box*> ( gadgets type -- track ) [ <box> ] [ [ model>> ] map <product> ] bi >>model ; inline : <hbox> ( gadgets -- track ) horizontal <box> ; inline : <hbox*> ( gadgets -- track ) horizontal <box*> ; inline diff --git a/extra/ui/gadgets/comboboxes/comboboxes.factor b/extra/ui/gadgets/comboboxes/comboboxes.factor index b0dbe34d16..a937b73d35 100644 --- a/extra/ui/gadgets/comboboxes/comboboxes.factor +++ b/extra/ui/gadgets/comboboxes/comboboxes.factor @@ -1,6 +1,6 @@ USING: accessors arrays kernel math.rectangles models sequences ui.frp ui.gadgets ui.gadgets.glass ui.gadgets.labels -ui.gadgets.tables ui.gestures ; +ui.gadgets.tables ui.gestures colors.constants fonts ; IN: ui.gadgets.comboboxes TUPLE: combo-table < table spawner ; @@ -19,4 +19,4 @@ combobox H{ : <combobox> ( options -- combobox ) [ first [ combobox new-label ] keep <model> >>model ] keep [ 1array ] map <model> trivial-renderer combo-table new-table - >>table ; \ No newline at end of file + >>table dup font>> COLOR: gray >>background 12 >>size >>font ; \ No newline at end of file