Skip to main content

StyleData

Trait StyleData 

Source
pub trait StyleData {
    // Provided methods
    fn grid_metrics(&self, _ui: &Ui) -> (i32, i32, i32) { ... }
    fn grid_header_bg(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn grid_header(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn grid_row(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn tree_twisty(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn badge_size(&self, ui: &mut Ui, sp: &mut Sp<'_>) -> (i32, i32) { ... }
    fn badge(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn status_dot(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn meter(&self, ui: &mut Ui, sp: &Sp<'_>) { ... }
    fn chart_palette(&self, ui: &Ui) -> [u32; 8] { ... }
}
Expand description

data views: grid header / rows, tree rows, badges, status dots, meters, charts (data.rs, chart.rs). Every method has a token-based default (stock.rs); a style overrides what it wants to look different.

Provided Methods§

Source

fn grid_metrics(&self, _ui: &Ui) -> (i32, i32, i32)

(header strip height, row height, cell padding) in DIP

Source

fn grid_header_bg(&self, ui: &mut Ui, sp: &Sp<'_>)

the header strip behind the header cells (rect = the strip)

Source

fn grid_header(&self, ui: &mut Ui, sp: &Sp<'_>)

header cell: label, ev, flags GH_*; s[0] = the label inset (px)

Source

fn grid_row(&self, ui: &mut Ui, sp: &Sp<'_>)

row background: ev, value 1 = selected, value2 = row index, flags GR_*

Source

fn tree_twisty(&self, ui: &mut Ui, sp: &Sp<'_>)

tree expander glyph: value 1 = expanded, ev

Source

fn badge_size(&self, ui: &mut Ui, sp: &mut Sp<'_>) -> (i32, i32)

badge: flags BADGE_*, label; size -> (w, h)

Source

fn badge(&self, ui: &mut Ui, sp: &Sp<'_>)

Source

fn status_dot(&self, ui: &mut Ui, sp: &Sp<'_>)

status dot: flags BADGE_*

Source

fn meter(&self, ui: &mut Ui, sp: &Sp<'_>)

meter (capacity bar): value, value2 maximum, flags BADGE_* of the fill

Source

fn chart_palette(&self, ui: &Ui) -> [u32; 8]

the categorical colours of charts (series 0 .. 7, 0xAARRGGBB)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§