source/MainGUI.cpp
/**
 * Slot for changing the color.
 *
 * @param area The area where the color change should be applied.
 * @param color The new color.
 */
Slot for changing the color.
@param area The area where the color change should be applied.
@param color The new color.
Slot for changing the color . @param area The area where the color change should be applied . @param color The new color .
void MainGUI::setColor(const QString& area, const QColor& color)
{
    if (area == "backgroundcolor")
    {
        QPalette palette = widget.centralwidget->palette();
        palette.setColor(QPalette::Base, color);
        widget.centralwidget->setPalette(palette);
        widget.titleLabel->setPalette(palette);
    }
    else if (area.endsWith("_foregroundcolor"))
    {
        QString element = area.left(area.length() - 16);
        widget.outputTextArea->repaint(element, color);
        if (element.toLower() == "default")
        {
            QPalette palette = widget.titleLabel->palette();
            palette.setColor(QPalette::Text, color);
            widget.titleLabel->setPalette(palette);
        }
    }
}
void MainGUI :: setColor ( const QString & area , const QColor & color ) { if ( area == " " ) { QPalette palette = widget . centralwidget -> palette ( ) ; palette . setColor ( QPalette :: Base , color ) ; widget . centralwidget -> setPalette ( palette ) ; widget . titleLabel -> setPalette ( palette ) ; } else if ( area . endsWith ( " " ) ) { QString element = area . left ( area . length ( ) - 16 ) ; widget . outputTextArea -> repaint ( element , color ) ; if ( element . toLower ( ) == " " ) { QPalette palette = widget . titleLabel -> palette ( ) ; palette . setColor ( QPalette :: Text , color ) ; widget . titleLabel -> setPalette ( palette ) ; } } }
Slot for changing the color.
Slot for changing the color .
// Removing "_foregroundcolor".