Changeset View
Changeset View
Standalone View
Standalone View
libs/widgets/kis_color_input.h
Show All 35 Lines | |||||
36 | class KRITAWIDGETS_EXPORT KisColorInput : public QWidget | 36 | class KRITAWIDGETS_EXPORT KisColorInput : public QWidget | ||
37 | { | 37 | { | ||
38 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | public: | 39 | public: | ||
40 | KisColorInput(QWidget* parent, const KoChannelInfo*, KoColor* color, KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(), bool usePercentage = false); | 40 | KisColorInput(QWidget* parent, const KoChannelInfo*, KoColor* color, KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(), bool usePercentage = false); | ||
41 | inline bool usePercentage() const { | 41 | inline bool usePercentage() const { | ||
42 | return m_usePercentage; | 42 | return m_usePercentage; | ||
43 | } | 43 | } | ||
44 | inline void setPercentageWise(bool val) { | 44 | virtual inline void setPercentageWise(bool val) { | ||
45 | m_usePercentage = val; | 45 | m_usePercentage = val; | ||
46 | } | 46 | } | ||
47 | | ||||
47 | protected: | 48 | protected: | ||
48 | void init(); | 49 | void init(); | ||
49 | virtual QWidget* createInput() = 0; | 50 | virtual QWidget* createInput() = 0; | ||
50 | Q_SIGNALS: | 51 | Q_SIGNALS: | ||
51 | void updated(); | 52 | void updated(); | ||
52 | protected: | 53 | protected: | ||
53 | const KoChannelInfo* m_channelInfo; | 54 | const KoChannelInfo* m_channelInfo; | ||
54 | KoColor* m_color; | 55 | KoColor* m_color; | ||
55 | KoColorSlider* m_colorSlider; | 56 | KoColorSlider* m_colorSlider; | ||
56 | KoColorDisplayRendererInterface *m_displayRenderer; | 57 | KoColorDisplayRendererInterface *m_displayRenderer; | ||
57 | bool m_usePercentage; | 58 | bool m_usePercentage; | ||
58 | }; | 59 | }; | ||
59 | 60 | | |||
60 | class KRITAWIDGETS_EXPORT KisIntegerColorInput : public KisColorInput | 61 | class KRITAWIDGETS_EXPORT KisIntegerColorInput : public KisColorInput | ||
61 | { | 62 | { | ||
62 | Q_OBJECT | 63 | Q_OBJECT | ||
63 | public: | 64 | public: | ||
64 | KisIntegerColorInput(QWidget* parent, const KoChannelInfo*, KoColor* color, KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(), bool usePercentage = false); | 65 | KisIntegerColorInput(QWidget* parent, const KoChannelInfo*, KoColor* color, KoColorDisplayRendererInterface *displayRenderer = KoDumbColorDisplayRenderer::instance(), bool usePercentage = false); | ||
65 | protected: | 66 | protected: | ||
66 | QWidget* createInput() override; | 67 | QWidget* createInput() override; | ||
68 | void setPercentageWise(bool val) override; | ||||
67 | public Q_SLOTS: | 69 | public Q_SLOTS: | ||
68 | void setValue(int); | 70 | void setValue(int); | ||
69 | void update(); | 71 | void update(); | ||
70 | private Q_SLOTS: | 72 | private Q_SLOTS: | ||
71 | void onColorSliderChanged(int); | 73 | void onColorSliderChanged(int); | ||
72 | void onNumInputChanged(int); | 74 | void onNumInputChanged(int); | ||
73 | private: | 75 | private: | ||
74 | KisIntParseSpinBox* m_intNumInput; | 76 | KisIntParseSpinBox* m_intNumInput; | ||
Show All 35 Lines |