Module Ui.ButtonSource
Buttons.
See the styling information.
Buttons
The type for buttons whose action occurs with type 'a.
val v :
?class':Jstr.t ->
?active:bool Note.signal ->
?enabled:bool Note.signal ->
?tip:Jstr.t Note.signal ->
Brr.El.t list Note.signal ->
'a ->
'a Note_brr_kit.Ui.Button.tv ~class' ~active ~enabled ~tip label action is a button with:
labelthe button's label.actionthe value reported when the button is actuated.tipa tooltip for the button.enabledindicates if the button can be interacted with. Defaults toS.Bool.true'.activeindicates that the button is being interacted with programmatically (e.g. via a shortcut)class'is added to the underlying element's classes
action b is an event that occurs when the button is actuated.
enabled b is a signal that is true iff the button is enabled.
active b is a signal that is true iff the button is being interacted with. FIXME. For now this doesn't change on mouse activation.
el b is b's DOM element.
Special buttons
val file_selector :
?class':Jstr.t ->
?active:bool Note.signal ->
?enabled:bool Note.signal ->
?tip:Jstr.t Note.signal ->
?exts:string list ->
Brr.El.t list Note.signal ->
Brr.File.t Note_brr_kit.Ui.Button.tfile_selector ~exts cs is a button which, whenever clicked, allows to select a file on the host's file system. exts is the caseless list of file extensions (including the dot) that can be selected; all file can be selected if this is the empty list (default).
The resulting element as an additional ui-file-selector class. See Styling.
val files_selector :
?class':Jstr.t ->
?active:bool Note.signal ->
?enabled:bool Note.signal ->
?tip:Jstr.t Note.signal ->
?exts:string list ->
Brr.El.t list Note.signal ->
Brr.File.t list Note_brr_kit.Ui.Button.tfiles_selector is like file_selector but allows multiple files to be selected.
Styling
The element returned by el makes use of the following CSS classes:
ui-buttonalways.ui-file-selectoralways iff created viafile_selectororfiles_selectorui-activewheneveractiveistrue.ui-disabledwheneverenabledisfalse.