diff --git a/plugins/paintops/libpaintop/kis_pressure_mirror_option_widget.cpp b/plugins/paintops/libpaintop/kis_pressure_mirror_option_widget.cpp index ce0d7fa8aa..1f5b975f96 100644 --- a/plugins/paintops/libpaintop/kis_pressure_mirror_option_widget.cpp +++ b/plugins/paintops/libpaintop/kis_pressure_mirror_option_widget.cpp @@ -1,81 +1,90 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * 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_pressure_mirror_option_widget.h" #include #include #include #include +#include #include #include "kis_pressure_mirror_option.h" KisPressureMirrorOptionWidget::KisPressureMirrorOptionWidget() : KisCurveOptionWidget(new KisPressureMirrorOption(), i18n("Not mirrored"), i18n("Mirrored")) { setObjectName("KisPressureMirrorOptionWidget"); QWidget* w = new QWidget; - m_horizontalMirror = new QCheckBox(i18n("Horizontally")); + m_horizontalMirror = new QCheckBox(i18n("Horizontal")); m_horizontalMirror->setChecked(false); - m_verticalMirror = new QCheckBox(i18n("Vertically")); + m_verticalMirror = new QCheckBox(i18n("Vertical")); m_verticalMirror->setChecked(false); connect(m_horizontalMirror, SIGNAL(toggled(bool)), SLOT(horizontalMirrorChanged(bool))); connect(m_verticalMirror, SIGNAL(toggled(bool)), SLOT(verticalMirrorChanged(bool))); + QLabel* directionLabel = new QLabel(i18n("Direction: ")); + QHBoxLayout* hl = new QHBoxLayout; + hl->setContentsMargins(9,9,9,0); // no bottom spacing + + hl->addWidget(directionLabel); hl->addWidget(m_horizontalMirror); hl->addWidget(m_verticalMirror); + hl->addStretch(1); + + QVBoxLayout* vl = new QVBoxLayout; vl->setMargin(0); vl->addLayout(hl); vl->addWidget(curveWidget()); w->setLayout(vl); setConfigurationPage(w); horizontalMirrorChanged(m_horizontalMirror->isChecked()); verticalMirrorChanged(m_verticalMirror->isChecked()); } void KisPressureMirrorOptionWidget::readOptionSetting(const KisPropertiesConfigurationSP setting) { KisCurveOptionWidget::readOptionSetting(setting); m_verticalMirror->setChecked(static_cast(curveOption())->isVerticalMirrorEnabled()); m_horizontalMirror->setChecked(static_cast(curveOption())->isHorizontalMirrorEnabled()); } void KisPressureMirrorOptionWidget::horizontalMirrorChanged(bool mirror) { static_cast(curveOption())->enableHorizontalMirror(mirror); emitSettingChanged(); } void KisPressureMirrorOptionWidget::verticalMirrorChanged(bool mirror) { static_cast(curveOption())->enableVerticalMirror(mirror); emitSettingChanged(); } diff --git a/plugins/paintops/libpaintop/kis_pressure_scatter_option_widget.cpp b/plugins/paintops/libpaintop/kis_pressure_scatter_option_widget.cpp index 3bcf114bfa..81130a6400 100644 --- a/plugins/paintops/libpaintop/kis_pressure_scatter_option_widget.cpp +++ b/plugins/paintops/libpaintop/kis_pressure_scatter_option_widget.cpp @@ -1,82 +1,85 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * 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 #include #include #include #include #include #include "kis_pressure_scatter_option.h" #include "kis_pressure_scatter_option_widget.h" KisPressureScatterOptionWidget::KisPressureScatterOptionWidget() : KisCurveOptionWidget(new KisPressureScatterOption(), i18n("0.0"), i18n("1.0")) { QWidget* w = new QWidget; - m_axisX = new QCheckBox(i18n("Axis X")); + m_axisX = new QCheckBox(i18n("X")); m_axisX->setChecked(true); - m_axisY = new QCheckBox(i18n("Axis Y")); + m_axisY = new QCheckBox(i18n("Y")); m_axisY->setChecked(true); - QLabel* scatterLbl = new QLabel(i18n("Scatter amount")); + QLabel* scatterLbl = new QLabel(i18n("Axis:")); QHBoxLayout* hl = new QHBoxLayout; + hl->setContentsMargins(9,9,9,0); // no bottom spacing + hl->setSpacing(6); hl->addWidget(scatterLbl); hl->addWidget(m_axisX); hl->addWidget(m_axisY); + hl->addStretch(1); // moves everything to the left QVBoxLayout* vl = new QVBoxLayout; vl->setMargin(0); vl->addLayout(hl); vl->addWidget(curveWidget()); w->setLayout(vl); connect(m_axisX, SIGNAL(toggled(bool)), SLOT(xAxisEnabled(bool))); connect(m_axisY, SIGNAL(toggled(bool)), SLOT(yAxisEnabled(bool))); setConfigurationPage(w); xAxisEnabled(m_axisX->isChecked()); yAxisEnabled(m_axisY->isChecked()); } void KisPressureScatterOptionWidget::readOptionSetting(const KisPropertiesConfigurationSP setting) { KisCurveOptionWidget::readOptionSetting(setting); m_axisX->setChecked(static_cast(curveOption())->isAxisXEnabled()); m_axisY->setChecked(static_cast(curveOption())->isAxisYEnabled()); } void KisPressureScatterOptionWidget::xAxisEnabled(bool enable) { static_cast(curveOption())->enableAxisX(enable); emitSettingChanged(); } void KisPressureScatterOptionWidget::yAxisEnabled(bool enable) { static_cast(curveOption())->enableAxisY(enable); emitSettingChanged(); } diff --git a/plugins/paintops/libpaintop/kis_pressure_sharpness_option_widget.cpp b/plugins/paintops/libpaintop/kis_pressure_sharpness_option_widget.cpp index 440513d00f..584247f1a1 100644 --- a/plugins/paintops/libpaintop/kis_pressure_sharpness_option_widget.cpp +++ b/plugins/paintops/libpaintop/kis_pressure_sharpness_option_widget.cpp @@ -1,68 +1,67 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * 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 #include #include #include #include #include #include #include "kis_curve_option_widget.h" #include "kis_pressure_sharpness_option.h" #include "kis_pressure_sharpness_option_widget.h" KisPressureSharpnessOptionWidget::KisPressureSharpnessOptionWidget(): KisCurveOptionWidget(new KisPressureSharpnessOption(), i18n("0.0"), i18n("1.0")) { setObjectName("KisPressureSharpnessOptionWidget"); - QLabel* thresholdLbl = new QLabel(i18n("Threshold:")); - m_threshold = new KisSliderSpinBox(); m_threshold->setRange(1, 100); m_threshold->setValue(40); m_threshold->setSingleStep(1); + m_threshold->setPrefix(i18n("Threshold:")); + m_threshold->setSuffix(i18n(" px")); QHBoxLayout* hl = new QHBoxLayout; - hl->addWidget(thresholdLbl); - hl->addWidget(m_threshold, 1); + hl->setContentsMargins(9,9,9,0); // no bottom spacing + hl->addWidget(m_threshold); QVBoxLayout* vl = new QVBoxLayout; - vl->setMargin(0); vl->addLayout(hl); vl->addWidget(KisCurveOptionWidget::curveWidget()); QWidget* w = new QWidget; w->setLayout(vl); KisCurveOptionWidget::setConfigurationPage(w); connect(m_threshold, SIGNAL(valueChanged(int)), this, SLOT(setThreshold(int))); setThreshold(m_threshold->value()); } void KisPressureSharpnessOptionWidget::setThreshold(int threshold) { static_cast(KisCurveOptionWidget::curveOption())->setThreshold(threshold); emitSettingChanged(); } diff --git a/plugins/paintops/libpaintop/kis_pressure_spacing_option_widget.cpp b/plugins/paintops/libpaintop/kis_pressure_spacing_option_widget.cpp index f38c243eb6..36a187031b 100644 --- a/plugins/paintops/libpaintop/kis_pressure_spacing_option_widget.cpp +++ b/plugins/paintops/libpaintop/kis_pressure_spacing_option_widget.cpp @@ -1,82 +1,83 @@ /* * Copyright (c) 2010 Lukáš Tvrdý * * 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 #include #include #include #include #include #include "kis_curve_option_widget.h" #include "kis_pressure_spacing_option.h" #include "kis_pressure_spacing_option_widget.h" KisPressureSpacingOptionWidget::KisPressureSpacingOptionWidget(): KisCurveOptionWidget(new KisPressureSpacingOption(), i18n("0%"), i18n("100%")) { m_isotropicSpacing = new QCheckBox(i18n("Isotropic Spacing")); m_useSpacingUpdates = new QCheckBox(i18n("Update Between Dabs")); QHBoxLayout *hl = new QHBoxLayout; + hl->setContentsMargins(9,9,9,0); // no bottom spacing hl->addWidget(m_isotropicSpacing); hl->addWidget(m_useSpacingUpdates); QVBoxLayout *vl = new QVBoxLayout; vl->setMargin(0); vl->addLayout(hl); vl->addWidget(KisCurveOptionWidget::curveWidget()); QWidget *w = new QWidget; w->setLayout(vl); KisCurveOptionWidget::setConfigurationPage(w); connect(m_isotropicSpacing, SIGNAL(stateChanged(int)), this, SLOT(setIsotropicSpacing(int))); connect(m_useSpacingUpdates, SIGNAL(stateChanged(int)), this, SLOT(setUseSpacingUpdates(int))); setIsotropicSpacing(false); } void KisPressureSpacingOptionWidget::readOptionSetting(const KisPropertiesConfigurationSP setting) { // First invoke superclass behavior. KisCurveOptionWidget::readOptionSetting(setting); KisPressureSpacingOption *option = dynamic_cast(curveOption()); m_isotropicSpacing->setChecked(option->isotropicSpacing()); m_useSpacingUpdates->setChecked(option->usingSpacingUpdates()); } void KisPressureSpacingOptionWidget::setIsotropicSpacing(int isotropic) { dynamic_cast(KisCurveOptionWidget::curveOption())->setIsotropicSpacing(isotropic); emitSettingChanged(); } void KisPressureSpacingOptionWidget::setUseSpacingUpdates(int useSpacingUpdates) { dynamic_cast(KisCurveOptionWidget::curveOption())->setUsingSpacingUpdates(useSpacingUpdates); emitSettingChanged(); }