Signed-off-by: Gustavo Carneiro <gcarneiroa@hotmail.com>
This PR adds a feature to name colors in KColorCombo in special cases where, for example, the color of the main theme must be in the list, or some other important information must appear to the user of the application.
All functionality has been maintained for compatibility with applications in previous versions.
The developer can use something like:
KColorCombo *colorCombo = new KColorCombo; colorCombo.insertNamedColor(0, {i18n("info xyz ..."), Qt::Blue});
There, all colors will be kept and the custom color with an explanation will be added in the position informed in the first parameter.
For compatibility reasons and to keep the features close to the current ones, the following functions have also been added:
void setColors(const QList<QColor> &colors); void setNamedColors(const QList<KNamedColor> &colors); QList<KNamedColor> namedColors() const;
Functions that are self explanatory.
This PR was created with the intention of being used in the future in PR: 77
This will facilitate some issues related to the colors that are configured in the tabs, see PR 77.
I am available for further clarifications and adaptations if they deem necessary.