Changeset View
Changeset View
Standalone View
Standalone View
plugins/paintops/libpaintop/kis_pressure_sharpness_option_widget.cpp
Context not available. | |||||
26 | #include <klocalizedstring.h> | 26 | #include <klocalizedstring.h> | ||
---|---|---|---|---|---|
27 | 27 | | |||
28 | #include <kis_slider_spin_box.h> | 28 | #include <kis_slider_spin_box.h> | ||
29 | #include <QCheckBox> | ||||
29 | 30 | | |||
30 | #include "kis_curve_option_widget.h" | 31 | #include "kis_curve_option_widget.h" | ||
31 | #include "kis_pressure_sharpness_option.h" | 32 | #include "kis_pressure_sharpness_option.h" | ||
Context not available. | |||||
36 | { | 37 | { | ||
37 | setObjectName("KisPressureSharpnessOptionWidget"); | 38 | setObjectName("KisPressureSharpnessOptionWidget"); | ||
38 | 39 | | |||
39 | QLabel* thresholdLbl = new QLabel(i18n("Threshold:")); | 40 | QLabel* thresholdLbl = new QLabel(i18n("Soft edge:")); | ||
40 | 41 | | |||
41 | m_threshold = new KisSliderSpinBox(); | 42 | m_threshold = new KisSliderSpinBox(); | ||
42 | m_threshold->setRange(1, 100); | 43 | m_threshold->setRange(0, 100); | ||
43 | m_threshold->setValue(40); | 44 | m_threshold->setValue(0); | ||
44 | m_threshold->setSingleStep(1); | 45 | m_threshold->setSingleStep(1); | ||
46 | | ||||
47 | m_soft = new QCheckBox(i18n("Soft mode")); | ||||
48 | m_soft->setChecked(false); | ||||
45 | 49 | | |||
46 | QHBoxLayout* hl = new QHBoxLayout; | 50 | QHBoxLayout* hl = new QHBoxLayout; | ||
51 | hl->addWidget(m_soft); | ||||
47 | hl->addWidget(thresholdLbl); | 52 | hl->addWidget(thresholdLbl); | ||
48 | hl->addWidget(m_threshold, 1); | 53 | hl->addWidget(m_threshold, 1); | ||
49 | 54 | | |||
Context not available. | |||||
58 | KisCurveOptionWidget::setConfigurationPage(w); | 63 | KisCurveOptionWidget::setConfigurationPage(w); | ||
59 | 64 | | |||
60 | connect(m_threshold, SIGNAL(valueChanged(int)), this, SLOT(setThreshold(int))); | 65 | connect(m_threshold, SIGNAL(valueChanged(int)), this, SLOT(setThreshold(int))); | ||
66 | connect(m_soft, SIGNAL(toggled(bool)), this, SLOT(setSoft(bool))); | ||||
67 | | ||||
61 | setThreshold(m_threshold->value()); | 68 | setThreshold(m_threshold->value()); | ||
69 | setSoft(m_soft->isChecked()); | ||||
70 | | ||||
62 | } | 71 | } | ||
63 | 72 | | |||
64 | void KisPressureSharpnessOptionWidget::setThreshold(int threshold) | 73 | void KisPressureSharpnessOptionWidget::setThreshold(int threshold) | ||
Context not available. | |||||
66 | static_cast<KisPressureSharpnessOption*>(KisCurveOptionWidget::curveOption())->setThreshold(threshold); | 75 | static_cast<KisPressureSharpnessOption*>(KisCurveOptionWidget::curveOption())->setThreshold(threshold); | ||
67 | emitSettingChanged(); | 76 | emitSettingChanged(); | ||
68 | } | 77 | } | ||
78 | | ||||
79 | void KisPressureSharpnessOptionWidget::setSoft(bool soft) | ||||
80 | { | ||||
81 | static_cast<KisPressureSharpnessOption*>(KisCurveOptionWidget::curveOption())->setSoft(soft); | ||||
82 | emitSettingChanged(); | ||||
83 | } | ||||
Context not available. |