diff --git a/plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp b/plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp index c3c8ca6335..2dcee3099e 100644 --- a/plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp +++ b/plugins/paintops/deform/kis_deform_paintop_settings_widget.cpp @@ -1,63 +1,63 @@ /* * Copyright (c) 2008,2009,2010 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_deform_paintop_settings.h" #include "kis_deform_paintop_settings_widget.h" #include "kis_deform_option.h" #include #include #include #include #include #include #include #include #include KisDeformPaintOpSettingsWidget::KisDeformPaintOpSettingsWidget(QWidget* parent) : KisPaintOpSettingsWidget(parent) { m_deformOption = new KisDeformOption(); m_brushSizeOption = new KisBrushSizeOption(); m_brushSizeOption->setDiameter(200); addPaintOpOption(m_brushSizeOption, i18n("Brush size")); addPaintOpOption(m_deformOption, i18n("Deform Options")); addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureOpacityOption(), i18n("Transparent"), i18n("Opaque")), i18n("Opacity")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureSizeOption(), i18n("0%"), i18n("100%")), i18n("Size")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRotationOption(), i18n("-180°"), i18n("180°")), i18n("Rotation")); - addPaintOpOption(new KisAirbrushOption(), i18n("Airbrush")); + addPaintOpOption(new KisAirbrushOption(false), i18n("Airbrush")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); } KisDeformPaintOpSettingsWidget::~ KisDeformPaintOpSettingsWidget() { } KisPropertiesConfigurationSP KisDeformPaintOpSettingsWidget::configuration() const { KisDeformPaintOpSettings* config = new KisDeformPaintOpSettings(); config->setOptionsWidget(const_cast(this)); config->setProperty("paintop", "deformBrush"); writeConfiguration(config); return config; } diff --git a/plugins/paintops/dynadraw/kis_dyna_paintop_settings_widget.cpp b/plugins/paintops/dynadraw/kis_dyna_paintop_settings_widget.cpp index 9b35aed227..c5a236becb 100644 --- a/plugins/paintops/dynadraw/kis_dyna_paintop_settings_widget.cpp +++ b/plugins/paintops/dynadraw/kis_dyna_paintop_settings_widget.cpp @@ -1,53 +1,53 @@ /* * Copyright (c) 2009-2010 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_dyna_paintop_settings_widget.h" #include "kis_dynaop_option.h" #include "kis_dyna_paintop_settings.h" #include #include #include #include #include #include #include KisDynaPaintOpSettingsWidget:: KisDynaPaintOpSettingsWidget(QWidget* parent) : KisPaintOpSettingsWidget(parent) { addPaintOpOption(new KisDynaOpOption(), i18n("Brush size")); addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode")); - addPaintOpOption(new KisAirbrushOption(), i18n("Airbrush")); + addPaintOpOption(new KisAirbrushOption(false, false), i18n("Airbrush")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); addPaintOpOption(new KisPaintActionTypeOption(), i18n("Painting Mode")); } KisDynaPaintOpSettingsWidget::~ KisDynaPaintOpSettingsWidget() { } KisPropertiesConfigurationSP KisDynaPaintOpSettingsWidget::configuration() const { KisDynaPaintOpSettings* config = new KisDynaPaintOpSettings(); config->setOptionsWidget(const_cast(this)); config->setProperty("paintop", "dynabrush"); // XXX: make this a const id string writeConfiguration(config); return config; } diff --git a/plugins/paintops/libpaintop/kis_airbrush_option.cpp b/plugins/paintops/libpaintop/kis_airbrush_option.cpp index 3fbd7173e5..4062df68da 100644 --- a/plugins/paintops/libpaintop/kis_airbrush_option.cpp +++ b/plugins/paintops/libpaintop/kis_airbrush_option.cpp @@ -1,81 +1,84 @@ /* * Copyright (c) 2008 Boudewijn Rempt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_airbrush_option.h" #include "kis_paintop_settings.h" #include #include #include #include "ui_wdgairbrush.h" const qreal MINIMUM_RATE = 0.0; const qreal MAXIMUM_RATE = 1000.0; const int RATE_NUM_DECIMALS = 2; const qreal RATE_EXPONENT_RATIO = 3.0; const qreal RATE_SINGLE_STEP = 1.0; const qreal DEFAULT_RATE = 20.0; class KisAirbrushWidget: public QWidget, public Ui::WdgAirbrush { public: - KisAirbrushWidget(QWidget *parent = 0) + KisAirbrushWidget(QWidget *parent = 0, bool canIgnoreSpacing = true) : QWidget(parent) { setupUi(this); sliderRate->setRange(MINIMUM_RATE, MAXIMUM_RATE, RATE_NUM_DECIMALS); sliderRate->setExponentRatio(RATE_EXPONENT_RATIO); sliderRate->setSingleStep(RATE_SINGLE_STEP); sliderRate->setValue(DEFAULT_RATE); + + checkBoxIgnoreSpacing->setVisible(canIgnoreSpacing); + checkBoxIgnoreSpacing->setEnabled(canIgnoreSpacing); } }; -KisAirbrushOption::KisAirbrushOption(bool enabled) +KisAirbrushOption::KisAirbrushOption(bool enabled, bool canIgnoreSpacing) : KisPaintOpOption(KisPaintOpOption::COLOR, enabled) { setObjectName("KisAirBrushOption"); m_checkable = true; - m_optionWidget = new KisAirbrushWidget(); + m_optionWidget = new KisAirbrushWidget(nullptr, canIgnoreSpacing); connect(m_optionWidget->sliderRate, SIGNAL(valueChanged(qreal)), SLOT(emitSettingChanged())); connect(m_optionWidget->checkBoxIgnoreSpacing, SIGNAL(toggled(bool)), SLOT(emitSettingChanged())); setConfigurationPage(m_optionWidget); } KisAirbrushOption::~KisAirbrushOption() { } void KisAirbrushOption::writeOptionSetting(KisPropertiesConfigurationSP setting) const { setting->setProperty(AIRBRUSH_ENABLED, isChecked()); setting->setProperty(AIRBRUSH_RATE, m_optionWidget->sliderRate->value()); setting->setProperty(AIRBRUSH_IGNORE_SPACING, m_optionWidget->checkBoxIgnoreSpacing->isChecked()); } void KisAirbrushOption::readOptionSetting(const KisPropertiesConfigurationSP setting) { setChecked(setting->getBool(AIRBRUSH_ENABLED)); m_optionWidget->sliderRate->setValue(setting->getDouble(AIRBRUSH_RATE, DEFAULT_RATE)); m_optionWidget->checkBoxIgnoreSpacing->setChecked(setting->getBool(AIRBRUSH_IGNORE_SPACING, false)); } diff --git a/plugins/paintops/libpaintop/kis_airbrush_option.h b/plugins/paintops/libpaintop/kis_airbrush_option.h index 3b7fa9b77f..6ceeb43bb1 100644 --- a/plugins/paintops/libpaintop/kis_airbrush_option.h +++ b/plugins/paintops/libpaintop/kis_airbrush_option.h @@ -1,44 +1,44 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KIS_AIRBRUSH_OPTION_H #define KIS_AIRBRUSH_OPTION_H #include #include class KisAirbrushWidget; /** * Allows the user to activate airbrushing of the brush mask (brush is painted at the same position over and over) * Rate is set in miliseconds. */ class PAINTOP_EXPORT KisAirbrushOption : public KisPaintOpOption { public: - KisAirbrushOption(bool enabled = true); + KisAirbrushOption(bool enabled = true, bool canIgnoreSpacing = true); ~KisAirbrushOption() override; void writeOptionSetting(KisPropertiesConfigurationSP setting) const override; void readOptionSetting(const KisPropertiesConfigurationSP setting) override; private: KisAirbrushWidget * m_optionWidget; }; #endif diff --git a/plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp b/plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp index 537e398b6a..a5d87f7223 100644 --- a/plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp +++ b/plugins/paintops/particle/kis_particle_paintop_settings_widget.cpp @@ -1,56 +1,56 @@ /* * Copyright (c) 2008 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_particle_paintop_settings_widget.h" #include "kis_particleop_option.h" #include "kis_particle_paintop_settings.h" #include #include #include #include #include #include KisParticlePaintOpSettingsWidget:: KisParticlePaintOpSettingsWidget(QWidget* parent) : KisPaintOpSettingsWidget(parent) { m_paintActionTypeOption = new KisPaintActionTypeOption(); m_particleOption = new KisParticleOpOption(); addPaintOpOption(m_particleOption, i18n("Brush size")); addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode")); - addPaintOpOption(new KisAirbrushOption(), i18n("Airbrush")); + addPaintOpOption(new KisAirbrushOption(false, false), i18n("Airbrush")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); addPaintOpOption(m_paintActionTypeOption, i18n("Painting Mode")); } KisParticlePaintOpSettingsWidget::~ KisParticlePaintOpSettingsWidget() { } KisPropertiesConfigurationSP KisParticlePaintOpSettingsWidget::configuration() const { KisParticlePaintOpSettings* config = new KisParticlePaintOpSettings(); config->setOptionsWidget(const_cast(this)); config->setProperty("paintop", "particlebrush"); // XXX: make this a const id string writeConfiguration(config); return config; } diff --git a/plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp b/plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp index bc1aac63b7..365d9698f0 100644 --- a/plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp +++ b/plugins/paintops/sketch/kis_sketch_paintop_settings_widget.cpp @@ -1,88 +1,88 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_sketch_paintop_settings_widget.h" #include "kis_sketchop_option.h" #include "kis_sketch_paintop_settings.h" #include #include #include #include #include #include #include #include #include #include #include #include "kis_density_option.h" #include "kis_linewidth_option.h" #include "kis_offset_scale_option.h" KisSketchPaintOpSettingsWidget::KisSketchPaintOpSettingsWidget(QWidget* parent) : KisBrushBasedPaintopOptionWidget(parent) { m_sketchOption = new KisSketchOpOption(); addPaintOpOption(m_sketchOption, i18n("Brush size")); addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureOpacityOption(), i18n("Transparent"), i18n("Opaque")), i18n("Opacity")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureSizeOption(), i18n("0%"), i18n("100%")), i18n("Size")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRotationOption(), i18n("-180°"), i18n("180°")), i18n("Rotation")); addPaintOpOption(new KisCurveOptionWidget(new KisLineWidthOption() , i18n("0%"), i18n("100%")), i18n("Line width")); addPaintOpOption(new KisCurveOptionWidget(new KisOffsetScaleOption(), i18n("0%"), i18n("100%")), i18n("Offset scale")); addPaintOpOption(new KisCurveOptionWidget(new KisDensityOption(), i18n("0%"), i18n("100%")), i18n("Density")); - addPaintOpOption(new KisAirbrushOption(false), i18n("Airbrush")); + addPaintOpOption(new KisAirbrushOption(false, false), i18n("Airbrush")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); m_paintActionType = new KisPaintActionTypeOption(); KisPropertiesConfigurationSP defaultSetting = new KisPropertiesConfiguration(); defaultSetting->setProperty("PaintOpAction", BUILDUP); m_paintActionType->readOptionSetting(defaultSetting); addPaintOpOption(m_paintActionType, i18n("Painting Mode")); KisPropertiesConfigurationSP reconfigurationCourier = configuration(); QDomDocument xMLAnalyzer; xMLAnalyzer.setContent(reconfigurationCourier->getString("brush_definition")); QDomElement firstTag = xMLAnalyzer.documentElement(); QDomElement firstTagsChild = firstTag.elementsByTagName("MaskGenerator").item(0).toElement(); firstTagsChild.attributeNode("diameter").setValue("128"); reconfigurationCourier->setProperty("brush_definition", xMLAnalyzer.toString()); setConfiguration(reconfigurationCourier); } KisSketchPaintOpSettingsWidget::~ KisSketchPaintOpSettingsWidget() { } KisPropertiesConfigurationSP KisSketchPaintOpSettingsWidget::configuration() const { KisSketchPaintOpSettingsSP config = new KisSketchPaintOpSettings(); config->setOptionsWidget(const_cast(this)); config->setProperty("paintop", "sketchbrush"); // XXX: make this a const id string writeConfiguration(config); return config; } diff --git a/plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp b/plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp index 1970375f79..05ace53f44 100644 --- a/plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp +++ b/plugins/paintops/spray/kis_spray_paintop_settings_widget.cpp @@ -1,69 +1,69 @@ /* * Copyright (c) 2008,2009,2010 Lukáš Tvrdý * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_spray_paintop_settings_widget.h" #include "kis_sprayop_option.h" #include "kis_spray_paintop_settings.h" #include "kis_spray_shape_option.h" #include #include #include #include #include #include #include #include #include #include "kis_spray_shape_dynamics.h" #include #include KisSprayPaintOpSettingsWidget:: KisSprayPaintOpSettingsWidget(QWidget* parent) : KisPaintOpSettingsWidget(parent) , m_sprayArea(new KisSprayOpOption()) { addPaintOpOption(m_sprayArea, i18n("Spray Area")); addPaintOpOption(new KisSprayShapeOption(), i18n("Spray shape")); addPaintOpOption(new KisBrushOptionWidget(), i18n("Brush Tip")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureOpacityOption(), i18n("Transparent"), i18n("Opaque")), i18n("Opacity")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureSizeOption(), i18n("0%"), i18n("100%")), i18n("Size")); addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode")); addPaintOpOption(new KisSprayShapeDynamicsOption(), i18n("Shape dynamics")); addPaintOpOption(new KisColorOption(), i18n("Color options")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRotationOption(), i18n("-180°"), i18n("180°")), i18n("Rotation")); - addPaintOpOption(new KisAirbrushOption(), i18n("Airbrush")); + addPaintOpOption(new KisAirbrushOption(false), i18n("Airbrush")); addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate")); addPaintOpOption(new KisPaintActionTypeOption(), i18n("Painting Mode")); } KisSprayPaintOpSettingsWidget::~ KisSprayPaintOpSettingsWidget() { } KisPropertiesConfigurationSP KisSprayPaintOpSettingsWidget::configuration() const { KisSprayPaintOpSettings* config = new KisSprayPaintOpSettings(); config->setOptionsWidget(const_cast(this)); config->setProperty("paintop", "spraybrush"); // XXX: make this a const id string writeConfiguration(config); return config; }