class Opal::UI::Gauge

Overview

Progress gauge with percentage indicator and custom fill/empty glyphs.

Defined in:

opal/ui/components/gauge.cr

Constructors

Instance Method Summary

Instance methods inherited from class Opal::UI::Element

preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) preferred_size, render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil render

Constructor Detail

def self.new(ratio : Float64, label : String | Nil = nil, color : Color | Symbol | String | Nil = nil, filled_char : Char = '█', empty_char : Char = '░') #

[View source]

Instance Method Detail

def color : Color | Nil #

[View source]
def empty_char : Char #

[View source]
def filled_char : Char #

[View source]
def label : String | Nil #

[View source]
def preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) #

[View source]
def ratio : Float64 #

[View source]
def render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil #

[View source]
def resolved_color : Color #

Dynamic color based on percentage threshold if no explicit color was set


[View source]