diff --git a/basis/ui/gadgets/editors/editors.factor b/basis/ui/gadgets/editors/editors.factor index 6b54205306..d6dcf32f73 100755 --- a/basis/ui/gadgets/editors/editors.factor +++ b/basis/ui/gadgets/editors/editors.factor @@ -130,7 +130,7 @@ M: editor ungraft* [ first2 swap ] dip [ editor-line ] [ font>> ] bi swap offset>x round ; : loc>point ( loc editor -- loc ) - [ loc>x ] [ [ first ] dip line>y ] 2bi 2array ; + [ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ; : caret-loc ( editor -- loc ) [ editor-caret ] keep loc>point ; diff --git a/basis/ui/gadgets/labeled/labeled-docs.factor b/basis/ui/gadgets/labeled/labeled-docs.factor index c89392b836..c5b80a3cbb 100644 --- a/basis/ui/gadgets/labeled/labeled-docs.factor +++ b/basis/ui/gadgets/labeled/labeled-docs.factor @@ -9,12 +9,6 @@ HELP: { $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link } } } { $description "Creates a new " { $link labeled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ; -HELP: -{ $values { "model" model } { "quot" { $quotation "( value -- )" } } { "scrolls?" "a boolean" } { "title" string } { "gadget" "a new " { $link gadget } } } -{ $description "Creates a new control delegating to a " { $link pane } ", and wraps it in a " { $link labeled-gadget } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ; - -{ } related-words - ARTICLE: "ui.gadgets.labeled" "Labelled gadgets" "The " { $vocab-link "ui.gadgets.labeled" } " vocabulary implements labeled borders around child gadgets." { $subsection labeled-gadget } diff --git a/basis/ui/gadgets/labels/labels.factor b/basis/ui/gadgets/labels/labels.factor index 4619aecbf2..ae784b6983 100644 --- a/basis/ui/gadgets/labels/labels.factor +++ b/basis/ui/gadgets/labels/labels.factor @@ -85,6 +85,7 @@ M: f >label drop ; : label-on-left/right ( -- track ) horizontal + 0 >>fill +baseline+ >>align { 5 5 } >>gap ; inline PRIVATE> diff --git a/basis/ui/gadgets/line-support/line-support.factor b/basis/ui/gadgets/line-support/line-support.factor index cea36a57e7..0aacf9445a 100644 --- a/basis/ui/gadgets/line-support/line-support.factor +++ b/basis/ui/gadgets/line-support/line-support.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays combinators fry kernel math math.order +USING: accessors arrays combinators fry kernel math math.functions math.order math.ranges math.vectors namespaces opengl sequences ui.gadgets ui.render ui.text ; IN: ui.gadgets.line-support @@ -18,7 +18,7 @@ M: gadget line-height font>> font-metrics height>> ; : y>line ( y gadget -- n ) line-height /i ; -: line>y ( n gadget -- y ) line-height * ; +: line>y ( n gadget -- y ) line-height * >integer ; : validate-line ( m gadget -- n ) control-value [ drop f ] [ length 1- min 0 max ] if-empty ; @@ -48,6 +48,6 @@ GENERIC: draw-line ( line index gadget -- ) [ line-height ] [ ] } cleave '[ - 0 over _ * 2array + 0 over _ * >integer 2array [ _ draw-line ] with-translation ] each-slice-index ; \ No newline at end of file diff --git a/basis/ui/gadgets/menus/menus.factor b/basis/ui/gadgets/menus/menus.factor index d80992e751..9bfee85d65 100644 --- a/basis/ui/gadgets/menus/menus.factor +++ b/basis/ui/gadgets/menus/menus.factor @@ -3,7 +3,8 @@ USING: colors.constants kernel locals math.rectangles namespaces sequences ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.buttons ui.gadgets.glass ui.gadgets.packs -ui.gadgets.worlds ui.gestures ui.operations ; +ui.gadgets.worlds ui.gestures ui.operations ui.pens.solid +accessors ; IN: ui.gadgets.menus : show-menu ( owner menu -- ) diff --git a/basis/ui/gadgets/packs/packs.factor b/basis/ui/gadgets/packs/packs.factor index d997ae50ca..c588ed1b98 100644 --- a/basis/ui/gadgets/packs/packs.factor +++ b/basis/ui/gadgets/packs/packs.factor @@ -23,7 +23,7 @@ TUPLE: pack < gadget [ { 0 0 } ] dip '[ v+ _ v+ ] accumulate nip ; : numerically-aligned-locs ( sizes pack -- seq ) - [ align>> ] [ dim>> ] bi '[ [ _ _ ] dip v- n*v ] map ; + [ align>> ] [ dim>> ] bi '[ [ _ _ ] dip v- [ * >integer ] with map ] map ; : baseline-aligned-locs ( pack -- seq ) children>> baseline-align [ 0 swap 2array ] map ; @@ -39,7 +39,7 @@ TUPLE: pack < gadget : round-dims ( seq -- newseq ) [ { 0 0 } ] dip - [ swap v- dup [ ceiling >fixnum ] map [ swap v- ] keep ] map + [ swap v- dup [ ceiling ] map [ swap v- ] keep ] map nip ; PRIVATE> diff --git a/basis/ui/gadgets/panes/panes.factor b/basis/ui/gadgets/panes/panes.factor index 16addef044..3842b9959f 100644 --- a/basis/ui/gadgets/panes/panes.factor +++ b/basis/ui/gadgets/panes/panes.factor @@ -3,10 +3,10 @@ USING: arrays hashtables io kernel namespaces sequences io.styles strings quotations math opengl combinators memoize math.vectors sorting splitting assocs classes.tuple models continuations -destructors accessors math.rectangles fry fonts ui.images ui.gadgets -ui.gadgets.private ui.gadgets.borders ui.gadgets.buttons -ui.gadgets.labels ui.gadgets.scrollers ui.gadgets.paragraphs -ui.gadgets.incremental ui.gadgets.packs +destructors accessors math.rectangles fry fonts ui.pens.solid +ui.images ui.gadgets ui.gadgets.private ui.gadgets.borders +ui.gadgets.buttons ui.gadgets.labels ui.gadgets.scrollers +ui.gadgets.paragraphs ui.gadgets.incremental ui.gadgets.packs ui.gadgets.menus ui.clipboards ui.gestures ui.traverse ui.render ui.text ui.gadgets.presentations ui.gadgets.grids ui.gadgets.tracks ui.gadgets.icons ui.gadgets.grid-lines colors call ; diff --git a/basis/ui/render/render.factor b/basis/ui/render/render.factor index 699dfc3b5b..edeba07d12 100755 --- a/basis/ui/render/render.factor +++ b/basis/ui/render/render.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: math.rectangles math.vectors namespaces kernel accessors -combinators sequences opengl opengl.gl opengl.glu colors.constants -ui.gadgets ui.pens ; +combinators sequences opengl opengl.gl opengl.glu colors +colors.constants ui.gadgets ui.pens ; IN: ui.render SYMBOL: clip diff --git a/basis/ui/tools/browser/browser.factor b/basis/ui/tools/browser/browser.factor index 98d1bae569..5f134a930c 100644 --- a/basis/ui/tools/browser/browser.factor +++ b/basis/ui/tools/browser/browser.factor @@ -6,12 +6,12 @@ sequences models models.history tools.apropos ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.gadgets.buttons ui.gadgets.packs ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar -ui.tools.common ui ; +ui.gadgets.borders ui.tools.common ui ; IN: ui.tools.browser TUPLE: browser-gadget < tool pane scroller search-field ; -{ 550 400 } browser-gadget set-tool-dim +{ 650 400 } browser-gadget set-tool-dim : show-help ( link browser-gadget -- ) model>> dup add-history @@ -29,17 +29,19 @@ TUPLE: browser-gadget < tool pane scroller search-field ; 10 >>max-width ; : ( browser -- toolbar ) - + horizontal + 0 >>fill 1/2 >>align { 5 5 } >>gap - over add-gadget - swap search-field>> "Search:" label-on-left add-gadget ; + over f track-add + swap search-field>> "Search:" label-on-left 1 track-add ; : ( link -- gadget ) vertical browser-gadget new-track + 1 >>fill swap >link >>model dup >>search-field - dup f track-add + dup { 3 3 } { 1 0 } >>fill f track-add dup >>pane dup pane>> >>scroller dup scroller>> 1 track-add ;