Commit 4632e27b authored by Bart Coppens's avatar Bart Coppens

Sample merged now also in the contiguous select tool

svn path=/trunk/koffice/; revision=443296
parent 5756a8e0
......@@ -24,6 +24,7 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qapplication.h>
#include <qcheckbox.h>
#include <kaction.h>
#include <kdebug.h>
......@@ -57,6 +58,7 @@ KisToolSelectContiguous::KisToolSelectContiguous() : super()
m_optWidget = 0;
m_options = 0;
m_fuzziness = 20;
m_sampleMerged = false;
m_selectAction = SELECTION_ADD;
//XXX : make wizard cursor from tool icon.
......@@ -102,6 +104,7 @@ void KisToolSelectContiguous::buttonPress(KisButtonPressEvent * e)
KisFillPainter fillpainter(dev);
fillpainter.setFillThreshold(m_fuzziness);
fillpainter.setSampleMerged(m_sampleMerged);
KisSelectionSP selection = fillpainter.createFloodSelection(pos.x(), pos.y());
KisSelectedTransaction *t = new KisSelectedTransaction(i18n("Select Contiguous Areas"), dev.data());
......@@ -208,6 +211,12 @@ QWidget* KisToolSelectContiguous::createOptionWidget(QWidget* parent)
hbox -> addWidget(input);
connect(input, SIGNAL(valueChanged(int)), this, SLOT(slotSetFuzziness(int)));
QCheckBox* samplemerged = new QCheckBox(i18n("Sample merged"), m_optWidget);
l -> addWidget( samplemerged );
samplemerged -> setChecked(m_sampleMerged);
connect(samplemerged, SIGNAL(stateChanged(int)),
this, SLOT(slotSetSampleMerged(int)));
return m_optWidget;
}
......@@ -216,4 +225,11 @@ QWidget* KisToolSelectContiguous::optionWidget()
return m_optWidget;
}
void KisToolSelectContiguous::slotSetSampleMerged(int state)
{
if (state == QButton::NoChange)
return;
m_sampleMerged = (state == QButton::On);
}
#include "kis_tool_select_contiguous.moc"
......@@ -61,6 +61,7 @@ public:
public slots:
virtual void slotSetFuzziness(int);
virtual void slotSetAction(int);
virtual void slotSetSampleMerged(int);
virtual void activate();
......@@ -71,6 +72,7 @@ private:
int m_fuzziness;
enumSelectionMode m_selectAction;
bool m_sampleMerged;
};
class KisToolSelectContiguousFactory : public KisToolFactory {
......
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