class
Eagle::Theme
- Eagle::Theme
- Reference
- Object
Overview
Colors, fonts and sizes shared by UI controls. Assign a theme to any control and every
control below it uses it. Theme.default is a dark theme, and #light gives a light variant.
theme = Theme.default.light
theme.accent = Color.hex("#c98a12")
theme.corner_radius = 0
theme.font = Font.load("res://fonts/Inter.ttf", 18)
menu = Panel.new
menu.theme = theme # everything inside the menu uses it
Defined in:
eagle/ui/theme.crConstructors
-
.default : Theme
The shared default theme.
Class Method Summary
-
.default=(t : Theme)
Replaces the default theme.
Instance Method Summary
-
#accent : Color
Highlight color for sliders, progress bars and checked boxes.
-
#accent=(accent : Color)
Highlight color for sliders, progress bars and checked boxes.
-
#accent_text : Color
Text drawn on top of the accent color.
-
#accent_text=(accent_text : Color)
Text drawn on top of the accent color.
-
#border_width : Float32
Border thickness.
-
#border_width=(border_width : Float32)
Border thickness.
-
#button : Color
Button background.
-
#button=(button : Color)
Button background.
-
#button_border : Color
Button border.
-
#button_border=(button_border : Color)
Button border.
-
#button_hover : Color
Button background under the mouse.
-
#button_hover=(button_hover : Color)
Button background under the mouse.
-
#button_pressed : Color
Button background while pressed.
-
#button_pressed=(button_pressed : Color)
Button background while pressed.
-
#control_height : Float32
Default height of buttons, fields and sliders.
-
#control_height=(control_height : Float32)
Default height of buttons, fields and sliders.
-
#corner_radius : Float32
Corner rounding for panels and buttons.
-
#corner_radius=(corner_radius : Float32)
Corner rounding for panels and buttons.
-
#focus : Color
Color of the focus ring.
-
#focus=(focus : Color)
Color of the focus ring.
-
#font : Font | Nil
Font for all controls.
-
#font=(font : Font | Nil)
Font for all controls.
-
#font_or_default : Font
The font in effect.
-
#font_scale : Float32
Text scale for all controls.
-
#font_scale=(font_scale : Float32)
Text scale for all controls.
-
#input_bg : Color
Text field background.
-
#input_bg=(input_bg : Color)
Text field background.
-
#light : Theme
A copy of this theme with light colors.
-
#padding : Float32
Default container padding.
-
#padding=(padding : Float32)
Default container padding.
-
#panel : Color
Panel background.
-
#panel=(panel : Color)
Panel background.
-
#panel_border : Color
Panel border.
-
#panel_border=(panel_border : Color)
Panel border.
-
#spacing : Float32
Default gap between children in containers.
-
#spacing=(spacing : Float32)
Default gap between children in containers.
-
#text : Color
Text color.
-
#text=(text : Color)
Text color.
-
#text_disabled : Color
Text color for disabled controls.
-
#text_disabled=(text_disabled : Color)
Text color for disabled controls.
-
#track : Color
Slider and progress bar track color.
-
#track=(track : Color)
Slider and progress bar track color.
Constructor Detail
The shared default theme. Change it to restyle every control that has no theme of its own.
Class Method Detail
Instance Method Detail
Corner rounding for panels and buttons. 0 gives square corners.