[numerical boxes] assert that all the functions from the image and layer menu use numerical boxes.

The only exception is the color background selection box. (Qt native)
The singly problem that have been found is in some layer effect panels, the
value of some spinboxes was reset by some QDial and the expression was
transformed in the actual value before it was possible to write the end of it.

The solution is to adapt a little the setValues slots in the parsespinboxes.
parent ee796f6d
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>266</height>
<width>411</width>
<height>294</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
......@@ -49,7 +49,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>&amp;Opacity:</string>
<string>Opac&amp;ity:</string>
</property>
<property name="buddy">
<cstring>intOpacity</cstring>
......@@ -81,7 +81,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Gradient:</string>
<string>&amp;Gradient:</string>
</property>
<property name="buddy">
<cstring>cmbGradient</cstring>
......@@ -194,7 +194,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="intAngle">
<widget class="KisIntParseSpinBox" name="intAngle">
<property name="minimum">
<number>-179</number>
</property>
......@@ -260,9 +260,9 @@
</widget>
<customwidgets>
<customwidget>
<class>KisCompositeOpComboBox</class>
<extends>QComboBox</extends>
<header location="global">kis_cmb_composite.h</header>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
......@@ -270,6 +270,11 @@
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisCompositeOpComboBox</class>
<extends>QComboBox</extends>
<header location="global">kis_cmb_composite.h</header>
</customwidget>
<customwidget>
<class>KisCmbGradient</class>
<extends>QToolButton</extends>
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>337</height>
<height>345</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
......@@ -60,7 +60,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>&amp;Opacity:</string>
<string>Opaci&amp;ty:</string>
</property>
<property name="buddy">
<cstring>intOpacity</cstring>
......@@ -95,7 +95,7 @@
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Angle:</string>
<string>An&amp;gle:</string>
</property>
<property name="buddy">
<cstring>dialAngle</cstring>
......@@ -121,7 +121,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="intAngle">
<widget class="KisIntParseSpinBox" name="intAngle">
<property name="minimum">
<number>-179</number>
</property>
......@@ -155,7 +155,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Size:</string>
<string>S&amp;ize:</string>
</property>
<property name="buddy">
<cstring>intSize</cstring>
......@@ -246,6 +246,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
......@@ -257,12 +268,6 @@
<extends>QComboBox</extends>
<header location="global">kis_cmb_composite.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisCmbContour</class>
<extends>QWidget</extends>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>471</height>
<width>399</width>
<height>541</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -26,7 +26,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Style:</string>
<string>St&amp;yle:</string>
</property>
<property name="buddy">
<cstring>cmbStyle</cstring>
......@@ -114,7 +114,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="KisSliderSpinBox" name="intDepth">
<widget class="KisSliderSpinBox" name="intDepth" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -161,7 +161,7 @@
</widget>
</item>
<item row="4" column="1">
<widget class="KisSliderSpinBox" name="intSize">
<widget class="KisSliderSpinBox" name="intSize" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -173,7 +173,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Sof&amp;ten:</string>
<string>So&amp;ften:</string>
</property>
<property name="buddy">
<cstring>intSoften</cstring>
......@@ -181,7 +181,7 @@
</widget>
</item>
<item row="5" column="1">
<widget class="KisSliderSpinBox" name="intSoften">
<widget class="KisSliderSpinBox" name="intSoften" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -228,7 +228,7 @@
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="intAngle">
<widget class="KisIntParseSpinBox" name="intAngle">
<property name="minimum">
<number>-179</number>
</property>
......@@ -260,7 +260,7 @@
</layout>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="intAltitude">
<widget class="KisIntParseSpinBox" name="intAltitude">
<property name="minimum">
<number>-179</number>
</property>
......@@ -272,7 +272,7 @@
<item row="2" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Gloss Contour:</string>
<string>&amp;Gloss Contour:</string>
</property>
<property name="buddy">
<cstring>cmbContour</cstring>
......@@ -335,7 +335,7 @@
</widget>
</item>
<item row="4" column="2">
<widget class="KisSliderSpinBox" name="intOpacity">
<widget class="KisSliderSpinBox" name="intOpacity" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
......@@ -388,7 +388,7 @@
</widget>
</item>
<item row="6" column="2">
<widget class="KisSliderSpinBox" name="intOpacity2">
<widget class="KisSliderSpinBox" name="intOpacity2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
......@@ -454,6 +454,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
......@@ -465,12 +476,6 @@
<extends>QComboBox</extends>
<header location="global">kis_cmb_composite.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>367</width>
<height>350</height>
<width>435</width>
<height>390</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
......@@ -99,7 +99,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Ble&amp;nd Mode:</string>
<string>&amp;Blend Mode:</string>
</property>
<property name="buddy">
<cstring>cmbCompositeOp</cstring>
......@@ -125,7 +125,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>&amp;Opacity:</string>
<string>Opaci&amp;ty:</string>
</property>
<property name="buddy">
<cstring>intOpacity</cstring>
......@@ -157,7 +157,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Angle:</string>
<string>An&amp;gle:</string>
</property>
<property name="buddy">
<cstring>dialAngle</cstring>
......@@ -183,7 +183,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="intAngle">
<widget class="KisIntParseSpinBox" name="intAngle">
<property name="minimum">
<number>-179</number>
</property>
......@@ -247,7 +247,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Size:</string>
<string>S&amp;ize:</string>
</property>
<property name="buddy">
<cstring>intSize</cstring>
......@@ -286,6 +286,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
......@@ -297,12 +308,6 @@
<extends>QComboBox</extends>
<header location="global">kis_cmb_composite.h</header>
</customwidget>
<customwidget>
<class>KisSliderSpinBox</class>
<extends>QWidget</extends>
<header location="global">kis_slider_spin_box.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KisCmbContour</class>
<extends>QWidget</extends>
......
......@@ -163,6 +163,11 @@ void KisDoubleParseSpinBox::setValue(double value)
if (!hasFocus()) {
clearError();
}
if(value == _oldValue && hasFocus()){ //avoid to reset the button when it set the value of something that will recall this slot.
return;
}
QDoubleSpinBox::setValue(value);
}
......
......@@ -170,6 +170,10 @@ void KisIntParseSpinBox::setValue(int val)
clearError();
}
if(val == _oldVal && hasFocus()){ //avoid to reset the button when it set the value of something that will recall this slot.
return;
}
QSpinBox::setValue(val);
}
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>644</width>
<width>710</width>
<height>174</height>
</rect>
</property>
......@@ -139,10 +139,10 @@
</spacer>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="numNegativeColumns"/>
<widget class="KisIntParseSpinBox" name="numNegativeColumns"/>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="numPositiveColumns">
<widget class="KisIntParseSpinBox" name="numPositiveColumns">
<property name="minimum">
<number>1</number>
</property>
......@@ -168,7 +168,7 @@
</spacer>
</item>
<item row="1" column="5">
<widget class="QSpinBox" name="columnXOffset">
<widget class="KisIntParseSpinBox" name="columnXOffset">
<property name="suffix">
<string>px</string>
</property>
......@@ -181,7 +181,7 @@
</widget>
</item>
<item row="1" column="6">
<widget class="QSpinBox" name="columnYOffset">
<widget class="KisIntParseSpinBox" name="columnYOffset">
<property name="suffix">
<string>px</string>
</property>
......@@ -220,10 +220,10 @@
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="numNegativeRows"/>
<widget class="KisIntParseSpinBox" name="numNegativeRows"/>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="numPositiveRows">
<widget class="KisIntParseSpinBox" name="numPositiveRows">
<property name="minimum">
<number>1</number>
</property>
......@@ -233,7 +233,7 @@
</widget>
</item>
<item row="2" column="5">
<widget class="QSpinBox" name="rowXOffset">
<widget class="KisIntParseSpinBox" name="rowXOffset">
<property name="suffix">
<string>px</string>
</property>
......@@ -246,7 +246,7 @@
</widget>
</item>
<item row="2" column="6">
<widget class="QSpinBox" name="rowYOffset">
<widget class="KisIntParseSpinBox" name="rowYOffset">
<property name="suffix">
<string>px</string>
</property>
......@@ -259,7 +259,7 @@
</widget>
</item>
<item row="1" column="9">
<widget class="QDoubleSpinBox" name="columnAngle">
<widget class="KisDoubleParseSpinBox" name="columnAngle">
<property name="suffix">
<string notr="true">°</string>
</property>
......@@ -272,7 +272,7 @@
</widget>
</item>
<item row="2" column="9">
<widget class="QDoubleSpinBox" name="rowAngle">
<widget class="KisDoubleParseSpinBox" name="rowAngle">
<property name="suffix">
<string notr="true">°</string>
</property>
......@@ -285,7 +285,7 @@
</widget>
</item>
<item row="1" column="8">
<widget class="QDoubleSpinBox" name="columnDistance">
<widget class="KisDoubleParseSpinBox" name="columnDistance">
<property name="suffix">
<string>px</string>
</property>
......@@ -295,7 +295,7 @@
</widget>
</item>
<item row="2" column="8">
<widget class="QDoubleSpinBox" name="rowDistance">
<widget class="KisDoubleParseSpinBox" name="rowDistance">
<property name="suffix">
<string>px</string>
</property>
......@@ -348,6 +348,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisDoubleParseSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>kis_doubleparsespinbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>numNegativeColumns</tabstop>
<tabstop>numNegativeRows</tabstop>
......
......@@ -29,7 +29,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="intHorizontalSplitLines"/>
<widget class="KisIntParseSpinBox" name="intHorizontalSplitLines"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblVerticalSplitLines">
......@@ -42,7 +42,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="intVerticalSplitLines"/>
<widget class="KisIntParseSpinBox" name="intVerticalSplitLines"/>
</item>
</layout>
</item>
......@@ -112,6 +112,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -6,13 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>333</width>
<height>86</height>
<width>364</width>
<height>89</height>
</rect>
</property>
<layout class="QGridLayout">
<item row="1" column="2">
<widget class="QSpinBox" name="spbWidth">
<widget class="KisIntParseSpinBox" name="spbWidth">
<property name="minimum">
<number>1</number>
</property>
......@@ -25,7 +25,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="spbWidthDouble">
<widget class="KisDoubleParseSpinBox" name="spbWidthDouble">
<property name="decimals">
<number>4</number>
</property>
......@@ -119,6 +119,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisDoubleParseSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>kis_doubleparsespinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>86</height>
<width>372</width>
<height>89</height>
</rect>
</property>
<layout class="QGridLayout">
......@@ -54,7 +54,7 @@
</spacer>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="spbRadius">
<widget class="KisIntParseSpinBox" name="spbRadius">
<property name="minimum">
<number>1</number>
</property>
......@@ -67,7 +67,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="spbRadiusDouble">
<widget class="KisDoubleParseSpinBox" name="spbRadiusDouble">
<property name="decimals">
<number>4</number>
</property>
......@@ -122,6 +122,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisDoubleParseSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>kis_doubleparsespinbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>spbRadius</tabstop>
<tabstop>spbRadiusDouble</tabstop>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>302</width>
<height>86</height>
<width>327</width>
<height>89</height>
</rect>
</property>
<layout class="QGridLayout">
......@@ -57,7 +57,7 @@
</spacer>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="spbGrowValue">
<widget class="KisIntParseSpinBox" name="spbGrowValue">
<property name="minimum">
<number>1</number>
</property>
......@@ -70,7 +70,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="spbGrowValueDouble">
<widget class="KisDoubleParseSpinBox" name="spbGrowValueDouble">
<property name="decimals">
<number>4</number>
</property>
......@@ -119,6 +119,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisIntParseSpinBox</class>
<extends>QSpinBox</extends>
<header>kis_intparsespinbox.h</header>
</customwidget>
<customwidget>
<class>KisDoubleParseSpinBox</class>