diff --git a/krita/pics/misc-dark/dark_curve-preset-arch.svg b/krita/pics/misc-dark/dark_curve-preset-arch.svg new file mode 100644 index 0000000000..004df29f2a --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-arch.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-j.svg b/krita/pics/misc-dark/dark_curve-preset-j.svg new file mode 100644 index 0000000000..033b8af4a4 --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-j.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-l.svg b/krita/pics/misc-dark/dark_curve-preset-l.svg new file mode 100644 index 0000000000..9f5d2d26c7 --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-l.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-linear-reverse.svg b/krita/pics/misc-dark/dark_curve-preset-linear-reverse.svg new file mode 100644 index 0000000000..76a063fc92 --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-linear-reverse.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-linear.svg b/krita/pics/misc-dark/dark_curve-preset-linear.svg new file mode 100644 index 0000000000..d3b670f33f --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-linear.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-s-reverse.svg b/krita/pics/misc-dark/dark_curve-preset-s-reverse.svg new file mode 100644 index 0000000000..9f9c6ea634 --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-s-reverse.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-s.svg b/krita/pics/misc-dark/dark_curve-preset-s.svg new file mode 100644 index 0000000000..479d6332ae --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-s.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/dark_curve-preset-u.svg b/krita/pics/misc-dark/dark_curve-preset-u.svg new file mode 100644 index 0000000000..d1cced7378 --- /dev/null +++ b/krita/pics/misc-dark/dark_curve-preset-u.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-dark/misc-dark-icons.qrc b/krita/pics/misc-dark/misc-dark-icons.qrc index fd8399bd23..0f999d6a3f 100644 --- a/krita/pics/misc-dark/misc-dark-icons.qrc +++ b/krita/pics/misc-dark/misc-dark-icons.qrc @@ -1,60 +1,67 @@ - - - + + dark_draw-eraser.svg dark_geometry.svg dark_ox16-action-object-align-horizontal-center-calligra.svg dark_ox16-action-object-align-horizontal-left-calligra.svg dark_ox16-action-object-align-horizontal-right-calligra.svg dark_ox16-action-object-align-vertical-bottom-calligra.svg dark_ox16-action-object-align-vertical-center-calligra.svg dark_ox16-action-object-align-vertical-top-calligra.svg dark_ox16-action-object-order-back-calligra.svg dark_ox16-action-object-order-front-calligra.svg dark_ox16-action-object-order-lower-calligra.svg dark_ox16-action-object-order-raise-calligra.svg dark_ox16-action-object-group-calligra.svg dark_ox16-action-object-ungroup-calligra.svg dark_distribute-horizontal-center.svg dark_distribute-horizontal-left.svg dark_distribute-horizontal-right.svg dark_distribute-horizontal.svg dark_distribute-vertical-bottom.svg dark_distribute-vertical-center.svg dark_distribute-vertical-top.svg dark_distribute-vertical.svg dark_paintop_settings_01.svg dark_paintop_settings_02.svg dark_pivot-point.svg dark_stroke-cap-butt.svg dark_stroke-cap-round.svg dark_stroke-cap-square.svg dark_stroke-join-bevel.svg dark_stroke-join-miter.svg dark_stroke-join-round.svg dark_symmetry-horizontal.svg dark_symmetry-vertical.svg dark_onionOff.svg dark_onionOn.svg dark_onion_skin_options.svg dark_path-break-point.svg dark_path-break-segment.svg dark_pathpoint-corner.svg dark_pathpoint-curve.svg dark_pathpoint-insert.svg dark_pathpoint-join.svg dark_pathpoint-line.svg dark_pathpoint-merge.svg dark_pathpoint-remove.svg dark_pathpoint-smooth.svg dark_pathpoint-symmetric.svg dark_pathsegment-curve.svg dark_pathsegment-line.svg dark_opacity-increase.svg dark_opacity-decrease.svg dark_lightness-increase.svg dark_lightness-decrease.svg dark_brushsize-increase.svg dark_brushsize-decrease.svg + dark_curve-preset-u.svg + dark_curve-preset-s.svg + dark_curve-preset-s-reverse.svg + dark_curve-preset-linear.svg + dark_curve-preset-linear-reverse.svg + dark_curve-preset-l.svg + dark_curve-preset-j.svg + dark_curve-preset-arch.svg diff --git a/krita/pics/misc-light/light_curve-preset-arch.svg b/krita/pics/misc-light/light_curve-preset-arch.svg new file mode 100644 index 0000000000..7fdb7e0634 --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-arch.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-j.svg b/krita/pics/misc-light/light_curve-preset-j.svg new file mode 100644 index 0000000000..b9a1b3b87b --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-j.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-l.svg b/krita/pics/misc-light/light_curve-preset-l.svg new file mode 100644 index 0000000000..b50627da32 --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-l.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-linear-reverse.svg b/krita/pics/misc-light/light_curve-preset-linear-reverse.svg new file mode 100644 index 0000000000..4275419e18 --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-linear-reverse.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-linear.svg b/krita/pics/misc-light/light_curve-preset-linear.svg new file mode 100644 index 0000000000..233e03fcf5 --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-linear.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-s-reverse.svg b/krita/pics/misc-light/light_curve-preset-s-reverse.svg new file mode 100644 index 0000000000..917c45190b --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-s-reverse.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-s.svg b/krita/pics/misc-light/light_curve-preset-s.svg new file mode 100644 index 0000000000..c6ff229e6f --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-s.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/light_curve-preset-u.svg b/krita/pics/misc-light/light_curve-preset-u.svg new file mode 100644 index 0000000000..6be1cc33ce --- /dev/null +++ b/krita/pics/misc-light/light_curve-preset-u.svg @@ -0,0 +1,72 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/krita/pics/misc-light/misc-light-icons.qrc b/krita/pics/misc-light/misc-light-icons.qrc index 3173d1a81e..d3d1264663 100644 --- a/krita/pics/misc-light/misc-light-icons.qrc +++ b/krita/pics/misc-light/misc-light-icons.qrc @@ -1,60 +1,67 @@ - - - + + light_draw-eraser.svg light_geometry.svg light_ox16-action-object-align-horizontal-center-calligra.svg light_ox16-action-object-align-horizontal-left-calligra.svg light_ox16-action-object-align-horizontal-right-calligra.svg light_ox16-action-object-align-vertical-bottom-calligra.svg light_ox16-action-object-align-vertical-center-calligra.svg light_ox16-action-object-align-vertical-top-calligra.svg light_ox16-action-object-order-back-calligra.svg light_ox16-action-object-order-front-calligra.svg light_ox16-action-object-order-lower-calligra.svg light_ox16-action-object-order-raise-calligra.svg light_ox16-action-object-group-calligra.svg light_ox16-action-object-ungroup-calligra.svg light_distribute-horizontal-center.svg light_distribute-horizontal-left.svg light_distribute-horizontal-right.svg light_distribute-horizontal.svg light_distribute-vertical-bottom.svg light_distribute-vertical-center.svg light_distribute-vertical-top.svg light_distribute-vertical.svg light_paintop_settings_01.svg light_paintop_settings_02.svg light_pivot-point.svg light_stroke-cap-butt.svg light_stroke-cap-round.svg light_stroke-cap-square.svg light_stroke-join-bevel.svg light_stroke-join-miter.svg light_stroke-join-round.svg light_symmetry-horizontal.svg light_symmetry-vertical.svg light_onionOff.svg light_onionOn.svg light_onion_skin_options.svg light_path-break-point.svg light_path-break-segment.svg light_pathpoint-corner.svg light_pathpoint-curve.svg light_pathpoint-insert.svg light_pathpoint-join.svg light_pathpoint-line.svg light_pathpoint-merge.svg light_pathpoint-remove.svg light_pathpoint-smooth.svg light_pathpoint-symmetric.svg light_pathsegment-curve.svg light_pathsegment-line.svg light_opacity-increase.svg light_opacity-decrease.svg light_lightness-increase.svg light_lightness-decrease.svg light_brushsize-increase.svg light_brushsize-decrease.svg + light_curve-preset-u.svg + light_curve-preset-s.svg + light_curve-preset-s-reverse.svg + light_curve-preset-linear.svg + light_curve-preset-linear-reverse.svg + light_curve-preset-l.svg + light_curve-preset-j.svg + light_curve-preset-arch.svg diff --git a/plugins/paintops/libpaintop/forms/wdgcurveoption.ui b/plugins/paintops/libpaintop/forms/wdgcurveoption.ui index c90610f93f..95a63635f6 100644 --- a/plugins/paintops/libpaintop/forms/wdgcurveoption.ui +++ b/plugins/paintops/libpaintop/forms/wdgcurveoption.ui @@ -1,262 +1,379 @@ WdgCurveOption 0 0 - 1110 - 658 + 632 + 443 - + 15 0 0 Strength: 0 0 20 20 16777215 16777215 + + + + Enable Pen Settings + + + 0 0 180 360 160 16777215 0 0 TextLabel Qt::Horizontal 40 20 0 0 TextLabel 1 0 0 230 0 0 TextLabel Qt::Vertical 20 40 0 0 TextLabel Share curve across all settings true - - - - Reset - - - Qt::Horizontal 40 20 - + Qt::Vertical 20 40 + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + + + + + + + + + 16 + 16 + + + + Ctrl+S + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + - - - - Enable Pen Settings - - - KisDoubleSliderSpinBox QWidget
kis_slider_spin_box.h
1
KisMultiSensorsSelector QWidget
kis_multi_sensors_selector.h
1
KisCurveWidget QWidget
widgets/kis_curve_widget.h
1
diff --git a/plugins/paintops/libpaintop/kis_curve_option_widget.cpp b/plugins/paintops/libpaintop/kis_curve_option_widget.cpp index 53a6e1e349..640ca9fada 100644 --- a/plugins/paintops/libpaintop/kis_curve_option_widget.cpp +++ b/plugins/paintops/libpaintop/kis_curve_option_widget.cpp @@ -1,194 +1,293 @@ /* This file is part of the KDE project * Copyright (C) 2008 Boudewijn Rempt * Copyright (C) 2009 Sven Langkamp * Copyright (C) 2011 Silvio Heinrich * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "kis_curve_option_widget.h" #include "ui_wdgcurveoption.h" #include "widgets/kis_curve_widget.h" #include "kis_dynamic_sensor.h" #include "kis_global.h" #include "kis_curve_option.h" #include "kis_signals_blocker.h" - +#include "kis_icon_utils.h" inline void setLabel(QLabel* label, const KisCurveLabel& curve_label) { if (curve_label.icon().isNull()) { label->setText(curve_label.name()); } else { label->setPixmap(QPixmap::fromImage(curve_label.icon())); } } KisCurveOptionWidget::KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider) : KisPaintOpOption(curveOption->category(), curveOption->isChecked()) , m_widget(new QWidget) , m_curveOptionWidget(new Ui_WdgCurveOption()) , m_curveOption(curveOption) { setObjectName("KisCurveOptionWidget"); m_curveOptionWidget->setupUi(m_widget); setConfigurationPage(m_widget); m_curveOptionWidget->sensorSelector->setCurveOption(curveOption); updateSensorCurveLabels(m_curveOptionWidget->sensorSelector->currentHighlighted()); updateCurve(m_curveOptionWidget->sensorSelector->currentHighlighted()); connect(m_curveOptionWidget->curveWidget, SIGNAL(modified()), this, SLOT(transferCurve())); connect(m_curveOptionWidget->sensorSelector, SIGNAL(parametersChanged()), SLOT(emitSettingChanged())); connect(m_curveOptionWidget->sensorSelector, SIGNAL(parametersChanged()), SLOT(updateLabelsOfCurrentSensor())); connect(m_curveOptionWidget->sensorSelector, SIGNAL(highlightedSensorChanged(KisDynamicSensorSP )), SLOT(updateSensorCurveLabels(KisDynamicSensorSP ))); connect(m_curveOptionWidget->sensorSelector, SIGNAL(highlightedSensorChanged(KisDynamicSensorSP )), SLOT(updateCurve(KisDynamicSensorSP ))); connect(m_curveOptionWidget->checkBoxUseSameCurve, SIGNAL(stateChanged(int)), SLOT(transferCurve())); - connect(m_curveOptionWidget->CurveResetButton, SIGNAL(clicked(bool)), this, SLOT(resetCurve())); + + + // set all the icons for the curve preset shapes + updateThemedIcons(); + + // various curve preset buttons with predefined curves + connect(m_curveOptionWidget->linearCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveLinear())); + connect(m_curveOptionWidget->revLinearButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveReverseLinear())); + connect(m_curveOptionWidget->jCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveJShape())); + connect(m_curveOptionWidget->lCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveLShape())); + connect(m_curveOptionWidget->sCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveSShape())); + connect(m_curveOptionWidget->reverseSCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveReverseSShape())); + connect(m_curveOptionWidget->uCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveUShape())); + connect(m_curveOptionWidget->revUCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveArchShape())); + m_curveOptionWidget->label_ymin->setText(minLabel); m_curveOptionWidget->label_ymax->setText(maxLabel); m_curveOptionWidget->slider->setRange(curveOption->minValue(), curveOption->maxValue(), 2); m_curveOptionWidget->slider->setValue(curveOption->value()); if (hideSlider) { m_curveOptionWidget->slider->hide(); m_curveOptionWidget->strengthLabel->hide(); } connect(m_curveOptionWidget->checkBoxUseCurve, SIGNAL(stateChanged(int)) , SLOT(updateValues())); connect(m_curveOptionWidget->slider, SIGNAL(valueChanged(qreal)), SLOT(updateValues())); } KisCurveOptionWidget::~KisCurveOptionWidget() { delete m_curveOption; delete m_curveOptionWidget; } void KisCurveOptionWidget::writeOptionSetting(KisPropertiesConfigurationSP setting) const { m_curveOption->writeOptionSetting(setting); } void KisCurveOptionWidget::readOptionSetting(const KisPropertiesConfigurationSP setting) { setting->dump(); m_curveOption->readOptionSetting(setting); m_curveOptionWidget->checkBoxUseCurve->setChecked(m_curveOption->isCurveUsed()); m_curveOptionWidget->slider->setValue(m_curveOption->value()); m_curveOptionWidget->checkBoxUseSameCurve->setChecked(m_curveOption->isSameCurveUsed()); disableWidgets(!m_curveOption->isCurveUsed()); m_curveOptionWidget->sensorSelector->reload(); m_curveOptionWidget->sensorSelector->setCurrent(m_curveOption->activeSensors().first()); updateSensorCurveLabels(m_curveOptionWidget->sensorSelector->currentHighlighted()); updateCurve(m_curveOptionWidget->sensorSelector->currentHighlighted()); } void KisCurveOptionWidget::lodLimitations(KisPaintopLodLimitations *l) const { m_curveOption->lodLimitations(l); } bool KisCurveOptionWidget::isCheckable() const { return m_curveOption->isCheckable(); } bool KisCurveOptionWidget::isChecked() const { return m_curveOption->isChecked(); } void KisCurveOptionWidget::setChecked(bool checked) { m_curveOption->setChecked(checked); } KisCurveOption* KisCurveOptionWidget::curveOption() { return m_curveOption; } QWidget* KisCurveOptionWidget::curveWidget() { return m_widget; } void KisCurveOptionWidget::transferCurve() { m_curveOptionWidget->sensorSelector->setCurrentCurve(m_curveOptionWidget->curveWidget->curve(), m_curveOptionWidget->checkBoxUseSameCurve->isChecked()); emitSettingChanged(); } void KisCurveOptionWidget::updateSensorCurveLabels(KisDynamicSensorSP sensor) { if (sensor) { m_curveOptionWidget->label_xmin->setText(KisDynamicSensor::minimumLabel(sensor->sensorType())); m_curveOptionWidget->label_xmax->setText(KisDynamicSensor::maximumLabel(sensor->sensorType(), sensor->length())); } } void KisCurveOptionWidget::updateCurve(KisDynamicSensorSP sensor) { if (sensor) { bool blockSignal = m_curveOptionWidget->curveWidget->blockSignals(true); m_curveOptionWidget->curveWidget->setCurve(sensor->curve()); m_curveOptionWidget->curveWidget->blockSignals(blockSignal); } } void KisCurveOptionWidget::updateLabelsOfCurrentSensor() { updateSensorCurveLabels(m_curveOptionWidget->sensorSelector->currentHighlighted()); updateCurve(m_curveOptionWidget->sensorSelector->currentHighlighted()); } void KisCurveOptionWidget::updateValues() { m_curveOption->setValue(m_curveOptionWidget->slider->value()); m_curveOption->setCurveUsed(m_curveOptionWidget->checkBoxUseCurve->isChecked()); disableWidgets(!m_curveOptionWidget->checkBoxUseCurve->isChecked()); emitSettingChanged(); } -void KisCurveOptionWidget::resetCurve() +void KisCurveOptionWidget::changeCurveLinear() +{ + QList points; + points.push_back(QPointF(0,0)); + points.push_back(QPointF(1,1)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + +void KisCurveOptionWidget::changeCurveReverseLinear() +{ + QList points; + points.push_back(QPointF(0,1)); + points.push_back(QPointF(1,0)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + +void KisCurveOptionWidget::changeCurveSShape() +{ + QList points; + points.push_back(QPointF(0,0)); + points.push_back(QPointF(0.25,0.1)); + points.push_back(QPointF(0.75,0.9)); + points.push_back(QPointF(1, 1)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + + +void KisCurveOptionWidget::changeCurveReverseSShape() +{ + QList points; + points.push_back(QPointF(0,1)); + points.push_back(QPointF(0.25,0.9)); + points.push_back(QPointF(0.75,0.1)); + points.push_back(QPointF(1,0)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + +void KisCurveOptionWidget::changeCurveJShape() { - m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve()); + QList points; + points.push_back(QPointF(0,0)); + points.push_back(QPointF(0.35,0.1)); + points.push_back(QPointF(1,1)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); } +void KisCurveOptionWidget::changeCurveLShape() +{ + QList points; + points.push_back(QPointF(0,1)); + points.push_back(QPointF(0.25,0.48)); + points.push_back(QPointF(1,0)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + +void KisCurveOptionWidget::changeCurveUShape() +{ + QList points; + points.push_back(QPointF(0,1)); + points.push_back(QPointF(0.5,0)); + points.push_back(QPointF(1,1)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + +void KisCurveOptionWidget::changeCurveArchShape() +{ + QList points; + points.push_back(QPointF(0,0)); + points.push_back(QPointF(0.5,1)); + points.push_back(QPointF(1,0)); + m_curveOptionWidget->curveWidget->setCurve(KisCubicCurve(points)); +} + + + + void KisCurveOptionWidget::disableWidgets(bool disable) { m_curveOptionWidget->checkBoxUseSameCurve->setDisabled(disable); m_curveOptionWidget->curveWidget->setDisabled(disable); m_curveOptionWidget->sensorSelector->setDisabled(disable); m_curveOptionWidget->label_xmax->setDisabled(disable); m_curveOptionWidget->label_xmin->setDisabled(disable); m_curveOptionWidget->label_ymax->setDisabled(disable); m_curveOptionWidget->label_ymin->setDisabled(disable); } + +void KisCurveOptionWidget::updateThemedIcons() +{ + // set all the icons for the curve preset shapes + m_curveOptionWidget->linearCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-linear")); + m_curveOptionWidget->revLinearButton->setIcon(KisIconUtils::loadIcon("curve-preset-linear-reverse")); + m_curveOptionWidget->jCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-j")); + m_curveOptionWidget->lCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-l")); + m_curveOptionWidget->sCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-s")); + m_curveOptionWidget->reverseSCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-s-reverse")); + m_curveOptionWidget->uCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-u")); + m_curveOptionWidget->revUCurveButton->setIcon(KisIconUtils::loadIcon("curve-preset-arch")); +} + diff --git a/plugins/paintops/libpaintop/kis_curve_option_widget.h b/plugins/paintops/libpaintop/kis_curve_option_widget.h index 315fb8af93..45bea06a09 100644 --- a/plugins/paintops/libpaintop/kis_curve_option_widget.h +++ b/plugins/paintops/libpaintop/kis_curve_option_widget.h @@ -1,68 +1,81 @@ /* This file is part of the KDE project * Copyright (C) 2008 Boudewijn Rempt * Copyright (C) 2009 Sven Langkamp * Copyright (C) 2011 Silvio Heinrich * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KIS_CURVE_OPTION_WIDGET_H #define KIS_CURVE_OPTION_WIDGET_H #include class Ui_WdgCurveOption; class KisCurveOption; #include class PAINTOP_EXPORT KisCurveOptionWidget : public KisPaintOpOption { Q_OBJECT public: KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider = false); ~KisCurveOptionWidget() override; void writeOptionSetting(KisPropertiesConfigurationSP setting) const override; void readOptionSetting(const KisPropertiesConfigurationSP setting) override; void lodLimitations(KisPaintopLodLimitations *l) const override; bool isCheckable() const override; bool isChecked() const override; void setChecked(bool checked) override; + void show(); protected: KisCurveOption* curveOption(); QWidget* curveWidget(); private Q_SLOTS: void transferCurve(); void updateSensorCurveLabels(KisDynamicSensorSP sensor); void updateCurve(KisDynamicSensorSP sensor); void updateValues(); - void resetCurve(); void updateLabelsOfCurrentSensor(); void disableWidgets(bool disable); + void updateThemedIcons(); + + + // curve shape preset buttons + void changeCurveLinear(); + void changeCurveReverseLinear(); + void changeCurveSShape(); + void changeCurveReverseSShape(); + void changeCurveJShape(); + void changeCurveLShape(); + void changeCurveUShape(); + void changeCurveArchShape(); + private: QWidget* m_widget; Ui_WdgCurveOption* m_curveOptionWidget; KisCurveOption* m_curveOption; }; #endif // KIS_CURVE_OPTION_WIDGET_H