Michaël Lemaire
81cbbb9880
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@291 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#include "inputcolorgradation.h"
|
|
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QPainter>
|
|
#include <QColorDialog>
|
|
#include "dialogcolorgradation.h"
|
|
#include "previewcolorgradation.h"
|
|
#include "tools.h"
|
|
|
|
InputColorGradation::InputColorGradation(QWidget* form, QString label, ColorGradation* value) : BaseInput(form, label)
|
|
{
|
|
_value = value;
|
|
|
|
_control = new PreviewColorGradation(form, value, COLORGRADATIONBAND_FINAL);
|
|
_control->setMinimumSize(200, 20);
|
|
|
|
_preview = new QPushButton(tr("Edit"), form);
|
|
_preview->setMaximumWidth(150);
|
|
|
|
connect((QPushButton*)_preview, SIGNAL(clicked()), this, SLOT(editGradation()));
|
|
}
|
|
|
|
void InputColorGradation::updatePreview()
|
|
{
|
|
_control->update();
|
|
BaseInput::updatePreview();
|
|
}
|
|
|
|
void InputColorGradation::applyValue()
|
|
{
|
|
BaseInput::applyValue();
|
|
}
|
|
|
|
void InputColorGradation::revert()
|
|
{
|
|
BaseInput::revert();
|
|
}
|
|
|
|
void InputColorGradation::editGradation()
|
|
{
|
|
ColorGradation* gradation;
|
|
|
|
gradation = colorGradationCreate();
|
|
colorGradationCopy(_value, gradation);
|
|
if (DialogColorGradation::getGradation(_control, gradation))
|
|
{
|
|
colorGradationCopy(gradation, _value);
|
|
applyValue();
|
|
}
|
|
colorGradationDelete(gradation);
|
|
}
|