~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to krita/plugins/tools/selectiontools/kis_tool_select_contiguous.cc

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Copyright (c) 1999 Michael Koch <koch@kde.org>
5
5
 *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
6
6
 *  Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
 
7
 *  Copyright (c) 2012 José Luis Vergara <pentalis@gmail.com>
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
55
56
{
56
57
    setObjectName("tool_select_contiguous");
57
58
    m_fuzziness = 20;
 
59
    m_sizemod = 0;
 
60
    m_feather = 0;
58
61
    m_limitToCurrentLayer = false;
59
62
}
60
63
 
74
77
        if (!dev || !currentNode()->visible())
75
78
            return;
76
79
 
 
80
        if (!selectionEditable()) {
 
81
            return;
 
82
        }
 
83
 
77
84
        QApplication::setOverrideCursor(KisCursor::waitCursor());
78
85
 
79
86
        QPoint pos = convertToIntPixelCoord(event);
86
93
 
87
94
        KisImageWSP image = currentImage();
88
95
        image->lock();
89
 
        KisSelectionSP selection =
90
 
            fillpainter.createFloodSelection(pos.x(), pos.y(), image->projection());
 
96
        fillpainter.setFeather(m_feather);
 
97
        fillpainter.setSizemod(m_sizemod);
 
98
        KisSelectionSP selection = fillpainter.createFloodSelection(pos.x(), pos.y(), image->projection());
91
99
        image->unlock();
92
100
 
93
101
        KisCanvas2 * kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
116
124
    m_fuzziness = fuzziness;
117
125
}
118
126
 
 
127
void KisToolSelectContiguous::slotSetSizemod(int sizemod)
 
128
{
 
129
    m_sizemod = sizemod;
 
130
}
 
131
 
 
132
void KisToolSelectContiguous::slotSetFeather(int feather)
 
133
{
 
134
    m_feather = feather;
 
135
}
 
136
 
119
137
QWidget* KisToolSelectContiguous::createOptionWidget()
120
138
{
121
139
    KisToolSelectBase::createOptionWidget();
141
159
        input->setSingleStep(10);
142
160
        input->setValue(20);
143
161
        hbox->addWidget(input);
144
 
        connect(input, SIGNAL(valueChanged(int)), this, SLOT(slotSetFuzziness(int)));
 
162
        
 
163
        hbox = new QHBoxLayout();
 
164
        Q_CHECK_PTR(hbox);
 
165
        l->insertLayout(2, hbox);
 
166
        
 
167
        lbl = new QLabel(i18n("Grow/shrink selection: "), selectionWidget);
 
168
        hbox->addWidget(lbl);
 
169
        
 
170
        KisSliderSpinBox *sizemod = new KisSliderSpinBox(selectionWidget);
 
171
        Q_CHECK_PTR(sizemod);
 
172
        sizemod->setObjectName("sizemod");
 
173
        sizemod->setRange(-40, 40);
 
174
        sizemod->setSingleStep(1);
 
175
        sizemod->setValue(0);
 
176
        hbox->addWidget(sizemod);
 
177
        
 
178
        hbox = new QHBoxLayout();
 
179
        Q_CHECK_PTR(hbox);
 
180
        l->insertLayout(3, hbox);
 
181
        
 
182
        hbox->addWidget(new QLabel(i18n("Feathering radius: "), selectionWidget));
 
183
        
 
184
        KisSliderSpinBox *feather = new KisSliderSpinBox(selectionWidget);
 
185
        Q_CHECK_PTR(feather);
 
186
        feather->setObjectName("feathering");
 
187
        feather->setRange(0, 40);
 
188
        feather->setSingleStep(1);
 
189
        feather->setValue(0);
 
190
        hbox->addWidget(feather);
 
191
        
 
192
        connect (input  , SIGNAL(valueChanged(int)), this, SLOT(slotSetFuzziness(int) ));
 
193
        connect (sizemod, SIGNAL(valueChanged(int)), this, SLOT(slotSetSizemod(int)   ));
 
194
        connect (feather, SIGNAL(valueChanged(int)), this, SLOT(slotSetFeather(int)   ));
145
195
 
146
196
        QCheckBox* limitToCurrentLayer = new QCheckBox(i18n("Limit to current layer"), selectionWidget);
147
 
        l->insertWidget(2, limitToCurrentLayer);
 
197
        l->insertWidget(4, limitToCurrentLayer);
148
198
        limitToCurrentLayer->setChecked(m_limitToCurrentLayer);
149
 
        connect(limitToCurrentLayer, SIGNAL(stateChanged(int)),
150
 
                this, SLOT(slotLimitToCurrentLayer(int)));
 
199
        connect (limitToCurrentLayer, SIGNAL(stateChanged(int)), this, SLOT(slotLimitToCurrentLayer(int)));
151
200
 
152
201
    }
153
202
    return selectionWidget;