Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7238cf19 authored by Yuri Chornoivan's avatar Yuri Chornoivan

Port KolourPaint away from deprecated KIntNumInput and KDoubleNumInput

Differential Revision: https://phabricator.kde.org/D16371
parent aab5f7f0
......@@ -281,6 +281,7 @@ set(kolourpaint_app_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/widgets/colorSimilarity/kpColorSimilarityFrame.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/colorSimilarity/kpColorSimilarityHolder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/colorSimilarity/kpColorSimilarityToolBarItem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/imagelib/effects/kpNumInput.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/imagelib/effects/kpEffectBalanceWidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/imagelib/effects/kpEffectEmbossWidget.cpp
......
......@@ -31,7 +31,7 @@
#include "widgets/colorSimilarity/kpColorSimilarityFrame.h"
#include <KLocalizedString>
#include <knuminput.h> // kdelibs4support
#include "../widgets/imagelib/effects/kpNumInput.h"
#include <qboxlayout.h>
#include <qdialogbuttonbox.h>
......@@ -76,10 +76,9 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (QWidget *parent)
QGroupBox *inputGroupBox = new QGroupBox (i18n ("&RGB Color Cube Distance"),
baseWidget);
m_colorSimilarityInput = new KIntNumInput (inputGroupBox);
m_colorSimilarityInput = new kpIntNumInput (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"));
......
......@@ -35,7 +35,7 @@
class QLabel;
class KIntNumInput;
class kpIntNumInput;
class kpColorSimilarityFrame;
......@@ -60,7 +60,7 @@ private slots:
private:
kpColorSimilarityFrame *m_colorSimilarityFrame;
KIntNumInput *m_colorSimilarityInput;
kpIntNumInput *m_colorSimilarityInput;
QLabel *m_whatIsLabel;
};
......
......@@ -36,7 +36,7 @@
#include "kpLogCategories.h"
#include <KLocalizedString>
#include <knuminput.h> // kdelibs4support
#include "kpNumInput.h"
#include <cmath>
#include <math.h>
......@@ -61,21 +61,18 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection,
QLabel *brightnessLabel = new QLabel (i18n ("&Brightness:"), this);
m_brightnessInput = new KIntNumInput (0/*value*/, this);
m_brightnessInput = new kpIntNumInput (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 KIntNumInput (0/*value*/, this);
m_contrastInput = new kpIntNumInput (0/*value*/, this);
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);
m_gammaInput = new KIntNumInput (0/*value*/, this);
m_gammaInput = new kpIntNumInput (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
......
......@@ -37,7 +37,7 @@
class QLabel;
class QComboBox;
class KIntNumInput;
class kpIntNumInput;
......@@ -74,7 +74,7 @@ protected slots:
void resetAll ();
protected:
KIntNumInput *m_brightnessInput,
kpIntNumInput *m_brightnessInput,
*m_contrastInput,
*m_gammaInput;
QLabel *m_gammaLabel;
......
......@@ -35,7 +35,7 @@
#include "kpLogCategories.h"
#include <KLocalizedString>
#include <knuminput.h> // kdelibs4support
#include "kpNumInput.h"
#include <qgridlayout.h>
#include <qlabel.h>
......@@ -51,7 +51,7 @@ kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
m_amountInput = new KIntNumInput (this);
m_amountInput = new kpIntNumInput (this);
m_amountInput->setRange (-kpEffectBlurSharpen::MaxStrength/*- for blur*/,
+kpEffectBlurSharpen::MaxStrength/*+ for sharpen*/);
......
......@@ -38,7 +38,7 @@
class QLabel;
class KIntNumInput;
class kpIntNumInput;
class kpEffectBlurSharpenWidget : public kpEffectWidgetBase
......@@ -64,7 +64,7 @@ protected:
kpEffectBlurSharpen::Type type () const;
int strength () const;
KIntNumInput *m_amountInput;
kpIntNumInput *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 KIntNumInput (this);
m_amountInput = new kpIntNumInput (this);
m_amountInput->setRange (kpEffectEmboss::MinStrength,
kpEffectEmboss::MaxStrength, 1/*step*/, true/*slider*/);
m_amountInput->setSpecialValueText (i18n ("None"));
......
......@@ -36,9 +36,6 @@
class QCheckBox;
//class KIntNumInput;
class kpEffectEmbossWidget : public kpEffectWidgetBase
{
Q_OBJECT
......@@ -58,7 +55,6 @@ public:
protected:
int strength () const;
//KIntNumInput *m_amountInput;
QCheckBox *m_enableCheckBox;
};
......
......@@ -33,8 +33,8 @@
#include "kpLogCategories.h"
#include <KLocalizedString>
#include <knuminput.h> // kdelibs4support
#include "kpNumInput.h"
#include "imagelib/effects/kpEffectHSV.h"
#include "commands/imagelib/effects/kpEffectHSVCommand.h"
......@@ -49,14 +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 KDoubleNumInput (this);
m_hueInput->setRange (-180, 180, 15/*step*/, true/*slider*/);
m_hueInput = new kpDoubleNumInput (this);
m_hueInput->setRange (-180, 180, 15/*step*/);
m_saturationInput = new KDoubleNumInput (this);
m_saturationInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
m_saturationInput = new kpDoubleNumInput (this);
m_saturationInput->setRange (-1, 1, .1/*step*/);
m_valueInput = new KDoubleNumInput (this);
m_valueInput->setRange (-1, 1, .1/*step*/, true/*slider*/);
m_valueInput = new kpDoubleNumInput (this);
m_valueInput->setRange (-1, 1, .1/*step*/);
hueLabel->setBuddy (m_hueInput);
saturationLabel->setBuddy (m_saturationInput);
......
......@@ -31,9 +31,9 @@
#include "kpEffectWidgetBase.h"
#include "kpNumInput.h"
class KDoubleNumInput;
class kpDoubleNumInput;
class kpEffectHSVWidget : public kpEffectWidgetBase
......@@ -53,9 +53,9 @@ public:
kpCommandEnvironment *cmdEnviron) const override;
protected:
KDoubleNumInput *m_hueInput;
KDoubleNumInput *m_saturationInput;
KDoubleNumInput *m_valueInput;
kpDoubleNumInput *m_hueInput;
kpDoubleNumInput *m_saturationInput;
kpDoubleNumInput *m_valueInput;
};
......
......@@ -32,14 +32,13 @@
#include "imagelib/effects/kpEffectToneEnhance.h"
#include "commands/imagelib/effects/kpEffectToneEnhanceCommand.h"
#include "pixmapfx/kpPixmapFX.h"
#include "kpNumInput.h"
#include <QGridLayout>
#include <QLabel>
#include "kpLogCategories.h"
#include <KLocalizedString>
#include <knuminput.h> // kdelibs4support
kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
QWidget *parent)
......@@ -58,11 +57,11 @@ kpEffectToneEnhanceWidget::kpEffectToneEnhanceWidget (bool actOnSelection,
QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this);
m_granularityInput = new KDoubleNumInput (this);
m_granularityInput->setRange (0, 1, .1/*step*/, true/*slider*/);
m_granularityInput = new kpDoubleNumInput (this);
m_granularityInput->setRange (0, 1, .1/*step*/);
m_amountInput = new KDoubleNumInput (this);
m_amountInput->setRange (0, 1, .1/*step*/, true/*slider*/);
m_amountInput = new kpDoubleNumInput (this);
m_amountInput->setRange (0, 1, .1/*step*/);
granularityLabel->setBuddy (m_granularityInput);
amountLabel->setBuddy (m_amountInput);
......
......@@ -32,9 +32,9 @@
#include "kpEffectWidgetBase.h"
#include "kpNumInput.h"
class KDoubleNumInput;
class kpDoubleNumInput;
class kpEffectToneEnhanceWidget : public kpEffectWidgetBase
......@@ -60,8 +60,8 @@ public:
kpCommandEnvironment *cmdEnviron) const override;
protected:
KDoubleNumInput *m_granularityInput;
KDoubleNumInput *m_amountInput;
kpDoubleNumInput *m_granularityInput;
kpDoubleNumInput *m_amountInput;
};
......
This diff is collapsed.
This diff is collapsed.
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