iPenguin / CrochetCharts

Graphics design software for Crochet pattern designers
http://StitchworksSoftware.com
GNU General Public License v3.0
57 stars 15 forks source link

set color does not work in groups #5

Open Neon22 opened 4 years ago

Neon22 commented 4 years ago

Color can not be set on a group. Each internal symbol in a group has to be selected to recolor. This makes recoloring groups very time consuming. Groups are super useful.

To make the tool work the code in cell.cpp needs to check if item is grouped then iterate over children.

Code is here:

void Cell::setBgColor(QColor c)
{
    if (mBgColor != c) {
        QString old = "";
        if (mBgColor.isValid())
            old = mBgColor.name();
        mBgColor = c;
        emit colorChanged(old, c.name());
        update();
    }
}

void Cell::setColor(QColor c)
{

    if(mColor != c) {
        QString old = "";
        if(mColor.isValid())
            old = mColor.name();
        mColor = c;

        QSvgRenderer *r = stitch()->renderSvg(c);
        if(r)
            setSharedRenderer(r);

        emit colorChanged(old, c.name());
        update();
    }

}

Check is bool Cell::isGrouped()

Neon22 commented 4 years ago

This would be IMHO the second priority thing to fix. All users use grouping to gather stitches for repeats. They all need to recolor rows of stitches.

The workaround is hard for most people as it involves pre-planning - making two or more groups which are pre-colored before assembling their diagram.