etui/widgets/hbar
Types
pub type HBar {
HBar(
items: List(HBarItem),
max_val: Int,
fill: HBarFill,
label_width: Int,
show_value: Bool,
bar_char: String,
empty_char: String,
bg: style.Color,
period: Int,
)
}
Constructors
-
HBar( items: List(HBarItem), max_val: Int, fill: HBarFill, label_width: Int, show_value: Bool, bar_char: String, empty_char: String, bg: style.Color, period: Int, )Arguments
- max_val
-
0 = auto-compute max from data.
- label_width
-
Width reserved for labels. 0 = auto (longest label).
- show_value
-
Whether to append the numeric value after the bar.
pub type HBarFill {
HBarSolid(colors: List(style.Color))
HBarGradient(stops: List(style.Color))
HBarRainbow
HBarAnimatedRainbow
}
Constructors
-
HBarSolid(colors: List(style.Color))Cycle through a list of solid colors, one per bar.
-
HBarGradient(stops: List(style.Color))Static left-to-right gradient applied to each bar’s filled cells.
-
HBarRainbowEach bar gets a different hue; static rainbow.
-
HBarAnimatedRainbowRainbow that rotates hue over time.
Values
pub fn render(
buf: buffer.Buffer,
area: geometry.Rect,
h: HBar,
frame: Int,
) -> buffer.Buffer
pub fn with_bg(h: HBar, bg: style.Color) -> HBar
pub fn with_style(h: HBar, s: style.Style) -> HBar