class

Egui::WidgetStyle

Inherits Reference < Object

Per-widget style overrides. All fields are nilable; nil means "take the value from the app theme". #merge_over applies the non-nil fields onto a copy of the theme's Style:

ui.add(Egui::Button.new("OK").style do |s| s.background = Egui::Color32.rgb(180, 40, 40) s.text_color = Egui::Color32.rgb(255, 255, 255) end)

An overridden widget keeps its overrides when the theme is swapped; every field left nil follows the new theme automatically.

Constructors

Instance methods

background

The box fill of button-like widgets — ONE CSS-like key. It is flat across states (inline-style semantics); per-state values live in class rules (button:hover { … }), resolved by Widget#background_color, not by a Style slot.

Source
background=(background : Color32 | Nil)

The box fill of button-like widgets — ONE CSS-like key. It is flat across states (inline-style semantics); per-state values live in class rules (button:hover { … }), resolved by Widget#background_color, not by a Style slot.

Source
button_padding
Source
button_padding=(button_padding : Vec2 | Nil)
Source
font_family

Named font family override (see Style#font_family); nil keeps the theme's family.

Source
font_family=(font_family : String | Nil)

Named font family override (see Style#font_family); nil keeps the theme's family.

Source
font_size
Source
font_size=(font_size : Float64 | Nil)
Source
merge_over(base : Style) : Style

Effective style = the theme's Style with every non-nil override applied. Returns a copy; the theme is never mutated.

Source
selection_fill

Accent: progress bar fill, slider handle, selection.

Source
selection_fill=(selection_fill : Color32 | Nil)

Accent: progress bar fill, slider handle, selection.

Source
separator_color
Source
separator_color=(separator_color : Color32 | Nil)
Source
stroke
Source
stroke=(stroke : Color32 | Nil)
Source
text_color
Source
text_color=(text_color : Color32 | Nil)
Source