Lysa UI  0.0
Lysa UI —UI components for the Lysa Engine
StyleMaterial Class Reference

Detailed Description

Material Design inspired vector style.

+ Inheritance diagram for StyleMaterial:

Public Member Functions

 ~StyleMaterial () override = default
 
std::string containerResource () const override
 Resource string of a sunken container (list boxes, tree views, text areas) More...
 
std::string separatorResource () const override
 Resource string of a menu separator. More...
 
std::string scrollBarResource () const override
 Resource string of a scroll bar. More...
 
std::string gripResource () const override
 Resource string of the grip of a scroll bar or of the cursor of a slider. More...
 
std::string checkMarkResource () const override
 Resource string of the mark of a check box. More...
 
std::string listBoxResource () const override
 Resource string of a list box. More...
 
- Public Member Functions inherited from StyleBase
 ~StyleBase () override = default
 
void draw (const Widget &widget, UIResource &resources, Vector2DRenderer &renderer, bool before) const override
 
void addResource (Widget &widget, const std::string &resources) override
 
void resize (Widget &widget, Rect &rect, UIResource &resources) override
 
virtual std::string treeIndentResource () const
 Resource string of one tree view indentation level. More...
 
virtual std::string selectionResource () const
 Resource string of a selection rectangle. More...
 
virtual std::string highlightResource () const
 Resource string of a pointed item rectangle. More...
 
virtual std::string buttonResource () const
 Resource string of a push button. More...
 
virtual std::string sortArrowResource () const
 Resource string of a table sort direction indicator. More...
 
- Public Member Functions inherited from Style
virtual ~Style () = default
 
virtual void setOption (const std::string &name, const std::string &value)
 
std::string getOption (const std::string &name) const
 
const float4 & getTextColor () const
 

Static Public Attributes

static constexpr float DEFAULT_CORNER_RADIUS {8.0f}
 Default corner radius of the containers. More...
 
static constexpr float DEFAULT_SMALL_CORNER_RADIUS {2.0f}
 Default corner radius of the small widgets (check boxes, marks, indicators) More...
 
static constexpr float OUTLINE_WIDTH {1.0f}
 Width of the outlines. More...
 
static constexpr float THICK_OUTLINE_WIDTH {2.0f}
 Width of the outline of the selected/checked widgets. More...
 
static constexpr float HOVER_OPACITY {0.08f}
 Opacity of the state layer of a pointed widget. More...
 
static constexpr float PRESSED_OPACITY {0.12f}
 Opacity of the state layer of a pushed widget. More...
 
static constexpr float DISABLED_OPACITY {0.38f}
 Opacity of a disabled widget. More...
 
static constexpr float TAB_INDICATOR_HEIGHT {3.0f}
 Height of the indicator of the selected tab. More...
 
- Static Public Attributes inherited from Style
static constexpr float DEFAULT_SCROLL_BAR_SIZE {18.0f}
 Default size of the scroll bars. More...
 
static constexpr float DEFAULT_RADIO_BUTTON_SIZE {16.0f}
 Default size of the radio buttons. More...
 
static constexpr float DEFAULT_CHECK_BOX_SIZE {16.0f}
 Default size of the check boxes. More...
 
static constexpr float DEFAULT_TREE_INDENT_SIZE {12.0f}
 Default width of a tree view indentation level. More...
 
static constexpr float DEFAULT_SORT_ARROW_SIZE {8.0f}
 Default width of a table sort direction indicator. More...
 
static constexpr float DEFAULT_KNOB_SIZE {48.0f}
 Default size of the knobs. More...
 

Protected Member Functions

void updateColorOptions () override
 
void updateOptions () override
 
float4 markColor (const Widget &, const StyleResource &) const override
 
float4 iconColor (const Icon &, const StyleResource &) const override
 
float4 disabledTextColor () const override
 
void drawPanel (const Panel &, StyleResource &, Vector2DRenderer &) const override
 
void drawBox (const Widget &, const StyleResource &, Vector2DRenderer &, bool pushable) const override
 
void drawLine (const Line &, const StyleResource &, Vector2DRenderer &) const override
 
void drawButton (const Button &, StyleResource &, Vector2DRenderer &) const override
 
void drawToggleButton (ToggleButton &, StyleResource &, Vector2DRenderer &) const override
 
void drawRadioButton (const RadioButton &, const StyleResource &, Vector2DRenderer &) const override
 
void drawCheckBox (const CheckBox &, StyleResource &, Vector2DRenderer &) const override
 
void drawFrame (Frame &, StyleResource &, Vector2DRenderer &) const override
 
void drawProgressBar (const ProgressBar &, const StyleResource &, Vector2DRenderer &) const override
 
void drawTabBar (const TabBar &, const StyleResource &, Vector2DRenderer &) const override
 
void drawKnob (const Knob &, const StyleResource &, Vector2DRenderer &) const override
 
void drawSelection (const Selection &, const StyleResource &, Vector2DRenderer &) const override
 
void drawTextEdit (const TextEdit &, Vector2DRenderer &) const override
 
- Protected Member Functions inherited from StyleBase
virtual float borderSize () const
 
virtual float frameBorderSize () const
 
void drawTextEditSelection (const TextEdit &, Vector2DRenderer &) const
 
void drawText (const Text &, const StyleResource &, Vector2DRenderer &) const
 
void drawRichTextArea (const RichTextArea &, Vector2DRenderer &) const
 
void drawIconImage (const IconImage &, const StyleResource &, Vector2DRenderer &) const
 
void drawIconSVG (const IconSVG &, const StyleResource &, Vector2DRenderer &) const
 
void drawTreeView (const TreeView &, const StyleResource &, Vector2DRenderer &) const
 
void drawGridLines (const Grid &, Vector2DRenderer &) const
 
void drawColorSlider (const ColorSlider &, const StyleResource &, Vector2DRenderer &) const
 
void drawColorWheel (const ColorWheel &, const StyleResource &, Vector2DRenderer &) const
 
void drawMark (const Widget &, const StyleResource &, Vector2DRenderer &, std::span< const MarkSegment > segments) const
 
void drawMarkIn (const Widget &, const StyleResource &, Vector2DRenderer &, std::span< const MarkSegment > segments, const Rect &area) const
 
void drawArrow (const Arrow &, const StyleResource &, Vector2DRenderer &) const
 
void drawFilledArrow (const Arrow &, const StyleResource &, Vector2DRenderer &, const Rect &area) const
 
void drawProgressBarText (const ProgressBar &, Vector2DRenderer &, const float4 &color) const
 
- Protected Member Functions inherited from Style
virtual void init ()
 
void updateSizeOptions ()
 
float4 extractColor (const std::string &option, float r, float g, float b, float a=1.0f) const
 
float4 extractColor (const std::string &option, const float4 &defaultColor) const
 
float extractSize (const std::string &option, float defaultSize) const
 

Protected Attributes

float4 primary {}
 
float4 onPrimary {}
 
float4 surface {}
 
float4 surfaceContainer {}
 
float4 outline {}
 
float4 outlineVariant {}
 
float cornerRadius {DEFAULT_CORNER_RADIUS}
 
float smallCornerRadius {DEFAULT_SMALL_CORNER_RADIUS}
 
- Protected Attributes inherited from Style
float4 focus {}
 
float4 selected {}
 
float4 highlight {}
 
float4 cursor {}
 
float4 shadowDark {}
 
float4 shadowBright {}
 
float4 fgUp {}
 
float4 fgDown {}
 
float4 button {}
 
float4 treeLines {}
 
float4 gridLines {}
 
float4 textColor {1.0f, 1.0f, 1.0f, 1.0f}
 
float scrollBarSize {DEFAULT_SCROLL_BAR_SIZE}
 
float radioButtonSize {DEFAULT_RADIO_BUTTON_SIZE}
 
float checkBoxSize {DEFAULT_CHECK_BOX_SIZE}
 
float treeIndentSize {DEFAULT_TREE_INDENT_SIZE}
 
float sortArrowSize {DEFAULT_SORT_ARROW_SIZE}
 
float knobSize {DEFAULT_KNOB_SIZE}
 

Additional Inherited Members

- Static Public Member Functions inherited from Style
static std::shared_ptr< Style > create (const std::string &name="3D")
 
- Static Protected Member Functions inherited from StyleBase
static Rect progressBarTrack (const ProgressBar &)
 
static float progressBarRatio (const ProgressBar &)
 
static void drawClippedLine (const float2 &start, const float2 &end, const Rect &clip, Vector2DRenderer &)
 
static float4 fade (const float4 &color, const Widget &widget)
 
- Static Protected Member Functions inherited from Style
static float squareWidth (const Widget &widget, float size)
 
- Static Protected Attributes inherited from StyleBase
static constexpr float DEFAULT_BORDER {2.0f}
 
static constexpr float DEFAULT_FRAME_BORDER {4.0f}
 

Constructor & Destructor Documentation

~StyleMaterial ( )
overridedefault

Member Function Documentation

std::string checkMarkResource ( ) const
overridevirtual

Resource string of the mark of a check box.

Reimplemented from lysa::ui::StyleBase::checkMarkResource()

std::string containerResource ( ) const
overridevirtual

Resource string of a sunken container (list boxes, tree views, text areas)

Reimplemented from lysa::ui::StyleBase::containerResource()

float4 disabledTextColor ( ) const
overrideprotectedvirtual
void drawBox ( const Widget ,
const StyleResource ,
Vector2DRenderer &  ,
bool  pushable 
) const
overrideprotectedvirtual
void drawButton ( const Button ,
StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawCheckBox ( const CheckBox ,
StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawFrame ( Frame ,
StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawKnob ( const Knob ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawLine ( const Line ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawPanel ( const Panel ,
StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawProgressBar ( const ProgressBar ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawRadioButton ( const RadioButton ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawSelection ( const Selection ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawTabBar ( const TabBar ,
const StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawTextEdit ( const TextEdit ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
void drawToggleButton ( ToggleButton ,
StyleResource ,
Vector2DRenderer &   
) const
overrideprotectedvirtual
std::string gripResource ( ) const
overridevirtual

Resource string of the grip of a scroll bar or of the cursor of a slider.

Reimplemented from lysa::ui::StyleBase::gripResource()

float4 iconColor ( const Icon ,
const StyleResource  
) const
overrideprotectedvirtual
std::string listBoxResource ( ) const
overridevirtual

Resource string of a list box.

Reimplemented from lysa::ui::StyleBase::listBoxResource()

float4 markColor ( const Widget ,
const StyleResource  
) const
overrideprotectedvirtual
std::string scrollBarResource ( ) const
overridevirtual

Resource string of a scroll bar.

Reimplemented from lysa::ui::StyleBase::scrollBarResource()

std::string separatorResource ( ) const
overridevirtual

Resource string of a menu separator.

Reimplemented from lysa::ui::StyleBase::separatorResource()

void updateColorOptions ( )
overrideprotectedvirtual
void updateOptions ( )
overrideprotectedvirtual

Member Data Documentation

float cornerRadius {DEFAULT_CORNER_RADIUS}
protected
constexpr float DEFAULT_CORNER_RADIUS {8.0f}
staticconstexpr

Default corner radius of the containers.

constexpr float DEFAULT_SMALL_CORNER_RADIUS {2.0f}
staticconstexpr

Default corner radius of the small widgets (check boxes, marks, indicators)

constexpr float DISABLED_OPACITY {0.38f}
staticconstexpr

Opacity of a disabled widget.

constexpr float HOVER_OPACITY {0.08f}
staticconstexpr

Opacity of the state layer of a pointed widget.

float4 onPrimary {}
protected
float4 outline {}
protected
constexpr float OUTLINE_WIDTH {1.0f}
staticconstexpr

Width of the outlines.

float4 outlineVariant {}
protected
constexpr float PRESSED_OPACITY {0.12f}
staticconstexpr

Opacity of the state layer of a pushed widget.

float4 primary {}
protected
float smallCornerRadius {DEFAULT_SMALL_CORNER_RADIUS}
protected
float4 surface {}
protected
float4 surfaceContainer {}
protected
constexpr float TAB_INDICATOR_HEIGHT {3.0f}
staticconstexpr

Height of the indicator of the selected tab.

constexpr float THICK_OUTLINE_WIDTH {2.0f}
staticconstexpr

Width of the outline of the selected/checked widgets.