Commit 92119d6c authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Add a warning to the Overlay option when Lightness mode is selected

Overlay mode is not supported with Lightness brushes.
parent 0901ad08
......@@ -61,7 +61,8 @@ KisColorSmudgeOpSettingsWidget::KisColorSmudgeOpSettingsWidget(QWidget* parent):
addPaintOpOption(new KisCurveOptionWidget(new KisPressureRotationOption(), i18n("-180°"), i18n("180°")), i18n("Rotation"));
addPaintOpOption(new KisPressureScatterOptionWidget(), i18n("Scatter"));
addPaintOpOption(new KisOverlayModeOptionWidget(), i18n("Overlay Mode"));
m_overlayOptionWidget = new KisOverlayModeOptionWidget();
addPaintOpOption(m_overlayOptionWidget, i18n("Overlay Mode"));
addPaintOpOption(new KisCurveOptionWidget(new KisPressureGradientOption(), i18n("0%"), i18n("100%")), i18n("Gradient"));
addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createHueOption(), KisPressureHSVOption::hueMinLabel(), KisPressureHSVOption::huemaxLabel()), i18n("Hue"));
addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createSaturationOption(), KisPressureHSVOption::saturationMinLabel(), KisPressureHSVOption::saturationmaxLabel()), i18n("Saturation"));
......@@ -101,6 +102,9 @@ void KisColorSmudgeOpSettingsWidget::notifyPageChanged()
}
m_lightnessStrengthOptionWidget->setEnabled(brush->preserveLightness());
m_overlayOptionWidget->setEnabled(brush->brushApplication() != LIGHTNESSMAP);
m_radiusStrengthOptionWidget->updateRange(0.0, m_smudgeOptionWidget->useNewEngine() ? 1.0 : 3.0);
}
}
......
......@@ -11,6 +11,7 @@
#include <kis_curve_option_widget.h>
class KisSmudgeOptionWidget;
class KisOverlayModeOptionWidget;
class KisColorSmudgeOpSettingsWidget : public KisBrushBasedPaintopOptionWidget
{
......@@ -32,7 +33,7 @@ private:
KisSmudgeOptionWidget *m_smudgeOptionWidget;
KisCurveOptionWidget* m_lightnessStrengthOptionWidget;
KisCurveOptionWidget* m_radiusStrengthOptionWidget;
KisOverlayModeOptionWidget* m_overlayOptionWidget;
};
......
......@@ -40,20 +40,45 @@ public:
}
};
#include <QVBoxLayout>
class KisOverlayModeOptionWidget: public KisOverlayModeOption
{
public:
KisOverlayModeOptionWidget() {
QLabel* label = new QLabel(
i18n("Paints on the current layer\n\
but uses all layers that are currently visible for smudge input\n\
NOTE: This mode is only able to work correctly with a fully opaque background")
);
label->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
setConfigurationPage(label);
QWidget *widget = new QWidget();
m_label = new QLabel(
i18n("Paints on the current layer\n"
"but uses all layers that are currently visible for smudge input\n"
"NOTE: This mode is only able to work correctly with a fully opaque background"),
widget);
m_label->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
m_disabledWarningLabel = new QLabel(
i18n("Disabled: overlay mode is not supported in Lightness mode of the brush"),
widget);
m_disabledWarningLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
QVBoxLayout *layout = new QVBoxLayout(widget);
layout->addWidget(m_disabledWarningLabel);
layout->addWidget(m_label, 1);
m_disabledWarningLabel->setVisible(false);
setConfigurationPage(widget);
}
void setEnabled(bool value) {
m_disabledWarningLabel->setVisible(!value);
m_label->setEnabled(value);
}
QLabel *m_label;
QLabel *m_disabledWarningLabel;
};
#endif // _KIS_OVERLAYMODE_OPTION_H_
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