Module: ui.widgets.progress

Source: ./ui/widgets/progress.reef


Overview

ui/widgets/progress.reef - Progress bar display Part of reef-stdlib UI module

The Progress widget displays the progress of an operation. It shows a bar that fills based on a percentage value.

Progress bars support:

  • Determinate progress (0-100%)
  • Indeterminate progress (animated)
  • Horizontal and vertical orientations
  • Custom colors
  • Text labels showing percentage

Types

ProgressStyle (enum)

Variants:

  • Horizontal
  • Vertical
  • Circular

Objects

Progress

Extends: widget.Widget

Fields:

Name Type
value float
indeterminate bool
style ProgressStyle
show_label bool
custom_color core.Color
use_custom_color bool
track_color core.Color
use_custom_track bool
bar_height float

proc init(id: widget.WidgetId)

Methods:

override shared fn kind(): string

override exclusive proc paint(surf: surface.Surface, th: theme.Theme)


Functions

fn progress_style_horizontal(): ProgressStyle

fn progress_style_vertical(): ProgressStyle

fn progress_style_circular(): ProgressStyle

fn is_horizontal(s: ProgressStyle): bool

fn is_vertical(s: ProgressStyle): bool

fn is_circular(s: ProgressStyle): bool

fn progress(): Progress

fn progress_with_value(value: float): Progress

fn progress_indeterminate(): Progress

fn progress_value(p: Progress): float

fn progress_is_indeterminate(p: Progress): bool

fn progress_style(p: Progress): ProgressStyle

fn progress_show_label(p: Progress): bool

fn progress_set_value(p: Progress, value: float): Progress

fn progress_set_indeterminate(p: Progress, indeterminate: bool): Progress

fn progress_set_style(p: Progress, style: ProgressStyle): Progress

fn progress_set_show_label(p: Progress, show: bool): Progress

fn progress_set_color(p: Progress, color: core.Color): Progress

fn progress_set_track_color(p: Progress, color: core.Color): Progress

fn progress_get_id(p: Progress): widget.WidgetId

fn progress_get_state(p: Progress): widget.WidgetState

fn progress_get_bounds(p: Progress): core.Rect

fn progress_preferred_size(p: Progress, th: theme.Theme): core.Size

fn progress_layout(p: Progress, constraints: layout.Constraints, th: theme.Theme): Progress

fn progress_handle_event(p: Progress, e: event.Event): widget.EventResult

fn get_bar_color(p: Progress, colors: theme.ThemeColors): core.Color

fn get_track_color(p: Progress, colors: theme.ThemeColors): core.Color

fn sin_approx(x: float): float

Simple sine approximation (Taylor series, first 3 terms)

fn cos_approx(x: float): float

Simple cosine approximation


Procedures

proc progress_paint(p: Progress, surf: surface.Surface, th: theme.Theme)

proc paint_horizontal(p: Progress, surf: surface.Surface, bounds: core.Rect, bar_color: core.Color, track_color: core.Color, th: theme.Theme)

proc paint_vertical(p: Progress, surf: surface.Surface, bounds: core.Rect, bar_color: core.Color, track_color: core.Color)

proc paint_circular(p: Progress, surf: surface.Surface, bounds: core.Rect, bar_color: core.Color, track_color: core.Color)

proc draw_ring_segment(surf: surface.Surface, cx: float, cy: float, radius: float, width: float, color: core.Color, start: float, amount: float)


Generated by reefc doc