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 @@
#include <kiconeffect.h>
#include <kiconloader.h>
#include <klocale.h>
#include <knuminput.h>
kpTransformResizeScaleCommand::kpTransformResizeScaleCommand (bool actOnSelection,
......
......@@ -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)),
......
......@@ -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"));
......
......@@ -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;
};
......
......@@ -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
......
......@@ -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;
......
......@@ -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*/);
......
......@@ -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;
};
......
......@@ -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"));
......
......@@ -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;
};
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -42,6 +42,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kconfiggroup.h>
#include <knuminput.h>
#include <qapplication.h>
#include <qboxlayout.h>
......
......@@ -33,7 +33,6 @@
#include <qrect.h>
#include <qsize.h>
#include <qwidget.h>
#include <QDoubleSpinBox>
#include "imagelib/kpDocumentMetaInfo.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