New toolbar dictionary
parent
eb21e05fef
commit
c75f6155cf
|
@ -121,9 +121,8 @@ PRIVATE>
|
||||||
[ append theme-image ] tri-curry@ tri
|
[ append theme-image ] tri-curry@ tri
|
||||||
] 2dip <tile-pen> ;
|
] 2dip <tile-pen> ;
|
||||||
|
|
||||||
CONSTANT: button-background COLOR: grey95
|
CONSTANT: button-background COLOR: FactorLightTan
|
||||||
CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
|
CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
|
||||||
CONSTANT: toolbar-border COLOR: grey75
|
|
||||||
|
|
||||||
: <border-button-pen> ( -- pen )
|
: <border-button-pen> ( -- pen )
|
||||||
"button" button-background button-clicked-background
|
"button" button-background button-clicked-background
|
||||||
|
@ -243,18 +242,3 @@ PRIVATE>
|
||||||
target command command-button-quot
|
target command command-button-quot
|
||||||
'[ drop @ ] <border-button>
|
'[ drop @ ] <border-button>
|
||||||
gesture gesture>tooltip >>tooltip ; inline
|
gesture gesture>tooltip >>tooltip ; inline
|
||||||
|
|
||||||
: <toolbar> ( target -- toolbar )
|
|
||||||
<shelf>
|
|
||||||
1 >>fill
|
|
||||||
{ 5 5 } >>gap
|
|
||||||
swap
|
|
||||||
[ [ "toolbar" ] dip class-of get-command-at commands>> ]
|
|
||||||
[ '[ [ _ ] 2dip <command-button> add-gadget ] ]
|
|
||||||
bi assoc-each ;
|
|
||||||
|
|
||||||
: add-toolbar ( track -- track )
|
|
||||||
dup <toolbar> { 3 3 } <border>
|
|
||||||
button-background <solid> >>interior
|
|
||||||
toolbar-border <solid-underlined> >>boundary
|
|
||||||
align-left f track-add ;
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
! Copyright (C) 2015 Nicolas Pénet.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: accessors assocs classes colors.constants fry kernel
|
||||||
|
ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.buttons
|
||||||
|
ui.gadgets.buttons.private ui.gadgets.packs ui.gadgets.tracks
|
||||||
|
ui.pens.solid ;
|
||||||
|
IN: ui.gadgets.toolbar
|
||||||
|
|
||||||
|
CONSTANT: toolbar-background COLOR: grey95
|
||||||
|
|
||||||
|
: <toolbar> ( target -- toolbar )
|
||||||
|
<shelf>
|
||||||
|
1 >>fill
|
||||||
|
{ 5 5 } >>gap
|
||||||
|
swap
|
||||||
|
[ [ "toolbar" ] dip class-of get-command-at commands>> ]
|
||||||
|
[ '[ [ _ ] 2dip <command-button> add-gadget ] ]
|
||||||
|
bi assoc-each ;
|
||||||
|
|
||||||
|
: add-toolbar ( track -- track )
|
||||||
|
dup <toolbar> { 3 3 } <border>
|
||||||
|
toolbar-background <solid> >>interior
|
||||||
|
align-left f track-add ;
|
Loading…
Reference in New Issue