00001 #ifndef GRADIENTEDITOR_H
00002 #define GRADIENTEDITOR_H
00003
00004 #include <QtGui>
00005 #include "shadewidget.h"
00006
00010 class GradientEditor : public QWidget
00011 {
00012 Q_OBJECT
00013 public:
00014 GradientEditor(QWidget *parent);
00015
00016 void setGradientStops(const QGradientStops &stops);
00017 QRgb* getColorsPtr();
00018 void updateColorTexture();
00019
00020 int getGradientEditorNumber() const { return gradientEditorNumber; }
00021 void setGradientEditorNumber(int number) { gradientEditorNumber = number; }
00022
00023 void setGradientEditorRangeLabel(float min = 0, float max = 1);
00024
00025 public slots:
00026 void pointsUpdated();
00027 void colorDialog(int index);
00028 void moveColorsWithAlpha(int index, qreal newXPos);
00029 void newColorPoints(int index, qreal xPos);
00030 void deleteColorPoints(int index);
00031
00032 signals:
00038 void gradientStopsChanged(const QGradientStops &stops, GradientEditor *editor);
00039
00044 void setEnabledSignal(bool enabled);
00045
00046 protected:
00047 void resizeEvent(QResizeEvent *event);
00048
00049 private:
00050 QLabel *minLabel;
00051 QLabel *maxLabel;
00052 ShadeWidget *m_alpha_shade;
00053 QRgb* colors;
00054 QGradientStops gradientStops;
00055 int gradientEditorNumber;
00056 };
00057
00058 #endif // GRADIENTEDITOR_H