Commit 9570d827 authored by Michael Zhou's avatar Michael Zhou

Changed KisColorSetEntry to be a class from a struct

Differential revision: https://phabricator.kde.org/D13208
parent c677e6d8
......@@ -109,7 +109,7 @@ KoColorSetEntry Palette::colorSetEntryFromGroup(int index, const QString &groupN
ManagedColor *Palette::colorForEntry(KoColorSetEntry entry)
{
if (!d->palette) return 0;
ManagedColor *color = new ManagedColor(entry.color);
ManagedColor *color = new ManagedColor(entry.color());
return color;
}
......
......@@ -47,7 +47,7 @@ for (k, v) in resources.items():
for x in range(palette.numberOfEntries()):
entry = palette.colorSetEntryByIndex(x)
c = palette.colorForEntry(entry);
print(x, entry.name, entry.id, entry.spotColor, c.toQString())
print(x, entry.name(), entry.id(), entry.spotColor(), c.toQString())
* @endcode
*/
......
......@@ -71,11 +71,11 @@ QVariant PaletteColorsModel::data(const QModelIndex &index, int role) const
switch(role)
{
case ImageRole:
color = d->colorSet->getColorGlobal(index.row()).color.toQColor();
color = d->colorSet->getColorGlobal(index.row()).color().toQColor();
result = QString("image://color/%1,%2,%3,%4").arg(color.redF()).arg(color.greenF()).arg(color.blueF()).arg(color.alphaF());
break;
case TextRole:
result = d->colorSet->getColorGlobal(index.row()).name;
result = d->colorSet->getColorGlobal(index.row()).name();
break;
default:
break;
......@@ -138,10 +138,10 @@ void PaletteColorsModel::activateColor(int index, bool setBackgroundColor)
if (index >= 0 && index < (int)d->colorSet->nColors())
{
if (setBackgroundColor)
d->view->resourceProvider()->setBGColor(d->colorSet->getColorGlobal(index).color);
d->view->resourceProvider()->setBGColor(d->colorSet->getColorGlobal(index).color());
else
d->view->resourceProvider()->setFGColor( d->colorSet->getColorGlobal(index).color);
emit colorChanged(d->colorSet->getColorGlobal(index).color.toQColor(), setBackgroundColor);
d->view->resourceProvider()->setFGColor( d->colorSet->getColorGlobal(index).color());
emit colorChanged(d->colorSet->getColorGlobal(index).color().toQColor(), setBackgroundColor);
}
}
......@@ -76,6 +76,7 @@ set(kritapigment_SRCS
colorprofiles/KoDummyColorProfile.cpp
resources/KoAbstractGradient.cpp
resources/KoColorSet.cpp
resources/KoColorSetEntry.cpp
resources/KoPattern.cpp
resources/KoResource.cpp
resources/KoMD5Generator.cpp
......
This diff is collapsed.
......@@ -27,21 +27,7 @@
#include <resources/KoResource.h>
#include "KoColor.h"
struct KoColorSetEntry {
KoColorSetEntry() {}
KoColorSetEntry(const KoColor &_color, const QString &_name)
: color(_color), name(_name) {}
KoColor color;
QString name;
QString id;
bool spotColor {false};
bool operator==(const KoColorSetEntry& rhs) const {
return color == rhs.color && name == rhs.name;
}
};
#include "KoColorSetEntry.h"
/**
* Open Gimp, Photoshop or RIFF palette files. This is a straight port
......@@ -68,6 +54,7 @@ public:
/**
* Load a color set from a file. This can be a Gimp
* palette, a RIFF palette, a Photoshop palette,
* a Krita palette,
* a Scribus palette or a SwatchBooker palette.
*/
explicit KoColorSet(const QString &filename);
......
......@@ -79,7 +79,7 @@ void ColorSetDelegate::paint(QPainter * painter, const QStyleOptionViewItem & op
int size = 7;
for (quint32 i = 0; i < colorSet->nColors() && i*size < (quint32)option.rect.width(); i++) {
QRect rect(option.rect.x() + i*size, option.rect.y() + option.rect.height() - size, size, size);
painter->fillRect(rect, colorSet->getColorGlobal(i).color.toQColor());
painter->fillRect(rect, colorSet->getColorGlobal(i).color().toQColor());
}
painter->restore();
......@@ -116,12 +116,12 @@ KisColorsetChooser::KisColorsetChooser(QWidget* parent): QWidget(parent)
QGridLayout* layout = new QGridLayout(this);
layout->addWidget(m_itemChooser, 0, 0, 1, 3);
layout->addWidget(new QLabel(i18n("Name:"), this), 1, 0, 1, 1);
layout->setColumnStretch(1, 1);
layout->addWidget(saveButton, 2, 2, 1, 1);
layout->addWidget(m_nameEdit, 1, 1, 1, 2);
layout->addWidget(new QLabel(i18n("Columns:"), this), 2, 0, 1, 1);
layout->addWidget(new QLabel(i18n("Name:"), this), 1, 0, 1, 1);
layout->addWidget(m_columnEdit, 2, 1, 1, 1);
layout->addWidget(saveButton, 2, 2, 1, 1);
layout->setColumnStretch(1, 1);
layout->addWidget(new QLabel(i18n("Columns:"), this), 2, 0, 1, 1);
}
KisColorsetChooser::~KisColorsetChooser()
......
......@@ -143,10 +143,10 @@ QVariant KisPaletteModel::data(const QModelIndex& index, int role) const
switch (role) {
case Qt::ToolTipRole:
case Qt::DisplayRole: {
return entry.name;
return entry.name();
}
case Qt::BackgroundRole: {
QColor color = m_displayRenderer->toQColor(entry.color);
QColor color = m_displayRenderer->toQColor(entry.color());
return QBrush(color);
}
case IsHeaderRole: {
......@@ -490,12 +490,17 @@ bool KisPaletteModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int indexInGroup;
QString colorXml;
stream >> entry.name
>> entry.id
>> entry.spotColor
QString name, id;
bool spotColor;
stream >> name
>> id
>> spotColor
>> indexInGroup
>> oldGroupName
>> colorXml;
entry.setName(name);
entry.setId(id);
entry.setSpotColor(spotColor);
QDomDocument doc;
doc.setContent(colorXml);
......@@ -503,7 +508,7 @@ bool KisPaletteModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
QDomElement c = e.firstChildElement();
if (!c.isNull()) {
QString colorDepthId = c.attribute("bitdepth", Integer8BitsColorDepthID.id());
entry.color = KoColor::fromXML(c, colorDepthId);
entry.setColor(KoColor::fromXML(c, colorDepthId));
}
QModelIndex index = this->index(endRow, endColumn);
......@@ -603,13 +608,13 @@ QMimeData *KisPaletteModel::mimeData(const QModelIndexList &indexes) const
QDomDocument doc;
QDomElement root = doc.createElement("Color");
root.setAttribute("bitdepth", entry.color.colorSpace()->colorDepthId().id());
root.setAttribute("bitdepth", entry.color().colorSpace()->colorDepthId().id());
doc.appendChild(root);
entry.color.toXML(doc, root);
entry.color().toXML(doc, root);
stream << entry.name
<< entry.id
<< entry.spotColor
stream << entry.name()
<< entry.id()
<< entry.spotColor()
<< indexInGroup
<< groupName
<< doc.toString();
......
......@@ -322,13 +322,13 @@ void KisDlgInternalColorSelector::slotChangePalette(KoColorSet *set)
for (quint32 i = 0; i< set->nColors(); i++) {
KoColorSetEntry entry = set->getColorGlobal(i);
QPixmap colorSquare = QPixmap(32, 32);
if (entry.spotColor) {
if (entry.spotColor()) {
QImage img = QImage(32, 32, QImage::Format_ARGB32);
QPainter circlePainter;
img.fill(Qt::transparent);
circlePainter.begin(&img);
QBrush brush = QBrush(Qt::SolidPattern);
brush.setColor(entry.color.toQColor());
brush.setColor(entry.color().toQColor());
circlePainter.setBrush(brush);
QPen pen = circlePainter.pen();
pen.setColor(Qt::transparent);
......@@ -338,11 +338,11 @@ void KisDlgInternalColorSelector::slotChangePalette(KoColorSet *set)
circlePainter.end();
colorSquare = QPixmap::fromImage(img);
} else {
colorSquare.fill(entry.color.toQColor());
colorSquare.fill(entry.color().toQColor());
}
QString name = entry.name;
if (!entry.id.isEmpty()){
name = entry.id + " - " + entry.name;
QString name = entry.name();
if (!entry.id().isEmpty()){
name = entry.id() + " - " + entry.name();
}
m_ui->cmbNameList->addSqueezedItem(QIcon(colorSquare), name);
}
......@@ -367,7 +367,7 @@ void KisDlgInternalColorSelector::slotSetColorFromColorList()
void KisDlgInternalColorSelector::slotSetColorFromColorSetEntry(KoColorSetEntry entry)
{
slotColorUpdated(entry.color);
slotColorUpdated(entry.color());
}
void KisDlgInternalColorSelector::showEvent(QShowEvent *event)
......
......@@ -32,18 +32,19 @@
#include <kis_color_button.h>
#include <QCheckBox>
#include <QComboBox>
#include <QMenu>
struct KisPaletteView::Private
{
KisPaletteModel *model = 0;
KisPaletteModel *model = nullptr;
bool allowPaletteModification = true;
};
KisPaletteView::KisPaletteView(QWidget *parent)
: KoTableView(parent),
m_d(new Private)
: KoTableView(parent)
, m_d(new Private)
{
setShowGrid(false);
horizontalHeader()->setVisible(false);
......@@ -113,10 +114,10 @@ bool KisPaletteView::addEntryWithDialog(KoColor color)
groupName = QString();
}
KoColorSetEntry newEntry;
newEntry.color = bnColor->color();
newEntry.name = lnName->text();
newEntry.id = lnIDName->text();
newEntry.spotColor = chkSpot->isChecked();
newEntry.setColor(bnColor->color());
newEntry.setName(lnName->text());
newEntry.setId(lnIDName->text());
newEntry.setSpotColor(chkSpot->isChecked());
m_d->model->addColorSetEntry(newEntry, groupName);
m_d->model->colorSet()->save();
return true;
......@@ -124,6 +125,7 @@ bool KisPaletteView::addEntryWithDialog(KoColor color)
return false;
}
// should be move to colorSetChooser
bool KisPaletteView::addGroupWithDialog()
{
KoDialog *window = new KoDialog();
......@@ -180,7 +182,7 @@ void KisPaletteView::trySelectClosestColor(KoColor color)
currentI = selectedIndexes().first();
}
if (currentI.isValid()) {
if (m_d->model->colorSetEntryFromIndex(currentI).color==color) {
if (m_d->model->colorSetEntryFromIndex(currentI).color()==color) {
return;
}
}
......@@ -325,15 +327,15 @@ void KisPaletteView::modifyEntry(QModelIndex index) {
editableItems->addRow(i18n("Name"), lnGroupName);
editableItems->addRow(i18n("Color"), bnColor);
editableItems->addRow(i18n("Spot"), chkSpot);
lnGroupName->setText(entry.name);
lnIDName->setText(entry.id);
bnColor->setColor(entry.color);
chkSpot->setChecked(entry.spotColor);
lnGroupName->setText(entry.name());
lnIDName->setText(entry.id());
bnColor->setColor(entry.color());
chkSpot->setChecked(entry.spotColor());
if (group->exec() == KoDialog::Accepted) {
entry.name = lnGroupName->text();
entry.id = lnIDName->text();
entry.color = bnColor->color();
entry.spotColor = chkSpot->isChecked();
entry.setName(lnGroupName->text());
entry.setId(lnIDName->text());
entry.setColor(bnColor->color());
entry.setSpotColor(chkSpot->isChecked());
m_d->model->colorSet()->changeColorSetEntry(entry, entryList.at(0), entryList.at(1).toUInt());
m_d->model->colorSet()->save();
}
......
......@@ -41,6 +41,7 @@
#include <ksharedconfig.h>
#include <resources/KoColorSet.h>
#include <resources/KoColorSetEntry.h>
#include <KoColorPatch.h>
#include <KoEditColorSetDialog.h>
#include <KoColorSpaceRegistry.h>
......@@ -84,16 +85,16 @@ void KoColorSetWidget::KoColorSetWidgetPrivate::fillColors()
patch->setFrameStyle(QFrame::Plain | QFrame::Box);
patch->setLineWidth(1);
KoColorSetEntry c = colorSet->getColorGlobal(i);
patch->setColor(c.color);
patch->setToolTip(c.name);
patch->setColor(c.color());
patch->setToolTip(c.name());
connect(patch, SIGNAL(triggered(KoColorPatch *)), thePublic, SLOT(colorTriggered(KoColorPatch *)));
colorGroupLayout->addWidget(patch, p/columns, p%columns);
patch->setDisplayRenderer(displayRenderer);
patchWidgetList.append(patch);
colornames.append(c.name);
colornames.append(c.name());
QPixmap colorsquare = QPixmap(12,12);
colorsquare.fill(c.color.toQColor());
colorNameCmb->addItem(QIcon(colorsquare), c.name);
colorsquare.fill(c.color().toQColor());
colorNameCmb->addItem(QIcon(colorsquare), c.name());
++p;
}
colorSetLayout->addWidget(defaultGroupContainer);
......@@ -115,16 +116,16 @@ void KoColorSetWidget::KoColorSetWidgetPrivate::fillColors()
patch->setFrameStyle(QFrame::Plain | QFrame::Box);
patch->setLineWidth(1);
KoColorSetEntry c = colorSet->getColorGroup(i, groupName);
patch->setColor(c.color);
patch->setToolTip(c.name);
patch->setColor(c.color());
patch->setToolTip(c.name());
connect(patch, SIGNAL(triggered(KoColorPatch *)), thePublic, SLOT(colorTriggered(KoColorPatch *)));
groupLayout->addWidget(patch, p/columns, p%columns);
patch->setDisplayRenderer(displayRenderer);
patchWidgetList.append(patch);
colornames.append(c.name);
colornames.append(c.name());
QPixmap colorsquare = QPixmap(12,12);
colorsquare.fill(c.color.toQColor());
colorNameCmb->addItem(QIcon(colorsquare), c.name);
colorsquare.fill(c.color().toQColor());
colorNameCmb->addItem(QIcon(colorsquare), c.name());
++p;
}
colorSetLayout->addWidget(groupbox);
......
......@@ -138,8 +138,8 @@ void KoEditColorSetWidget::setActiveColorSet(int index)
for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) {
KoColorPatch *patch = new KoColorPatch(widget.patchesFrame);
KoColorSetEntry c = m_activeColorSet->getColorGlobal(i);
patch->setColor(c.color);
patch->setToolTip(c.name);
patch->setColor(c.color());
patch->setToolTip(c.name());
connect(patch, SIGNAL(triggered(KoColorPatch *)), this, SLOT(setTextLabel(KoColorPatch *)));
m_gridLayout->addWidget(patch, i/columns, i%columns);
}
......@@ -169,12 +169,12 @@ void KoEditColorSetWidget::addColor()
color = QColorDialog::getColor(color);
if (color.isValid()) {
KoColorSetEntry newEntry;
newEntry.color = KoColor(color, KoColorSpaceRegistry::instance()->rgb8());
newEntry.name = QInputDialog::getText(this, i18n("Add Color To Palette"), i18n("Color name:"));
KoColorSetEntry newEntry(
KoColor(color, KoColorSpaceRegistry::instance()->rgb8()),
QInputDialog::getText(this, i18n("Add Color To Palette"), i18n("Color name:")));
KoColorPatch *patch = new KoColorPatch(widget.patchesFrame);
patch->setColor(newEntry.color);
patch->setToolTip(newEntry.name);
patch->setColor(newEntry.color());
patch->setToolTip(newEntry.name());
connect(patch, SIGNAL(triggered(KoColorPatch *)), this, SLOT(setTextLabel(KoColorPatch *)));
Q_ASSERT(m_gridLayout);
Q_ASSERT(m_activeColorSet);
......@@ -188,7 +188,7 @@ void KoEditColorSetWidget::removeColor()
Q_ASSERT(m_activeColorSet);
for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) {
KoColorSetEntry c = m_activeColorSet->getColorGlobal(i);
if (m_activePatch->color() == c.color) {
if (m_activePatch->color() == c.color()) {
m_activeColorSet->removeAt(i);
setActiveColorSet(widget.selector->currentIndex());
break;
......
......@@ -185,13 +185,13 @@ void PaletteDockerDock::setColorSet(KoColorSet* colorSet)
for (quint32 i = 0; i< colorSet->nColors(); i++) {
KoColorSetEntry entry = colorSet->getColorGlobal(i);
QPixmap colorSquare = QPixmap(32, 32);
if (entry.spotColor) {
if (entry.spotColor()) {
QImage img = QImage(32, 32, QImage::Format_ARGB32);
QPainter circlePainter;
img.fill(Qt::transparent);
circlePainter.begin(&img);
QBrush brush = QBrush(Qt::SolidPattern);
brush.setColor(entry.color.toQColor());
brush.setColor(entry.color().toQColor());
circlePainter.setBrush(brush);
QPen pen = circlePainter.pen();
pen.setColor(Qt::transparent);
......@@ -201,11 +201,11 @@ void PaletteDockerDock::setColorSet(KoColorSet* colorSet)
circlePainter.end();
colorSquare = QPixmap::fromImage(img);
} else {
colorSquare.fill(entry.color.toQColor());
colorSquare.fill(entry.color().toQColor());
}
QString name = entry.name;
if (!entry.id.isEmpty()){
name = entry.id + " - " + entry.name;
QString name = entry.name();
if (!entry.id().isEmpty()){
name = entry.id() + " - " + entry.name();
}
m_wdgPaletteDock->cmbNameList->addSqueezedItem(QIcon(colorSquare), name);
}
......@@ -267,7 +267,7 @@ void PaletteDockerDock::entrySelected(KoColorSetEntry entry)
m_wdgPaletteDock->cmbNameList->setCurrentIndex(index);
}
if (m_resourceProvider) {
m_resourceProvider->setFGColor(entry.color);
m_resourceProvider->setFGColor(entry.color());
}
if (m_currentColorSet->removable()) {
m_wdgPaletteDock->bnRemove->setEnabled(true);
......@@ -281,7 +281,7 @@ void PaletteDockerDock::entrySelectedBack(KoColorSetEntry entry)
m_wdgPaletteDock->cmbNameList->setCurrentIndex(index);
}
if (m_resourceProvider) {
m_resourceProvider->setBGColor(entry.color);
m_resourceProvider->setBGColor(entry.color());
}
if (m_currentColorSet->removable()) {
m_wdgPaletteDock->bnRemove->setEnabled(true);
......
/*
struct KoColorSetEntry {
%TypeHeaderCode
#include "KoColorSet.h"
......@@ -12,6 +13,8 @@ public:
bool operator==(const KoColorSetEntry& rhs) const;
};
*/
class KoColorSetEntry;
class Palette : QObject
{
......
......@@ -118,14 +118,14 @@ class Palette_Docker(DockWidget):
self.paletteView.setPalette(self.currentPalette)
self.slot_fill_combobox()
@pyqtSlot('KoColorSetEntry')
@pyqtSlot('PaletteEntry')
def slot_swatchSelected(self, entry):
print("entry " + entry.name)
print("entry " + entry.name())
if (self.canvas()) is not None:
if (self.canvas().view()) is not None:
name = entry.name
name = entry.name()
if len(entry.id) > 0:
name = entry.id + " - " + entry.name
name = entry.id() + " - " + entry.name()
if len(name) > 0:
if name in self.colorList:
self.colorComboBox.setCurrentIndex(self.colorList.index(name))
......@@ -147,7 +147,7 @@ class Palette_Docker(DockWidget):
entry = palette.colorSetEntryByIndex(i)
color = palette.colorForEntry(entry).colorForCanvas(self.canvas())
colorSquare = QPixmap(12, 12)
if entry.spotColor is True:
if entry.spotColor() is True:
img = colorSquare.toImage()
circlePainter = QPainter()
img.fill(self.colorComboBox.palette().color(QPalette.Base))
......@@ -161,9 +161,9 @@ class Palette_Docker(DockWidget):
colorSquare = QPixmap.fromImage(img)
else:
colorSquare.fill(color)
name = entry.name
if len(entry.id) > 0:
name = entry.id + " - " + entry.name
name = entry.name()
if len(entry.id()) > 0:
name = entry.id() + " - " + entry.name()
self.colorList.append(name)
self.colorComboBox.addItem(QIcon(colorSquare), name)
self.colorComboBox.setEditable(True)
......
......@@ -57,7 +57,7 @@ class gimpPaletteExporter:
red = max(min(int(color.componentsOrdered()[0] * 255), 255), 0)
green = max(min(int(color.componentsOrdered()[1] * 255), 255), 0)
blue = max(min(int(color.componentsOrdered()[2] * 255), 255), 0)
gplFile.write(str(red) + " " + str(green) + " " + str(blue) + " " + entry.id + "-" + entry.name + "\n")
gplFile.write(str(red) + " " + str(green) + " " + str(blue) + " " + entry.id() + "-" + entry.name() + "\n")
groupNames = self.currentPalette.groupNames()
for groupName in groupNames:
colorCount = self.currentPalette.colorsCountGroup(groupName)
......@@ -69,5 +69,5 @@ class gimpPaletteExporter:
red = max(min(int(color.componentsOrdered()[0] * 255), 255), 0)
green = max(min(int(color.componentsOrdered()[1] * 255), 255), 0)
blue = max(min(int(color.componentsOrdered()[2] * 255), 255), 0)
gplFile.write(str(red) + " " + str(green) + " " + str(blue) + " " + entry.id + "-" + entry.name + "\n")
gplFile.write(str(red) + " " + str(green) + " " + str(blue) + " " + entry.id() + "-" + entry.name() + "\n")
gplFile.close()
......@@ -89,7 +89,7 @@ class inkscapeSVGExporter:
green = max(min(int(color.componentsOrdered()[1] * 255), 255), 0)
blue = max(min(int(color.componentsOrdered()[2] * 255), 255), 0)
hexcode = "#" + str(format(red, '02x')) + str(format(green, '02x')) + str(format(blue, '02x'))
swatchName = str(i) + "-" + entry.name
swatchName = str(i) + "-" + entry.name()
swatchName = swatchName.replace(" ", "-")
swatchName = swatchName.replace("(", "-")
swatchName = swatchName.replace(")", "-")
......@@ -107,7 +107,7 @@ class inkscapeSVGExporter:
svgSingleSwatch.setAttribute("height", str(int(20)))
svgSingleSwatch.setAttribute("fill", "url(#" + swatchName + ")")
svgSingleSwatch.setAttribute("id", "swatch" + swatchName)
if entry.spotColor is True:
if entry.spotColor() is True:
svgSingleSwatch.setAttribute("rx", str(10))
svgSingleSwatch.setAttribute("ry", str(10))
svgSwatches.appendChild(svgSingleSwatch)
......@@ -143,7 +143,7 @@ class inkscapeSVGExporter:
blue = max(min(int(color.componentsOrdered()[2] * 255), 255), 0)
hexcode = "#" + str(format(red, '02x')) + str(format(green, '02x')) + str(format(blue, '02x'))
swatchName = groupName + str(i) + "-" + entry.name
swatchName = groupName + str(i) + "-" + entry.name()
swatchName = swatchName.replace(" ", "-")
swatchName = swatchName.replace("(", "-")
swatchName = swatchName.replace(")", "-")
......@@ -161,7 +161,7 @@ class inkscapeSVGExporter:
svgSingleSwatch.setAttribute("height", str(int(20)))
svgSingleSwatch.setAttribute("fill", "url(#" + swatchName + ")")
svgSingleSwatch.setAttribute("id", "swatch " + swatchName)
if entry.spotColor is True:
if entry.spotColor() is True:
svgSingleSwatch.setAttribute("rx", str(10))
svgSingleSwatch.setAttribute("ry", str(10))
svgSwatches.appendChild(svgSingleSwatch)
......
......@@ -54,7 +54,7 @@ class sortColors:
colorCount = self.currentPalette.colorsCountGroup(groupName)
for i in range(colorCount - 1, -1, -1):
entry = self.currentPalette.colorSetEntryFromGroup((i), groupName)
l[entry.id + " " + str(i)] = entry
l[entry.id() + " " + str(i)] = entry
self.currentPalette.removeEntry((i), groupName)
for s in sorted(l):
......
......@@ -243,7 +243,7 @@ void KisToolColorPicker::endPrimaryAction(KoPointerEvent *event)
if (m_config->addPalette) {
KoColorSetEntry ent;
ent.color = m_pickedColor;
ent.setColor(m_pickedColor);
// We don't ask for a name, too intrusive here
KoColorSet *palette = m_palettes.at(m_optionsWidget->cmbPalette->currentIndex());
......
......@@ -162,7 +162,7 @@ void KisToolLazyBrushOptionsWidget::entrySelected(QModelIndex index)
if (i >= 0 && i < (int)m_d->colorSet.nColors()) {
KoColorSetEntry entry = m_d->colorModel->colorSetEntryFromIndex(index);
m_d->provider->setFGColor(entry.color);
m_d->provider->setFGColor(entry.color());
}
const bool transparentChecked = i >= 0 && i == m_d->transparentColorIndex;
......@@ -176,7 +176,7 @@ void KisToolLazyBrushOptionsWidget::slotCurrentFgColorChanged(const KoColor &col
for (quint32 i = 0; i < m_d->colorSet.nColors(); i++) {
KoColorSetEntry entry = m_d->colorSet.getColorGlobal(i);
if (entry.color == color) {
if (entry.color() == color) {