Commit fddd1c1d authored by Sachin Jindal's avatar Sachin Jindal

Sliders added in Filter plugins to replace QSlider

parent d560b771
......@@ -17,7 +17,7 @@
#include <KisGlobalResourcesInterface.h>
KisDelayedActionDoubleInput::KisDelayedActionDoubleInput(QWidget * parent, const QString & name)
: KisDoubleParseSpinBox(parent)
: KisDoubleSliderSpinBox(parent)
{
setObjectName(name);
m_timer = new QTimer(this);
......
......@@ -13,10 +13,10 @@
#include <kis_config_widget.h>
#include "kritaui_export.h"
#include "kis_slider_spin_box.h"
#include "kis_double_parse_spin_box.h"
class KisDelayedActionDoubleInput : public KisDoubleParseSpinBox
class KisDelayedActionDoubleInput : public KisDoubleSliderSpinBox
{
Q_OBJECT
......
......@@ -16,7 +16,7 @@
#include <KisGlobalResourcesInterface.h>
KisDelayedActionIntegerInput::KisDelayedActionIntegerInput(QWidget * parent, const QString & name)
: KisIntParseSpinBox(parent)
: KisSliderSpinBox(parent)
{
setObjectName(name);
m_timer = new QTimer(this);
......
......@@ -12,12 +12,12 @@
#include <kis_debug.h>
#include <QVector>
#include <QSpinBox>
#include "kis_slider_spin_box.h"
#include "kis_int_parse_spin_box.h"
#include <vector>
class KisDelayedActionIntegerInput : public KisIntParseSpinBox
class KisDelayedActionIntegerInput : public KisSliderSpinBox
{
Q_OBJECT
......
......@@ -29,8 +29,8 @@ KisWdgBlur::KisWdgBlur(QWidget * parent) : KisConfigWidget(parent)
widget()->angleSelector->setDecimals(0);
connect(widget()->aspectButton, SIGNAL(keepAspectRatioChanged(bool)), this, SLOT(linkSpacingToggled(bool)));
connect(widget()->intHalfWidth, SIGNAL(valueChanged(int)), this, SLOT(spinBoxHalfWidthChanged(int)));
connect(widget()->intHalfHeight, SIGNAL(valueChanged(int)), this, SLOT(spinBoxHalfHeightChanged(int)));
connect(widget()->intHalfWidth, SIGNAL(valueChanged(int)), this, SLOT(sldHalfWidthChanged(int)));
connect(widget()->intHalfHeight, SIGNAL(valueChanged(int)), this, SLOT(sldHalfHeightChanged(int)));
connect(widget()->intStrength, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
connect(widget()->angleSelector, SIGNAL(angleChanged(qreal)), SIGNAL(sigConfigurationItemChanged()));
......@@ -83,10 +83,12 @@ void KisWdgBlur::linkSpacingToggled(bool b)
widget()->intHalfHeight->setValue(widget()->intHalfWidth->value());
}
void KisWdgBlur::spinBoxHalfWidthChanged(int v)
void KisWdgBlur::sldHalfWidthChanged(int v)
{
if (m_halfSizeLink) {
widget()->intHalfHeight->blockSignals(true);
widget()->intHalfHeight->setValue(v);
widget()->intHalfHeight->blockSignals(false);
}
/* if( widget()->intHalfHeight->value() == v && widget()->cbShape->currentItem() != 1)
widget()->intAngle->setEnabled(false);
......@@ -95,10 +97,12 @@ void KisWdgBlur::spinBoxHalfWidthChanged(int v)
emit sigConfigurationItemChanged();
}
void KisWdgBlur::spinBoxHalfHeightChanged(int v)
void KisWdgBlur::sldHalfHeightChanged(int v)
{
if (m_halfSizeLink) {
widget()->intHalfWidth->blockSignals(true);
widget()->intHalfWidth->setValue(v);
widget()->intHalfWidth->blockSignals(false);
}
/* if( widget()->intHalfWidth->value() == v && widget()->cbShape->currentItem() != 1)
widget()->intAngle->setEnabled(false);
......
......@@ -28,8 +28,8 @@ public:
private Q_SLOTS:
void linkSpacingToggled(bool);
void spinBoxHalfWidthChanged(int);
void spinBoxHalfHeightChanged(int);
void sldHalfWidthChanged(int);
void sldHalfHeightChanged(int);
private:
......
......@@ -78,22 +78,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KisIntParseSpinBox" name="irisRadiusSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>256</number>
</property>
<property name="label" stdset="0">
<string>Radius:</string>
</property>
<property name="sliderEnabled" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
......@@ -104,6 +88,16 @@
<item row="2" column="1">
<widget class="KisAngleSelector" name="irisRotationSelector" native="true"/>
</item>
<item row="1" column="1">
<widget class="KisSliderSpinBox" name="irisRadiusSlider" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -124,9 +118,10 @@
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_int_parse_spin_box.h</header>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header>kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisAngleSelector</class>
......@@ -137,7 +132,6 @@
</customwidgets>
<tabstops>
<tabstop>irisShapeCombo</tabstop>
<tabstop>irisRadiusSlider</tabstop>
</tabstops>
<resources/>
<connections/>
......
......@@ -31,19 +31,19 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisAngleSelector" name="blurAngleSelector" native="true"/>
</item>
<item row="1" column="1">
<widget class="KisIntParseSpinBox" name="blurLength">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>256</number>
<widget class="KisSliderSpinBox" name="blurLength" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisAngleSelector" name="blurAngleSelector" native="true"/>
</item>
</layout>
</item>
<item>
......@@ -66,9 +66,10 @@
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_int_parse_spin_box.h</header>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header>kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisAngleSelector</class>
......@@ -77,9 +78,6 @@
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>blurLength</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
......@@ -27,32 +27,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="textLabel5">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Angle:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KisIntParseSpinBox" name="intStrength">
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel2">
<property name="text">
......@@ -66,39 +40,10 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KisIntParseSpinBox" name="intHalfHeight">
<property name="suffix">
<string> px</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<item row="4" column="0">
<widget class="QLabel" name="textLabel4">
<property name="text">
<string>Horizontal Radius:</string>
<string>Shape:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -108,10 +53,13 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel4">
<item row="3" column="0">
<widget class="QLabel" name="textLabel5">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Shape:</string>
<string>Angle:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -121,19 +69,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisIntParseSpinBox" name="intHalfWidth">
<property name="suffix">
<string> px</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="KComboBox" name="cbShape">
<item>
......@@ -180,24 +115,51 @@
</property>
</widget>
</item>
<item row="4" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="3" column="1">
<widget class="KisAngleSelector" name="angleSelector" native="true"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Horizontal Radius:</string>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
<property name="wordWrap">
<bool>false</bool>
</property>
</spacer>
</widget>
</item>
<item row="3" column="1">
<widget class="KisAngleSelector" name="angleSelector" native="true"/>
<item row="2" column="1">
<widget class="KisSliderSpinBox" name="intStrength" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KisSliderSpinBox" name="intHalfHeight" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisSliderSpinBox" name="intHalfWidth" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
......@@ -208,22 +170,23 @@
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KoAspectButton</class>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header>KoAspectButton.h</header>
<header>kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_int_parse_spin_box.h</header>
</customwidget>
<customwidget>
<class>KisAngleSelector</class>
<extends>QWidget</extends>
<header location="global">KisAngleSelector.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KoAspectButton</class>
<extends>QWidget</extends>
<header>KoAspectButton.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>
SPDX-FileCopyrightText: none
......@@ -52,8 +52,8 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Exposure:</string>
......@@ -66,16 +66,13 @@
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sliderExposure">
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="1">
<widget class="KisSliderSpinBox" name="sliderExposure" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
......@@ -99,6 +96,14 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header>kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
\ No newline at end of file
</ui>
......@@ -21,7 +21,8 @@ KisWdgGaussianHighPass::KisWdgGaussianHighPass(QWidget * parent) : KisConfigWidg
{
m_widget = new Ui_WdgGaussianHighPass();
m_widget->setupUi(this);
widget()->doubleblurAmount->setRange(0.0, 250.0, 2);
widget()->doubleblurAmount->setSingleStep(1.00);
connect(widget()->doubleblurAmount, SIGNAL(valueChanged(double)), SIGNAL(sigConfigurationItemChanged()));
}
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>
SPDX-FileCopyrightText: none
......@@ -14,8 +14,14 @@
<height>167</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item column="0" row="0">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
......@@ -34,36 +40,7 @@
</property>
</widget>
</item>
<item column="2" row="0" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item column="1" row="0">
<widget class="KisDoubleParseSpinBox" name="doubleblurAmount">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<double>250.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item colspan="2" column="0" row="2">
<item row="1" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -79,15 +56,26 @@
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="KisDoubleSliderSpinBox" name="doubleblurAmount" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisDoubleParseSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>kis_double_parse_spin_box.h</header>
<class>KisDoubleSliderSpinBox</class>
<extends>QWidget</extends>
<header>kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
\ No newline at end of file
</ui>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>
SPDX-FileCopyrightText: none
......@@ -11,10 +11,10 @@
<x>0</x>
<y>0</y>
<width>174</width>
<height>66</height>
<height>76</height>
</rect>
</property>
<layout class="QGridLayout">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
......@@ -27,10 +27,10 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item column="0" row="1">
<widget class="QLabel" name="textLabel2">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Opacity:</string>
<string>Level:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -40,10 +40,20 @@
</property>
</widget>
</item>
<item column="0" row="0">
<widget class="QLabel" name="textLabel1">