Commit 6a841abe authored by Martin Koller's avatar Martin Koller

Revert "KNumInput -> QSpinBox"

This reverts commit 78c96dbd.
since it removes functionality I like and am used to.
Porting should never remove functionality
parent f045dc2f
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
kpTransformResizeScaleCommand::kpTransformResizeScaleCommand (bool actOnSelection, kpTransformResizeScaleCommand::kpTransformResizeScaleCommand (bool actOnSelection,
......
...@@ -361,7 +361,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW ...@@ -361,7 +361,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
connect (m_newHeightInput, SIGNAL (valueChanged (int)), connect (m_newHeightInput, SIGNAL (valueChanged (int)),
this, SLOT (slotHeightChanged (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: // edit. It should either fire:
// //
// 1. At the end of the edit (triggered by clicking or tabbing // 1. At the end of the edit (triggered by clicking or tabbing
...@@ -371,7 +371,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW ...@@ -371,7 +371,7 @@ QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseW
// //
// 2. Once per keystroke. // 2. Once per keystroke.
// //
// Bug in QDoubleSpinBox. // Bug in KDoubleNumInput.
connect (m_percentWidthInput, SIGNAL (valueChanged (double)), connect (m_percentWidthInput, SIGNAL (valueChanged (double)),
this, SLOT (slotPercentWidthChanged (double))); this, SLOT (slotPercentWidthChanged (double)));
connect (m_percentHeightInput, SIGNAL (valueChanged (double)), connect (m_percentHeightInput, SIGNAL (valueChanged (double)),
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "widgets/colorSimilarity/kpColorSimilarityFrame.h" #include "widgets/colorSimilarity/kpColorSimilarityFrame.h"
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
#include <qboxlayout.h> #include <qboxlayout.h>
#include <qdialogbuttonbox.h> #include <qdialogbuttonbox.h>
...@@ -39,8 +40,6 @@ ...@@ -39,8 +40,6 @@
#include <qlayout.h> #include <qlayout.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <QWhatsThis> #include <QWhatsThis>
#include <QSpinBox>
kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent) kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
: QDialog (parent) : QDialog (parent)
...@@ -77,8 +76,10 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent) ...@@ -77,8 +76,10 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
QGroupBox *inputGroupBox = new QGroupBox (i18n ("&RGB Color Cube Distance"), QGroupBox *inputGroupBox = new QGroupBox (i18n ("&RGB Color Cube Distance"),
baseWidget); baseWidget);
m_colorSimilarityInput = new QSpinBox (inputGroupBox); m_colorSimilarityInput = new KIntNumInput (inputGroupBox);
m_colorSimilarityInput->setRange (0, int (kpColorSimilarityHolder::MaxColorSimilarity * 100 + .1/*don't floor below target int*/)); 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->setSuffix (i18n ("%"));
m_colorSimilarityInput->setSpecialValueText (i18n ("Exact Match")); m_colorSimilarityInput->setSpecialValueText (i18n ("Exact Match"));
......
...@@ -31,10 +31,12 @@ ...@@ -31,10 +31,12 @@
#include <QDialog> #include <QDialog>
#include <QSpinBox>
class QLabel; class QLabel;
class KIntNumInput;
class kpColorSimilarityFrame; class kpColorSimilarityFrame;
...@@ -58,7 +60,7 @@ private slots: ...@@ -58,7 +60,7 @@ private slots:
private: private:
kpColorSimilarityFrame *m_colorSimilarityFrame; kpColorSimilarityFrame *m_colorSimilarityFrame;
QSpinBox *m_colorSimilarityInput; KIntNumInput *m_colorSimilarityInput;
QLabel *m_whatIsLabel; QLabel *m_whatIsLabel;
}; };
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
#include <cmath> #include <cmath>
#include <math.h> #include <math.h>
...@@ -45,7 +46,6 @@ ...@@ -45,7 +46,6 @@
#include <qlabel.h> #include <qlabel.h>
#include <qlayout.h> #include <qlayout.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <QSpinBox>
#if DEBUG_KP_EFFECT_BALANCE #if DEBUG_KP_EFFECT_BALANCE
#include <qdatetime.h> #include <qdatetime.h>
...@@ -61,18 +61,21 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection, ...@@ -61,18 +61,21 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection,
QLabel *brightnessLabel = new QLabel (i18n ("&Brightness:"), this); 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->setRange (-50, 50);
m_brightnessInput->setSliderEnabled();
QPushButton *brightnessResetPushButton = new QPushButton (i18n ("Re&set"), this); QPushButton *brightnessResetPushButton = new QPushButton (i18n ("Re&set"), this);
QLabel *contrastLabel = new QLabel (i18n ("Co&ntrast:"), 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->setRange (-50, 50);
m_contrastInput->setSliderEnabled();
QPushButton *contrastResetPushButton = new QPushButton (i18n ("&Reset"), this); QPushButton *contrastResetPushButton = new QPushButton (i18n ("&Reset"), this);
QLabel *gammaLabel = new QLabel (i18n ("&Gamma:"), 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->setRange (-50, 50);
m_gammaInput->setSliderEnabled();
// TODO: This is what should be shown in the m_gammaInput spinbox // TODO: This is what should be shown in the m_gammaInput spinbox
m_gammaLabel = new QLabel (this); m_gammaLabel = new QLabel (this);
// TODO: This doesn't seem to be wide enough with some fonts so the // TODO: This doesn't seem to be wide enough with some fonts so the
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#ifndef kpEffectBalanceWidget_H #ifndef kpEffectBalanceWidget_H
#define kpEffectBalanceWidget_H #define kpEffectBalanceWidget_H
#include <QSpinBox>
#include "kpEffectWidgetBase.h" #include "kpEffectWidgetBase.h"
#include "imagelib/kpImage.h" #include "imagelib/kpImage.h"
...@@ -38,6 +37,8 @@ ...@@ -38,6 +37,8 @@
class QLabel; class QLabel;
class QComboBox; class QComboBox;
class KIntNumInput;
class kpEffectBalanceWidget : public kpEffectWidgetBase class kpEffectBalanceWidget : public kpEffectWidgetBase
...@@ -73,7 +74,7 @@ protected slots: ...@@ -73,7 +74,7 @@ protected slots:
void resetAll (); void resetAll ();
protected: protected:
QSpinBox *m_brightnessInput, KIntNumInput *m_brightnessInput,
*m_contrastInput, *m_contrastInput,
*m_gammaInput; *m_gammaInput;
QLabel *m_gammaLabel; QLabel *m_gammaLabel;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
#include <qgridlayout.h> #include <qgridlayout.h>
#include <qlabel.h> #include <qlabel.h>
...@@ -50,7 +51,7 @@ kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection, ...@@ -50,7 +51,7 @@ kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
m_amountInput = new QSpinBox (this); m_amountInput = new KIntNumInput (this);
m_amountInput->setRange (-kpEffectBlurSharpen::MaxStrength/*- for blur*/, m_amountInput->setRange (-kpEffectBlurSharpen::MaxStrength/*- for blur*/,
+kpEffectBlurSharpen::MaxStrength/*+ for sharpen*/); +kpEffectBlurSharpen::MaxStrength/*+ for sharpen*/);
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#ifndef kpEffectBlurSharpenWidget_H #ifndef kpEffectBlurSharpenWidget_H
#define kpEffectBlurSharpenWidget_H #define kpEffectBlurSharpenWidget_H
#include <QSpinBox>
#include "imagelib/kpColor.h" #include "imagelib/kpColor.h"
...@@ -39,6 +38,9 @@ ...@@ -39,6 +38,9 @@
class QLabel; class QLabel;
class KIntNumInput;
class kpEffectBlurSharpenWidget : public kpEffectWidgetBase class kpEffectBlurSharpenWidget : public kpEffectWidgetBase
{ {
Q_OBJECT Q_OBJECT
...@@ -62,7 +64,7 @@ protected: ...@@ -62,7 +64,7 @@ protected:
kpEffectBlurSharpen::Type type () const; kpEffectBlurSharpen::Type type () const;
int strength () const; int strength () const;
QSpinBox *m_amountInput; KIntNumInput *m_amountInput;
QLabel *m_typeLabel; QLabel *m_typeLabel;
}; };
......
...@@ -51,7 +51,7 @@ kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection, ...@@ -51,7 +51,7 @@ kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection,
#if 0 #if 0
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
m_amountInput = new QSpinBox (this); m_amountInput = new KIntNumInput (this);
m_amountInput->setRange (kpEffectEmboss::MinStrength, m_amountInput->setRange (kpEffectEmboss::MinStrength,
kpEffectEmboss::MaxStrength, 1/*step*/, true/*slider*/); kpEffectEmboss::MaxStrength, 1/*step*/, true/*slider*/);
m_amountInput->setSpecialValueText (i18n ("None")); m_amountInput->setSpecialValueText (i18n ("None"));
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
class QCheckBox; class QCheckBox;
//class KIntNumInput;
class kpEffectEmbossWidget : public kpEffectWidgetBase class kpEffectEmbossWidget : public kpEffectWidgetBase
{ {
...@@ -56,6 +58,7 @@ public: ...@@ -56,6 +58,7 @@ public:
protected: protected:
int strength () const; int strength () const;
//KIntNumInput *m_amountInput;
QCheckBox *m_enableCheckBox; QCheckBox *m_enableCheckBox;
}; };
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include <qgridlayout.h> #include <qgridlayout.h>
#include <qlabel.h> #include <qlabel.h>
#include <QDoubleSpinBox>
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
#include "imagelib/effects/kpEffectHSV.h" #include "imagelib/effects/kpEffectHSV.h"
#include "commands/imagelib/effects/kpEffectHSVCommand.h" #include "commands/imagelib/effects/kpEffectHSVCommand.h"
...@@ -49,17 +49,14 @@ kpEffectHSVWidget::kpEffectHSVWidget (bool actOnSelection, QWidget *parent) ...@@ -49,17 +49,14 @@ kpEffectHSVWidget::kpEffectHSVWidget (bool actOnSelection, QWidget *parent)
QLabel *saturationLabel = new QLabel (i18n ("&Saturation:"), this); QLabel *saturationLabel = new QLabel (i18n ("&Saturation:"), this);
QLabel *valueLabel = new QLabel (i18nc ("The V of HSV", "&Value:"), this); QLabel *valueLabel = new QLabel (i18nc ("The V of HSV", "&Value:"), this);
m_hueInput = new QDoubleSpinBox (this); m_hueInput = new KDoubleNumInput (this);
m_hueInput->setRange(-180, 180); m_hueInput->setRange (-180, 180, 15/*step*/, true/*slider*/);
m_hueInput->setSingleStep(15/*step*/);
m_saturationInput = new QDoubleSpinBox (this); m_saturationInput = new KDoubleNumInput (this);
m_saturationInput->setRange(-1, 1); m_saturationInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
m_saturationInput->setSingleStep(.1/*step*/);
m_valueInput = new QDoubleSpinBox (this); m_valueInput = new KDoubleNumInput (this);
m_valueInput->setRange(-1, 1); m_valueInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
m_valueInput->setSingleStep(.1/*step*/);
hueLabel->setBuddy (m_hueInput); hueLabel->setBuddy (m_hueInput);
saturationLabel->setBuddy (m_saturationInput); saturationLabel->setBuddy (m_saturationInput);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "kpEffectWidgetBase.h" #include "kpEffectWidgetBase.h"
class QDoubleSpinBox; class KDoubleNumInput;
class kpEffectHSVWidget : public kpEffectWidgetBase class kpEffectHSVWidget : public kpEffectWidgetBase
...@@ -53,9 +53,9 @@ public: ...@@ -53,9 +53,9 @@ public:
kpCommandEnvironment *cmdEnviron) const; kpCommandEnvironment *cmdEnviron) const;
protected: protected:
QDoubleSpinBox *m_hueInput; KDoubleNumInput *m_hueInput;
QDoubleSpinBox *m_saturationInput; KDoubleNumInput *m_saturationInput;
QDoubleSpinBox *m_valueInput; KDoubleNumInput *m_valueInput;
}; };
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <knuminput.h>
kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection, kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
...@@ -57,13 +58,11 @@ kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection, ...@@ -57,13 +58,11 @@ kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
m_granularityInput = new QDoubleSpinBox (this); m_granularityInput = new KDoubleNumInput (this);
m_granularityInput->setRange(0, 1); m_granularityInput->setRange (0, 1, .1/*step*/, true/*slider*/);
m_granularityInput->setSingleStep(.1/*step*/);
m_amountInput = new QDoubleSpinBox (this); m_amountInput = new KDoubleNumInput (this);
m_amountInput->setRange(0, 1); m_amountInput->setRange (0, 1, .1/*step*/, true/*slider*/);
m_amountInput->setSingleStep(.1/*step*/);
granularityLabel->setBuddy (m_granularityInput); granularityLabel->setBuddy (m_granularityInput);
amountLabel->setBuddy (m_amountInput); amountLabel->setBuddy (m_amountInput);
......
...@@ -32,10 +32,9 @@ ...@@ -32,10 +32,9 @@
#include "kpEffectWidgetBase.h" #include "kpEffectWidgetBase.h"
#include <QDoubleSpinBox>
class QDoubleSpinBox; class KDoubleNumInput;
class kpEffectToneEnhanceWidget : public kpEffectWidgetBase class kpEffectToneEnhanceWidget : public kpEffectWidgetBase
...@@ -61,8 +60,8 @@ public: ...@@ -61,8 +60,8 @@ public:
kpCommandEnvironment *cmdEnviron) const; kpCommandEnvironment *cmdEnviron) const;
protected: protected:
QDoubleSpinBox *m_granularityInput; KDoubleNumInput *m_granularityInput;
QDoubleSpinBox *m_amountInput; KDoubleNumInput *m_amountInput;
}; };
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <knuminput.h>
#include <qapplication.h> #include <qapplication.h>
#include <qboxlayout.h> #include <qboxlayout.h>
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <qrect.h> #include <qrect.h>
#include <qsize.h> #include <qsize.h>
#include <qwidget.h> #include <qwidget.h>
#include <QDoubleSpinBox>
#include "imagelib/kpDocumentMetaInfo.h" #include "imagelib/kpDocumentMetaInfo.h"
#include "document/kpDocumentSaveOptions.h" #include "document/kpDocumentSaveOptions.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment