summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koller <[email protected]>2015-09-26 18:34:30 +0200
committerMartin Koller <[email protected]>2015-09-26 18:34:30 +0200
commit6a841abeb5b6a81bd9e955a713085ca06e14bdfd (patch)
treeee4bfbb777fe69dd546e0213aa7649b6a2db96bc
parentf045dc2feb293dd97751dad0bc127362aa6565cb (diff)
Revert "KNumInput -> QSpinBox"
This reverts commit 78c96dbdf059d2624e17beacd842b69249fa39b1. since it removes functionality I like and am used to. Porting should never remove functionality
-rw-r--r--commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp1
-rw-r--r--dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp4
-rw-r--r--dialogs/kpColorSimilarityDialog.cpp9
-rw-r--r--dialogs/kpColorSimilarityDialog.h6
-rw-r--r--widgets/imagelib/effects/kpEffectBalanceWidget.cpp11
-rw-r--r--widgets/imagelib/effects/kpEffectBalanceWidget.h5
-rw-r--r--widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp3
-rw-r--r--widgets/imagelib/effects/kpEffectBlurSharpenWidget.h6
-rw-r--r--widgets/imagelib/effects/kpEffectEmbossWidget.cpp2
-rw-r--r--widgets/imagelib/effects/kpEffectEmbossWidget.h3
-rw-r--r--widgets/imagelib/effects/kpEffectHSVWidget.cpp17
-rw-r--r--widgets/imagelib/effects/kpEffectHSVWidget.h8
-rw-r--r--widgets/imagelib/effects/kpEffectToneEnhanceWidget.cpp11
-rw-r--r--widgets/imagelib/effects/kpEffectToneEnhanceWidget.h7
-rw-r--r--widgets/kpDocumentSaveOptionsWidget.cpp1
-rw-r--r--widgets/kpDocumentSaveOptionsWidget.h1
16 files changed, 52 insertions, 43 deletions
diff --git a/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp b/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp
index 103e629..5fbf996 100644
--- a/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp
+++ b/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp
@@ -58,6 +58,7 @@
#include <kiconeffect.h>
#include <kiconloader.h>
#include <klocale.h>
+#include <knuminput.h>
kpTransformResizeScaleCommand::kpTransformResizeScaleCommand (bool actOnSelection,
diff --git a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
index d96feb9..04261b3 100644
--- a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
+++ b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
@@ -361,7 +361,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
connect (m_newHeightInput, SIGNAL (valueChanged (int)),
this, SLOT (slotHeightChanged (int)));
- // COMPAT: QDoubleSpinBox only fires valueChanged(double) once per
+ // COMPAT: KDoubleNumInput only fires valueChanged(double) once per
// edit. It should either fire:
//
// 1. At the end of the edit (triggered by clicking or tabbing
@@ -371,7 +371,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
//
// 2. Once per keystroke.
//
- // Bug in QDoubleSpinBox.
+ // Bug in KDoubleNumInput.
connect (m_percentWidthInput, SIGNAL (valueChanged (double)),
this, SLOT (slotPercentWidthChanged (double)));
connect (m_percentHeightInput, SIGNAL (valueChanged (double)),
diff --git a/dialogs/kpColorSimilarityDialog.cpp b/dialogs/kpColorSimilarityDialog.cpp
index 7fee5c2..7373ecc 100644
--- a/dialogs/kpColorSimilarityDialog.cpp
+++ b/dialogs/kpColorSimilarityDialog.cpp
@@ -31,6 +31,7 @@
#include "widgets/colorSimilarity/kpColorSimilarityFrame.h"
#include <klocale.h>
+#include <knuminput.h>
#include <qboxlayout.h>
#include <qdialogbuttonbox.h>
@@ -39,8 +40,6 @@
#include <qlayout.h>
#include <qpushbutton.h>
#include <QWhatsThis>
-#include <QSpinBox>
-
kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
: QDialog (parent)
@@ -77,8 +76,10 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
QGroupBox *inputGroupBox = new QGroupBox (i18n ("&RGB Color Cube Distance"),
baseWidget);
- m_colorSimilarityInput = new QSpinBox (inputGroupBox);
- m_colorSimilarityInput->setRange (0, int (kpColorSimilarityHolder::MaxColorSimilarity * 100 + .1/*don't floor below target int*/));
+ m_colorSimilarityInput = new KIntNumInput (inputGroupBox);
+ m_colorSimilarityInput->setRange (0, int (kpColorSimilarityHolder::MaxColorSimilarity * 100 + .1/*don't floor below target int*/),
+ 5/*step*/);
+ m_colorSimilarityInput->setSliderEnabled (true);
m_colorSimilarityInput->setSuffix (i18n ("%"));
m_colorSimilarityInput->setSpecialValueText (i18n ("Exact Match"));
diff --git a/dialogs/kpColorSimilarityDialog.h b/dialogs/kpColorSimilarityDialog.h
index 06afc47..7bd3400 100644
--- a/dialogs/kpColorSimilarityDialog.h
+++ b/dialogs/kpColorSimilarityDialog.h
@@ -31,10 +31,12 @@
#include <QDialog>
-#include <QSpinBox>
+
class QLabel;
+class KIntNumInput;
+
class kpColorSimilarityFrame;
@@ -58,7 +60,7 @@ private slots:
private:
kpColorSimilarityFrame *m_colorSimilarityFrame;
- QSpinBox *m_colorSimilarityInput;
+ KIntNumInput *m_colorSimilarityInput;
QLabel *m_whatIsLabel;
};
diff --git a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
index daf7010..c724a5f 100644
--- a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
@@ -36,6 +36,7 @@
#include <kdebug.h>
#include <klocale.h>
+#include <knuminput.h>
#include <cmath>
#include <math.h>
@@ -45,7 +46,6 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
-#include <QSpinBox>
#if DEBUG_KP_EFFECT_BALANCE
#include <qdatetime.h>
@@ -61,18 +61,21 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection,
QLabel *brightnessLabel = new QLabel (i18n ("&Brightness:"), this);
- m_brightnessInput = new QSpinBox (this);
+ m_brightnessInput = new KIntNumInput (0/*value*/, this);
m_brightnessInput->setRange (-50, 50);
+ m_brightnessInput->setSliderEnabled();
QPushButton *brightnessResetPushButton = new QPushButton (i18n ("Re&set"), this);
QLabel *contrastLabel = new QLabel (i18n ("Co&ntrast:"), this);
- m_contrastInput = new QSpinBox (this);
+ m_contrastInput = new KIntNumInput (0/*value*/, this);
m_contrastInput->setRange (-50, 50);
+ m_contrastInput->setSliderEnabled();
QPushButton *contrastResetPushButton = new QPushButton (i18n ("&Reset"), this);
QLabel *gammaLabel = new QLabel (i18n ("&Gamma:"), this);
- m_gammaInput = new QSpinBox (this);
+ m_gammaInput = new KIntNumInput (0/*value*/, this);
m_gammaInput->setRange (-50, 50);
+ m_gammaInput->setSliderEnabled();
// TODO: This is what should be shown in the m_gammaInput spinbox
m_gammaLabel = new QLabel (this);
// TODO: This doesn't seem to be wide enough with some fonts so the
diff --git a/widgets/imagelib/effects/kpEffectBalanceWidget.h b/widgets/imagelib/effects/kpEffectBalanceWidget.h
index d8c7054..d961bbf 100644
--- a/widgets/imagelib/effects/kpEffectBalanceWidget.h
+++ b/widgets/imagelib/effects/kpEffectBalanceWidget.h
@@ -29,7 +29,6 @@
#ifndef kpEffectBalanceWidget_H
#define kpEffectBalanceWidget_H
-#include <QSpinBox>
#include "kpEffectWidgetBase.h"
#include "imagelib/kpImage.h"
@@ -38,6 +37,8 @@
class QLabel;
class QComboBox;
+class KIntNumInput;
+
class kpEffectBalanceWidget : public kpEffectWidgetBase
@@ -73,7 +74,7 @@ protected slots:
void resetAll ();
protected:
- QSpinBox *m_brightnessInput,
+ KIntNumInput *m_brightnessInput,
*m_contrastInput,
*m_gammaInput;
QLabel *m_gammaLabel;
diff --git a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp
index 297ed00..46e7955 100644
--- a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp
@@ -35,6 +35,7 @@
#include <kdebug.h>
#include <klocale.h>
+#include <knuminput.h>
#include <qgridlayout.h>
#include <qlabel.h>
@@ -50,7 +51,7 @@ kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
- m_amountInput = new QSpinBox (this);
+ m_amountInput = new KIntNumInput (this);
m_amountInput->setRange (-kpEffectBlurSharpen::MaxStrength/*- for blur*/,
+kpEffectBlurSharpen::MaxStrength/*+ for sharpen*/);
diff --git a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.h b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.h
index 4e19d34..8c420e3 100644
--- a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.h
+++ b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.h
@@ -29,7 +29,6 @@
#ifndef kpEffectBlurSharpenWidget_H
#define kpEffectBlurSharpenWidget_H
-#include <QSpinBox>
#include "imagelib/kpColor.h"
@@ -39,6 +38,9 @@
class QLabel;
+class KIntNumInput;
+
+
class kpEffectBlurSharpenWidget : public kpEffectWidgetBase
{
Q_OBJECT
@@ -62,7 +64,7 @@ protected:
kpEffectBlurSharpen::Type type () const;
int strength () const;
- QSpinBox *m_amountInput;
+ KIntNumInput *m_amountInput;
QLabel *m_typeLabel;
};
diff --git a/widgets/imagelib/effects/kpEffectEmbossWidget.cpp b/widgets/imagelib/effects/kpEffectEmbossWidget.cpp
index efcfff6..de69c9d 100644
--- a/widgets/imagelib/effects/kpEffectEmbossWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectEmbossWidget.cpp
@@ -51,7 +51,7 @@ kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection,
#if 0
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
- m_amountInput = new QSpinBox (this);
+ m_amountInput = new KIntNumInput (this);
m_amountInput->setRange (kpEffectEmboss::MinStrength,
kpEffectEmboss::MaxStrength, 1/*step*/, true/*slider*/);
m_amountInput->setSpecialValueText (i18n ("None"));
diff --git a/widgets/imagelib/effects/kpEffectEmbossWidget.h b/widgets/imagelib/effects/kpEffectEmbossWidget.h
index b8870f3..d55204c 100644
--- a/widgets/imagelib/effects/kpEffectEmbossWidget.h
+++ b/widgets/imagelib/effects/kpEffectEmbossWidget.h
@@ -36,6 +36,8 @@
class QCheckBox;
+//class KIntNumInput;
+
class kpEffectEmbossWidget : public kpEffectWidgetBase
{
@@ -56,6 +58,7 @@ public:
protected:
int strength () const;
+ //KIntNumInput *m_amountInput;
QCheckBox *m_enableCheckBox;
};
diff --git a/widgets/imagelib/effects/kpEffectHSVWidget.cpp b/widgets/imagelib/effects/kpEffectHSVWidget.cpp
index a5cb233..025c514 100644
--- a/widgets/imagelib/effects/kpEffectHSVWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectHSVWidget.cpp
@@ -30,10 +30,10 @@
#include <qgridlayout.h>
#include <qlabel.h>
-#include <QDoubleSpinBox>
#include <kdebug.h>
#include <klocale.h>
+#include <knuminput.h>
#include "imagelib/effects/kpEffectHSV.h"
#include "commands/imagelib/effects/kpEffectHSVCommand.h"
@@ -49,17 +49,14 @@ kpEffectHSVWidget::kpEffectHSVWidget (bool actOnSelection, QWidget *parent)
QLabel *saturationLabel = new QLabel (i18n ("&Saturation:"), this);
QLabel *valueLabel = new QLabel (i18nc ("The V of HSV", "&Value:"), this);
- m_hueInput = new QDoubleSpinBox (this);
- m_hueInput->setRange(-180, 180);
- m_hueInput->setSingleStep(15/*step*/);
+ m_hueInput = new KDoubleNumInput (this);
+ m_hueInput->setRange (-180, 180, 15/*step*/, true/*slider*/);
- m_saturationInput = new QDoubleSpinBox (this);
- m_saturationInput->setRange(-1, 1);
- m_saturationInput->setSingleStep(.1/*step*/);
+ m_saturationInput = new KDoubleNumInput (this);
+ m_saturationInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
- m_valueInput = new QDoubleSpinBox (this);
- m_valueInput->setRange(-1, 1);
- m_valueInput->setSingleStep(.1/*step*/);
+ m_valueInput = new KDoubleNumInput (this);
+ m_valueInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
hueLabel->setBuddy (m_hueInput);
saturationLabel->setBuddy (m_saturationInput);
diff --git a/widgets/imagelib/effects/kpEffectHSVWidget.h b/widgets/imagelib/effects/kpEffectHSVWidget.h
index 205054e..98a9db4 100644
--- a/widgets/imagelib/effects/kpEffectHSVWidget.h
+++ b/widgets/imagelib/effects/kpEffectHSVWidget.h
@@ -33,7 +33,7 @@
#include "kpEffectWidgetBase.h"
-class QDoubleSpinBox;
+class KDoubleNumInput;
class kpEffectHSVWidget : public kpEffectWidgetBase
@@ -53,9 +53,9 @@ public:
kpCommandEnvironment *cmdEnviron) const;
protected:
- QDoubleSpinBox *m_hueInput;
- QDoubleSpinBox *m_saturationInput;
- QDoubleSpinBox *m_valueInput;
+ KDoubleNumInput *m_hueInput;
+ KDoubleNumInput *m_saturationInput;
+ KDoubleNumInput *m_valueInput;
};
diff --git a/widgets/imagelib/effects/kpEffectToneEnhanceWidget.cpp b/widgets/imagelib/effects/kpEffectToneEnhanceWidget.cpp
index d1dc7a7..bbd163c 100644
--- a/widgets/imagelib/effects/kpEffectToneEnhanceWidget.cpp
+++ b/widgets/imagelib/effects/kpEffectToneEnhanceWidget.cpp
@@ -38,6 +38,7 @@
#include <kdebug.h>
#include <klocale.h>
+#include <knuminput.h>
kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
@@ -57,13 +58,11 @@ kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
- m_granularityInput = new QDoubleSpinBox (this);
- m_granularityInput->setRange(0, 1);
- m_granularityInput->setSingleStep(.1/*step*/);
+ m_granularityInput = new KDoubleNumInput (this);
+ m_granularityInput->setRange (0, 1, .1/*step*/, true/*slider*/);
- m_amountInput = new QDoubleSpinBox (this);
- m_amountInput->setRange(0, 1);
- m_amountInput->setSingleStep(.1/*step*/);
+ m_amountInput = new KDoubleNumInput (this);
+ m_amountInput->setRange (0, 1, .1/*step*/, true/*slider*/);
granularityLabel->setBuddy (m_granularityInput);
amountLabel->setBuddy (m_amountInput);
diff --git a/widgets/imagelib/effects/kpEffectToneEnhanceWidget.h b/widgets/imagelib/effects/kpEffectToneEnhanceWidget.h
index ed126ad..772786c 100644
--- a/widgets/imagelib/effects/kpEffectToneEnhanceWidget.h
+++ b/widgets/imagelib/effects/kpEffectToneEnhanceWidget.h
@@ -32,10 +32,9 @@
#include "kpEffectWidgetBase.h"
-#include <QDoubleSpinBox>
-class QDoubleSpinBox;
+class KDoubleNumInput;
class kpEffectToneEnhanceWidget : public kpEffectWidgetBase
@@ -61,8 +60,8 @@ public:
kpCommandEnvironment *cmdEnviron) const;
protected:
- QDoubleSpinBox *m_granularityInput;
- QDoubleSpinBox *m_amountInput;
+ KDoubleNumInput *m_granularityInput;
+ KDoubleNumInput *m_amountInput;
};
diff --git a/widgets/kpDocumentSaveOptionsWidget.cpp b/widgets/kpDocumentSaveOptionsWidget.cpp
index 428b044..ec1f1b3 100644
--- a/widgets/kpDocumentSaveOptionsWidget.cpp
+++ b/widgets/kpDocumentSaveOptionsWidget.cpp
@@ -42,6 +42,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kconfiggroup.h>
+#include <knuminput.h>
#include <qapplication.h>
#include <qboxlayout.h>
diff --git a/widgets/kpDocumentSaveOptionsWidget.h b/widgets/kpDocumentSaveOptionsWidget.h
index d917356..3ab75ed 100644
--- a/widgets/kpDocumentSaveOptionsWidget.h
+++ b/widgets/kpDocumentSaveOptionsWidget.h
@@ -33,7 +33,6 @@
#include <qrect.h>
#include <qsize.h>
#include <qwidget.h>
-#include <QDoubleSpinBox>
#include "imagelib/kpDocumentMetaInfo.h"
#include "document/kpDocumentSaveOptions.h"