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

« back to all changes in this revision

Viewing changes to krita/plugins/paintops/libpaintop/kis_brush_selection_widget.cpp

  • 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:
76
76
 
77
77
    setCurrentWidget(m_autoBrushWidget);
78
78
 
 
79
    uiWdgBrushChooser.sliderPrecision->setRange(1,5);
 
80
    uiWdgBrushChooser.sliderPrecision->setSingleStep(1);
 
81
    uiWdgBrushChooser.sliderPrecision->setPageStep(1);
 
82
    connect(uiWdgBrushChooser.sliderPrecision, SIGNAL(valueChanged(int)), SLOT(precisionChanged(int)));
 
83
    uiWdgBrushChooser.sliderPrecision->setValue(4);
 
84
    setPrecisionEnabled(false);
 
85
 
79
86
    m_presetIsValid = true;
80
87
}
81
88
 
194
201
    emit sigBrushChanged();
195
202
}
196
203
 
 
204
void KisBrushSelectionWidget::precisionChanged(int value)
 
205
{
 
206
    QString toolTip;
 
207
 
 
208
    switch(value) {
 
209
    case 1:
 
210
        toolTip =
 
211
            i18n("Precision Level 1 (fastest)\n"
 
212
                 "Subpixel precision: disabled\n"
 
213
                 "Brush size precision: 5%\n"
 
214
                 "\n"
 
215
                 "Optimal for very big brushes");
 
216
        break;
 
217
    case 2:
 
218
        toolTip =
 
219
            i18n("Precision Level 2\n"
 
220
                 "Subpixel precision: disabled\n"
 
221
                 "Brush size precision: 1%\n"
 
222
                 "\n"
 
223
                 "Optimal for big brushes");
 
224
        break;
 
225
    case 3:
 
226
        toolTip =
 
227
            i18n("Precision Level 3\n"
 
228
                 "Subpixel precision: disabled\n"
 
229
                 "Brush size precision: exact");
 
230
        break;
 
231
    case 4:
 
232
        toolTip =
 
233
            i18n("Precision Level 4 (optimal)\n"
 
234
                 "Subpixel precision: 50%\n"
 
235
                 "Brush size precision: exact\n"
 
236
                 "\n"
 
237
                 "Gives up to 50% better performance in comparison to Level 5");
 
238
        break;
 
239
    case 5:
 
240
        toolTip =
 
241
            i18n("Precision Level 5 (best quality)\n"
 
242
                 "Subpixel precision: exact\n"
 
243
                 "Brush size precision: exact\n"
 
244
                 "\n"
 
245
                 "The slowest performance. Best quality.");
 
246
        break;
 
247
    }
 
248
 
 
249
    uiWdgBrushChooser.sliderPrecision->setToolTip(toolTip);
 
250
    m_precisionOption.setPrecisionLevel(value);
 
251
    emit sigPrecisionChanged();
 
252
}
 
253
 
 
254
void KisBrushSelectionWidget::writeOptionSetting(KisPropertiesConfiguration* settings) const
 
255
{
 
256
    m_precisionOption.writeOptionSetting(settings);
 
257
}
 
258
 
 
259
void KisBrushSelectionWidget::readOptionSetting(const KisPropertiesConfiguration* setting)
 
260
{
 
261
    m_precisionOption.readOptionSetting(setting);
 
262
    uiWdgBrushChooser.sliderPrecision->setValue(m_precisionOption.precisionLevel());
 
263
}
 
264
 
 
265
void KisBrushSelectionWidget::setPrecisionEnabled(bool value)
 
266
{
 
267
    uiWdgBrushChooser.sliderPrecision->setVisible(value);
 
268
    uiWdgBrushChooser.lblPrecision->setVisible(value);
 
269
}
 
270
 
197
271
void KisBrushSelectionWidget::setCurrentWidget(QWidget* widget)
198
272
{
199
273
    if (m_currentBrushWidget) {