lecui 1.0.0-alpha.20
lecui C++ user interface library
Public Types | Public Member Functions | Protected Attributes | List of all members
liblec::lecui::widgets::badge_specs Class Reference

Badge specifications. More...

#include <widget.h>

Public Types

enum class  badge_position { top_left , top_right , bottom_left , bottom_right }
 Badge position within the widget. More...
 

Public Member Functions

bool operator== (const badge_specs &param)
 Check whether badge specs are equal. Only those properties that require the widget's basic resources to be re-created are considered. More...
 
bool operator!= (const badge_specs &param)
 Check whether badge specs are NOT equal. Only those properties that require the widget's basic resources to be re-created are considered. More...
 
std::string & text ()
 Get or set the badge text. More...
 
badge_specstext (const std::string &text)
 Set the badge text. More...
 
std::string & font ()
 Get or set the default badge font, e.g. "Georgia". More...
 
badge_specsfont (const std::string &font)
 Set the badge font. More...
 
float & font_size ()
 Get or set the badge's font size in points, e.g. 9.0f. More...
 
badge_specsfont_size (const float &font_size)
 Set the badge's font size. More...
 
float & border ()
 Get or set the thickness of the border. More...
 
badge_specsborder (const float &border)
 Set the thickness of the border. More...
 
lecui::colorcolor ()
 Get or set the color of the badge. More...
 
badge_specscolor (const lecui::color &color)
 Set the color of the badge. More...
 
lecui::colorcolor_border ()
 Get or set the color of the badge's border. More...
 
badge_specscolor_border (const lecui::color &color_border)
 Set the color of the badge's border. More...
 
lecui::colorcolor_text ()
 Get or set the color of the badge's text. More...
 
badge_specscolor_text (const lecui::color &color_text)
 Set the color of the badge's text. More...
 
badge_positionposition ()
 Get or set the badge's position. More...
 
badge_specsposition (const badge_position &position)
 Set the badge's position. More...
 

Protected Attributes

std::string _text
 The badge's text.
 
std::string _font = "Segoe UI"
 The font to use for the badge's text.
 
float _font_size = 8.f
 The font size of the badge's text.
 
float _border = .5f
 The thickness of the badge's border.
 
color _color = { 255, 0, 0, 180 }
 The fill color of the badge.
 
color _color_border = { 255, 255, 255, 180 }
 The color of the badge's border.
 
color _color_text = { 255, 255, 255, 255 }
 The color of the badge's text.
 
badge_position _position = badge_position::bottom_right
 The badge's position.
 

Detailed Description

Badge specifications.

Member Enumeration Documentation

◆ badge_position

Badge position within the widget.

Enumerator
top_left 

Badget on the top left of the widget.

top_right 

Badget on the top right of the widget.

bottom_left 

Badget on the bottom left of the widget.

bottom_right 

Badget on the bottom right of the widget.

Member Function Documentation

◆ border() [1/2]

float & liblec::lecui::widgets::badge_specs::border ( )

Get or set the thickness of the border.

Returns
A reference to the border thickness, in pixels.

◆ border() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::border ( const float &  border)

Set the thickness of the border.

Parameters
borderThe border thickness, in pixels.
Returns
A reference to the modified object.

◆ color() [1/2]

lecui::color & liblec::lecui::widgets::badge_specs::color ( )

Get or set the color of the badge.

Returns
A reference to the badge's color.

◆ color() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::color ( const lecui::color color)

Set the color of the badge.

Parameters
colorThe color of the badge, as defined in lecui::color.
Returns
A reference to the modified object.

◆ color_border() [1/2]

lecui::color & liblec::lecui::widgets::badge_specs::color_border ( )

Get or set the color of the badge's border.

Returns
A reference to the badge's border color.

◆ color_border() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::color_border ( const lecui::color color_border)

Set the color of the badge's border.

Parameters
color_borderThe color of the badge's border, as defined in lecui::color.
Returns
A reference to the modified object.

◆ color_text() [1/2]

lecui::color & liblec::lecui::widgets::badge_specs::color_text ( )

Get or set the color of the badge's text.

Returns
A reference to the badge's text color.

◆ color_text() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::color_text ( const lecui::color color_text)

Set the color of the badge's text.

Parameters
color_textThe color of the badge's text, as defined in lecui::color.
Returns
A reference to the modified object.

◆ font() [1/2]

std::string & liblec::lecui::widgets::badge_specs::font ( )

Get or set the default badge font, e.g. "Georgia".

Returns
A reference to the badge's font name.

◆ font() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::font ( const std::string &  font)

Set the badge font.

Parameters
fontThe name of the font, e.g. "Georgia".
Returns
A reference to the modified object.

◆ font_size() [1/2]

float & liblec::lecui::widgets::badge_specs::font_size ( )

Get or set the badge's font size in points, e.g. 9.0f.

Returns
A reference to the widget's font size.

◆ font_size() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::font_size ( const float &  font_size)

Set the badge's font size.

Parameters
font_sizeThe font size in points, e.g. 9.0f.
Returns
A reference to the modified object.

◆ operator!=()

bool liblec::lecui::widgets::badge_specs::operator!= ( const badge_specs param)

Check whether badge specs are NOT equal. Only those properties that require the widget's basic resources to be re-created are considered.

Parameters
paramThe specs to compare to.
Returns
Returns true when the badge specs are NOT equal, else false.

◆ operator==()

bool liblec::lecui::widgets::badge_specs::operator== ( const badge_specs param)

Check whether badge specs are equal. Only those properties that require the widget's basic resources to be re-created are considered.

Parameters
paramThe specs to compare to.
Returns
Returns true when the badge specs are equal, else false.

◆ position() [1/2]

badge_position & liblec::lecui::widgets::badge_specs::position ( )

Get or set the badge's position.

Returns
A reference to the badge's position.

◆ position() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::position ( const badge_position position)

Set the badge's position.

Parameters
positionThe position of the badge, as defined in badge_position
Returns
A reference to the modified object.

◆ text() [1/2]

std::string & liblec::lecui::widgets::badge_specs::text ( )

Get or set the badge text.

Returns
A reference to the badge text.

◆ text() [2/2]

badge_specs & liblec::lecui::widgets::badge_specs::text ( const std::string &  text)

Set the badge text.

Parameters
textThe badge text.
Returns
A reference to the modified object.

The documentation for this class was generated from the following file: