paysages: Color gradation editor (WIP).

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@279 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-03-18 21:00:50 +00:00 committed by ThunderK
parent 6f5c201df3
commit 0585958073
6 changed files with 40 additions and 8 deletions

View file

@ -27,14 +27,17 @@ DialogColorGradation::DialogColorGradation(QWidget *parent, ColorGradation* grad
_preview_red = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_RED);
_preview_red->setMinimumHeight(50);
connect(_preview_red, SIGNAL(clicked()), this, SLOT(selectRed()));
layout()->addWidget(_preview_red);
_preview_green = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_GREEN);
_preview_green->setMinimumHeight(50);
connect(_preview_green, SIGNAL(clicked()), this, SLOT(selectGreen()));
layout()->addWidget(_preview_green);
_preview_blue = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_BLUE);
_preview_blue->setMinimumHeight(50);
connect(_preview_blue, SIGNAL(clicked()), this, SLOT(selectBlue()));
layout()->addWidget(_preview_blue);
_preview_final = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_FINAL);
@ -87,8 +90,25 @@ void DialogColorGradation::revert()
revertToCurrent();
}
void DialogColorGradation::revertToCurrent()
void DialogColorGradation::selectRed()
{
colorGradationGetRedCurve(_current, _curve);
_curve_editor->setCurve(_curve);
}
void DialogColorGradation::selectGreen()
{
colorGradationGetGreenCurve(_current, _curve);
_curve_editor->setCurve(_curve);
}
void DialogColorGradation::selectBlue()
{
colorGradationGetBlueCurve(_current, _curve);
_curve_editor->setCurve(_curve);
}
void DialogColorGradation::revertToCurrent()
{
selectRed();
}

View file

@ -21,6 +21,9 @@ public:
public slots:
virtual void accept();
void revert();
void selectRed();
void selectGreen();
void selectBlue();
protected:
virtual void closeEvent(QCloseEvent* e);

View file

@ -82,14 +82,14 @@ MainWindow::MainWindow(QWidget *parent) :
tabs->addTab(form, tr("Water"));
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
form = new FormAtmosphere(tabs);
tabs->addTab(form, tr("Atmosphere"));
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
form = new FormSky(tabs);
tabs->addTab(form, tr("Sky"));
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
form = new FormAtmosphere(tabs);
tabs->addTab(form, tr("Atmosphere"));
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
form = new FormClouds(tabs);
tabs->addTab(form, tr("Clouds"));
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));

View file

@ -66,3 +66,8 @@ void PreviewColorGradation::paintEvent(QPaintEvent* event)
curveDelete(curve);
}
void PreviewColorGradation::mouseReleaseEvent(QMouseEvent* event)
{
emit clicked();
}

View file

@ -19,6 +19,10 @@ class PreviewColorGradation:public QWidget
public:
PreviewColorGradation(QWidget* parent, ColorGradation* gradation, EnumColorGradationBand band);
void paintEvent(QPaintEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
signals:
void clicked();
private:
ColorGradation* gradation;

View file

@ -37,7 +37,7 @@
<context>
<name>DialogColorGradation</name>
<message>
<location filename="../gui_qt/dialogcolorgradation.cpp" line="50"/>
<location filename="../gui_qt/dialogcolorgradation.cpp" line="53"/>
<source>Paysages 3D - Color gradation editor</source>
<translation>Paysages 3D - Editeur de gradients de couleur</translation>
</message>
@ -529,12 +529,12 @@
<translation>Eau</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="86"/>
<location filename="../gui_qt/mainwindow.cpp" line="90"/>
<source>Atmosphere</source>
<translation>Atmosphère</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="90"/>
<location filename="../gui_qt/mainwindow.cpp" line="86"/>
<source>Sky</source>
<translation>Ciel</translation>
</message>