package mosaic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/mosaic.ui/Mosaic_ui/Progress_bar/index.html
Module Mosaic_ui.Progress_bar
Progress bar with sub-cell precision via Unicode half-blocks.
Progress bar with sub-cell precision fill rendering.
A progress bar maps a numeric value within a min, max range to a visual fill level along a horizontal or vertical track. The filled portion represents the current value relative to the range.
Rendering uses a double-resolution virtual coordinate system with Unicode half-block characters for sub-cell fill precision. Values are clamped to [min;max] before rendering. When min = max, the bar renders as fully filled.
The type for progress bar widgets backed by a Renderable.t.
Constructors
val create :
parent:Renderable.t ->
?index:int ->
?id:string ->
?style:Toffee.Style.t ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?value:float ->
?min:float ->
?max:float ->
?orientation:orientation ->
?filled_color:Ansi.Color.t ->
?empty_color:Ansi.Color.t ->
unit ->
tcreate ~parent () is a progress bar attached to parent with:
valueis the initial fill value. Defaults to0.0.minis the lower bound of the range. Defaults to0.0.maxis the upper bound of the range. Defaults to1.0.orientationis the track direction. Defaults to`Horizontal.filled_coloris the color of the filled portion. Defaults to medium gray.empty_coloris the color of the unfilled portion. Defaults to dark gray.
val node : t -> Renderable.tnode t is the underlying Renderable.t for t.
Props
module Props : sig ... endapply_props t props replaces all properties of t with props. Always triggers a re-render.
Value
val value : t -> floatvalue t is the current fill value of t.
val set_value : t -> float -> unitset_value t v sets the fill value of t to v. The value is stored as-is; clamping to [min t;max t] occurs at render time. Triggers a re-render if the value changed.
val min : t -> floatmin t is the lower bound of the range of t.
val set_min : t -> float -> unitset_min t v sets the lower bound of the range of t to v. Triggers a re-render if the bound changed.
val max : t -> floatmax t is the upper bound of the range of t.
val set_max : t -> float -> unitset_max t v sets the upper bound of the range of t to v. Triggers a re-render if the bound changed.
Appearance
val set_orientation : t -> orientation -> unitset_orientation t o sets the track direction of t to o. Triggers a re-render if the orientation changed.
val set_filled_color : t -> Ansi.Color.t -> unitset_filled_color t c sets the filled portion color of t to c. Triggers a re-render if the color changed.
val set_empty_color : t -> Ansi.Color.t -> unitset_empty_color t c sets the unfilled portion color of t to c. Triggers a re-render if the color changed.
Formatting
val pp : Format.formatter -> t -> unitpp formats a progress bar for debugging.