Commit aa34d6da authored by Boudewijn Rempt's avatar Boudewijn Rempt

Rename addToPalette for more clarity

parent 0381878f
......@@ -167,7 +167,7 @@ namespace KisToolUtils {
ColorPickerConfig::ColorPickerConfig()
: toForegroundColor(true)
, updateColor(true)
, addPalette(false)
, addColorToCurrentPalette(false)
, normaliseValues(false)
, sampleMerged(true)
, radius(1)
......@@ -185,7 +185,7 @@ namespace KisToolUtils {
KisPropertiesConfiguration props;
props.setProperty("toForegroundColor", toForegroundColor);
props.setProperty("updateColor", updateColor);
props.setProperty("addPalette", addPalette);
props.setProperty("addPalette", addColorToCurrentPalette);
props.setProperty("normaliseValues", normaliseValues);
props.setProperty("sampleMerged", sampleMerged);
props.setProperty("radius", radius);
......@@ -205,7 +205,7 @@ namespace KisToolUtils {
toForegroundColor = props.getBool("toForegroundColor", true);
updateColor = props.getBool("updateColor", true);
addPalette = props.getBool("addPalette", false);
addColorToCurrentPalette = props.getBool("addPalette", false);
normaliseValues = props.getBool("normaliseValues", false);
sampleMerged = props.getBool("sampleMerged", !defaultActivation ? false : true);
radius = props.getInt("radius", 1);
......
......@@ -33,7 +33,7 @@ struct KRITAUI_EXPORT ColorPickerConfig {
bool toForegroundColor;
bool updateColor;
bool addPalette;
bool addColorToCurrentPalette;
bool normaliseValues;
bool sampleMerged;
int radius;
......
......@@ -196,13 +196,13 @@ void KisToolColorPicker::endPrimaryAction(KoPointerEvent *event)
Q_UNUSED(event);
CHECK_MODE_SANITY_OR_RETURN(KisTool::PAINT_MODE);
if (m_config->addPalette) {
KisSwatch ent;
ent.setColor(m_pickedColor);
if (m_config->addColorToCurrentPalette) {
KisSwatch swatch;
swatch.setColor(m_pickedColor);
// We don't ask for a name, too intrusive here
KoColorSet *palette = m_palettes.at(m_optionsWidget->cmbPalette->currentIndex());
palette->add(ent);
palette->add(swatch);
if (!palette->save()) {
QMessageBox::critical(0, i18nc("@title:window", "Krita"), i18n("Cannot write to palette file %1. Maybe it is read-only.", palette->filename()));
......@@ -316,7 +316,7 @@ void KisToolColorPicker::updateOptionWidget()
m_optionsWidget->cbNormaliseValues->setChecked(m_config->normaliseValues);
m_optionsWidget->cbUpdateCurrentColor->setChecked(m_config->updateColor);
m_optionsWidget->cmbSources->setCurrentIndex(SAMPLE_MERGED + !m_config->sampleMerged);
m_optionsWidget->cbPalette->setChecked(m_config->addPalette);
m_optionsWidget->cbPalette->setChecked(m_config->addColorToCurrentPalette);
m_optionsWidget->radius->setValue(m_config->radius);
m_optionsWidget->blend->setValue(m_config->blend);
}
......@@ -345,7 +345,7 @@ void KisToolColorPicker::slotSetNormaliseValues(bool state)
void KisToolColorPicker::slotSetAddPalette(bool state)
{
m_config->addPalette = state;
m_config->addColorToCurrentPalette = state;
}
void KisToolColorPicker::slotChangeRadius(int value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment