class Crysterm::Style

Overview

Class for the complete style of a widget.

Defined in:

namespace.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(*, border = nil, padding = nil, shadow = nil, scrollbar : Nil | Crysterm::Style = @scrollbar, track : Nil | Crysterm::Style = @track, bar : Nil | Crysterm::Style = @bar, item : Nil | Crysterm::Style = @item, header : Nil | Crysterm::Style = @header, cell : Nil | Crysterm::Style = @cell, label : Nil | Crysterm::Style = @label, fg : Nil | String = @fg, bg : Nil | String = @bg, bold : Bool = @bold, underline : Bool = @underline, blink : Bool = @blink, inverse : Bool = @inverse, visible : Bool = @visible, alpha = nil, char : Char = @char, pchar : Char = @pchar, fchar : Char = @fchar, bchar : Char = @bchar, ignore_border : Bool = @ignore_border) #

[View source]

Class Method Detail

def self.alpha_from(value : Float64 | Bool | Nil) #

[View source]

Instance Method Detail

def alpha : Float64 | Nil #

Alpha (inverse of transparency). Alpha 0 == full transparency, 1 == full opacity.


[View source]
def alpha=(alpha : Float64 | Nil) #

Alpha (inverse of transparency). Alpha 0 == full transparency, 1 == full opacity.


[View source]
def alpha? #

Is any transparency defined?

This function is needed because it is not possible to test just for alpha == nil. A value of 1.0 (full opacity) also effectively means that no transparency is enabled.


[View source]
def bar #

[View source]
def bar=(bar : Style | Nil) #

[View source]
def bchar : Char #

Background char (WIP)


[View source]
def bchar=(bchar : Char) #

Background char (WIP)


[View source]
def bg : String | Nil #

Background color (color of cell)


[View source]
def bg=(bg : String | Nil) #

Background color (color of cell)


[View source]
def blink=(blink : Bool) #

Blink?


[View source]
def blink? : Bool #

Blink?


[View source]
def bold=(bold : Bool) #

Bold?


[View source]
def bold? : Bool #

Bold?


[View source]
def border : Border | Nil #

[View source]
def border=(value) #

[View source]
def cell #

[View source]
def cell=(cell : Style | Nil) #

[View source]
def char : Char #

Generic char (WIP)


[View source]
def char=(char : Char) #

Generic char (WIP)


[View source]
def fchar : Char #

Foreground char (WIP)


[View source]
def fchar=(fchar : Char) #

Foreground char (WIP)


[View source]
def fg : String | Nil #

Foreground color (color of font/character)


[View source]
def fg=(fg : String | Nil) #

Foreground color (color of font/character)


[View source]
def fill=(fill : Bool) #

XXX Test/document this.


[View source]
def fill? : Bool #

XXX Test/document this.


[View source]
def header #

[View source]
def header=(header : Style | Nil) #

[View source]
def ignore_border=(ignore_border : Bool) #

Should something render inside/over the border? Currently used for Widget::Scrollbar only. XXX Rename, or make more general, or otherwise unify.


[View source]
def ignore_border? : Bool #

Should something render inside/over the border? Currently used for Widget::Scrollbar only. XXX Rename, or make more general, or otherwise unify.


[View source]
def inverse=(inverse : Bool) #

Inverse?


[View source]
def inverse? : Bool #

Inverse?


[View source]
def item #

[View source]
def item=(item : Style | Nil) #

[View source]
def label : Style #

Label value is used only when internally instantiating labels on widgets, to be able to set their: style: self.style.label. Since labels are widgets, everything after that is done by looking up @_label.style.....


[View source]
def label=(label : Style) #

Label value is used only when internally instantiating labels on widgets, to be able to set their: style: self.style.label. Since labels are widgets, everything after that is done by looking up @_label.style.....


[View source]
def padding : Crysterm::Padding #

[View source]
def padding=(value) #

[View source]
def pchar : Char #

Percent char (WIP)


[View source]
def pchar=(pchar : Char) #

Percent char (WIP)


[View source]
def scrollbar #

[View source]
def scrollbar=(scrollbar : Style | Nil) #

[View source]
def shadow : Crysterm::Shadow #

Should element drop shadow?


[View source]
def shadow=(value) #

Should element drop shadow?


[View source]
def tab_char : String #

Character to replace TABs with, multiplied by tab_size


[View source]
def tab_char=(tab_char : String) #

Character to replace TABs with, multiplied by tab_size


[View source]
def tab_size : Int32 #

Length in number of characters to replace TABs with


[View source]
def tab_size=(tab_size : Int32) #

Length in number of characters to replace TABs with


[View source]
def track #

[View source]
def track=(track : Style | Nil) #

[View source]
def underline=(underline : Bool) #

Unedline?


[View source]
def underline? : Bool #

Unedline?


[View source]
def visible=(visible : Bool) #

Visible?


[View source]
def visible? : Bool #

Visible?


[View source]