Commit 54c86c1c authored by Agata Cacko's avatar Agata Cacko

Fix Fill Tool color label combobox being enabled

Before this commit, color label combobox in Fill Tool would be
enabled in some specific cases, for example after disabling the
Fast Mode, even though the sampling method would be Current Layer
or All Layers. This commit fixes that behaviour by making sure
that the combobox is enabled only if all three are true:
- Fill Tool doesn't use Fast Mode
- Fill Tool doesn't fill the entire selection
- Fill Tool uses the Color Labeled Layers
parent f7514355
......@@ -334,7 +334,9 @@ void KisToolFill::updateGUI()
m_checkUsePattern->setEnabled(useAdvancedMode);
m_cmbSampleLayersMode->setEnabled(!selectionOnly && useAdvancedMode);
m_cmbSelectedLabels->setEnabled(!selectionOnly && useAdvancedMode);
bool sampleLayersModeIsColorLabeledLayers = m_cmbSampleLayersMode->currentData().toString() == SAMPLE_LAYERS_MODE_COLOR_LABELED;
m_cmbSelectedLabels->setEnabled(!selectionOnly && useAdvancedMode && sampleLayersModeIsColorLabeledLayers);
}
QString KisToolFill::sampleLayerModeToUserString(QString sampleLayersModeId)
......@@ -363,7 +365,7 @@ void KisToolFill::setCmbSampleLayersMode(QString sampleLayersModeId)
}
}
m_sampleLayersMode = sampleLayersModeId;
m_cmbSelectedLabels->setEnabled(sampleLayersModeId == SAMPLE_LAYERS_MODE_COLOR_LABELED);
updateGUI();
}
void KisToolFill::activateConnectionsToImage()
......@@ -412,7 +414,7 @@ void KisToolFill::slotSetSampleLayers(int index)
{
Q_UNUSED(index);
m_sampleLayersMode = m_cmbSampleLayersMode->currentData(Qt::UserRole).toString();
m_cmbSelectedLabels->setEnabled(m_sampleLayersMode == SAMPLE_LAYERS_MODE_COLOR_LABELED);
updateGUI();
m_configGroup.writeEntry("sampleLayersMode", m_sampleLayersMode);
}
......
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