Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Signals | Public Member Functions | Static Private Member Functions | Private Attributes
Comments::ColorPicker Class Reference

The ColorPicker class provides a button which shows a grid of colors when clicked. More...

Inheritance diagram for Comments::ColorPicker:

Public Types

enum  ColorPickerType { background , shape , text }
 

Signals

void colorChanged (QString color)
 

Public Member Functions

void handleColorPicked (QString aColor)
 
void setColorPickerType (enum ColorPickerType type)
 This sets the type of the colorpicker to type. More...
 
void setColors (QVector< QColor > colors, int colorsPerRow, std::function< QString(QColor)> nameForColor={})
 
void setEnvisionTextColors ()
 For text Envision uses some predefined colors. More...
 
void setselectedColor (QString colorName)
 

Static Private Member Functions

static QList< QPair< QColor, QString > > & envisionTextColorsMap ()
 

Private Attributes

ColorPickerType type_ {}
 

Detailed Description

The ColorPicker class provides a button which shows a grid of colors when clicked.

This colors are also clickable and can be used to select the desired color.

Member Enumeration Documentation

◆ ColorPickerType

Enumerator
background 
shape 
text 

Member Function Documentation

◆ colorChanged

void Comments::ColorPicker::colorChanged ( QString  color)
signal

◆ envisionTextColorsMap()

QList< QPair< QColor, QString > > & Comments::ColorPicker::envisionTextColorsMap ( )
staticprivate

◆ handleColorPicked()

void Comments::ColorPicker::handleColorPicked ( QString  aColor)

◆ setColorPickerType()

void Comments::ColorPicker::setColorPickerType ( enum ColorPickerType  type)

This sets the type of the colorpicker to type.

The possible types are ColorPicker::background, ColorPicker::shape and ColorPicker::text. This information is then used to visualize the button of the colorpicker according to that type.

◆ setColors()

void Comments::ColorPicker::setColors ( QVector< QColor >  colors,
int  colorsPerRow,
std::function< QString(QColor)>  nameForColor = {} 
)

◆ setEnvisionTextColors()

void Comments::ColorPicker::setEnvisionTextColors ( )

For text Envision uses some predefined colors.

This method sets the colors displayed in the grid to these specific colors.

◆ setselectedColor()

void Comments::ColorPicker::setselectedColor ( QString  colorName)

Member Data Documentation

◆ type_

ColorPickerType Comments::ColorPicker::type_ {}
private