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:
parent
6f5c201df3
commit
0585958073
6 changed files with 40 additions and 8 deletions
|
@ -27,14 +27,17 @@ DialogColorGradation::DialogColorGradation(QWidget *parent, ColorGradation* grad
|
||||||
|
|
||||||
_preview_red = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_RED);
|
_preview_red = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_RED);
|
||||||
_preview_red->setMinimumHeight(50);
|
_preview_red->setMinimumHeight(50);
|
||||||
|
connect(_preview_red, SIGNAL(clicked()), this, SLOT(selectRed()));
|
||||||
layout()->addWidget(_preview_red);
|
layout()->addWidget(_preview_red);
|
||||||
|
|
||||||
_preview_green = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_GREEN);
|
_preview_green = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_GREEN);
|
||||||
_preview_green->setMinimumHeight(50);
|
_preview_green->setMinimumHeight(50);
|
||||||
|
connect(_preview_green, SIGNAL(clicked()), this, SLOT(selectGreen()));
|
||||||
layout()->addWidget(_preview_green);
|
layout()->addWidget(_preview_green);
|
||||||
|
|
||||||
_preview_blue = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_BLUE);
|
_preview_blue = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_BLUE);
|
||||||
_preview_blue->setMinimumHeight(50);
|
_preview_blue->setMinimumHeight(50);
|
||||||
|
connect(_preview_blue, SIGNAL(clicked()), this, SLOT(selectBlue()));
|
||||||
layout()->addWidget(_preview_blue);
|
layout()->addWidget(_preview_blue);
|
||||||
|
|
||||||
_preview_final = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_FINAL);
|
_preview_final = new PreviewColorGradation(this, gradation, COLORGRADATIONBAND_FINAL);
|
||||||
|
@ -87,8 +90,25 @@ void DialogColorGradation::revert()
|
||||||
revertToCurrent();
|
revertToCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogColorGradation::revertToCurrent()
|
void DialogColorGradation::selectRed()
|
||||||
{
|
{
|
||||||
colorGradationGetRedCurve(_current, _curve);
|
colorGradationGetRedCurve(_current, _curve);
|
||||||
_curve_editor->setCurve(_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();
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
virtual void accept();
|
virtual void accept();
|
||||||
void revert();
|
void revert();
|
||||||
|
void selectRed();
|
||||||
|
void selectGreen();
|
||||||
|
void selectBlue();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent* e);
|
virtual void closeEvent(QCloseEvent* e);
|
||||||
|
|
|
@ -82,14 +82,14 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
tabs->addTab(form, tr("Water"));
|
tabs->addTab(form, tr("Water"));
|
||||||
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
|
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);
|
form = new FormSky(tabs);
|
||||||
tabs->addTab(form, tr("Sky"));
|
tabs->addTab(form, tr("Sky"));
|
||||||
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
|
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);
|
form = new FormClouds(tabs);
|
||||||
tabs->addTab(form, tr("Clouds"));
|
tabs->addTab(form, tr("Clouds"));
|
||||||
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
|
QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()));
|
||||||
|
|
|
@ -66,3 +66,8 @@ void PreviewColorGradation::paintEvent(QPaintEvent* event)
|
||||||
|
|
||||||
curveDelete(curve);
|
curveDelete(curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreviewColorGradation::mouseReleaseEvent(QMouseEvent* event)
|
||||||
|
{
|
||||||
|
emit clicked();
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,10 @@ class PreviewColorGradation:public QWidget
|
||||||
public:
|
public:
|
||||||
PreviewColorGradation(QWidget* parent, ColorGradation* gradation, EnumColorGradationBand band);
|
PreviewColorGradation(QWidget* parent, ColorGradation* gradation, EnumColorGradationBand band);
|
||||||
void paintEvent(QPaintEvent* event);
|
void paintEvent(QPaintEvent* event);
|
||||||
|
void mouseReleaseEvent(QMouseEvent* event);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ColorGradation* gradation;
|
ColorGradation* gradation;
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>DialogColorGradation</name>
|
<name>DialogColorGradation</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogcolorgradation.cpp" line="50"/>
|
<location filename="../gui_qt/dialogcolorgradation.cpp" line="53"/>
|
||||||
<source>Paysages 3D - Color gradation editor</source>
|
<source>Paysages 3D - Color gradation editor</source>
|
||||||
<translation>Paysages 3D - Editeur de gradients de couleur</translation>
|
<translation>Paysages 3D - Editeur de gradients de couleur</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -529,12 +529,12 @@
|
||||||
<translation>Eau</translation>
|
<translation>Eau</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/mainwindow.cpp" line="86"/>
|
<location filename="../gui_qt/mainwindow.cpp" line="90"/>
|
||||||
<source>Atmosphere</source>
|
<source>Atmosphere</source>
|
||||||
<translation>Atmosphère</translation>
|
<translation>Atmosphère</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/mainwindow.cpp" line="90"/>
|
<location filename="../gui_qt/mainwindow.cpp" line="86"/>
|
||||||
<source>Sky</source>
|
<source>Sky</source>
|
||||||
<translation>Ciel</translation>
|
<translation>Ciel</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in a new issue