Merge branch 'rom9-filmnegative' into filmnegative-cleanup
This commit is contained in:
@@ -54,11 +54,18 @@ FilmNegative::FilmNegative() :
|
||||
redExp(createExponentAdjuster(this, M("TP_FILMNEGATIVE_RED"), 2.72)),
|
||||
greenExp(createExponentAdjuster(this, M("TP_FILMNEGATIVE_GREEN"), 2.0)),
|
||||
blueExp(createExponentAdjuster(this, M("TP_FILMNEGATIVE_BLUE"), 1.72)),
|
||||
lockChannels(Gtk::manage(new Gtk::CheckButton(M("TP_FILMNEGATIVE_LOCKCHANNELS")))),
|
||||
spotgrid(Gtk::manage(new Gtk::Grid())),
|
||||
spotbutton(Gtk::manage(new Gtk::ToggleButton(M("TP_FILMNEGATIVE_PICK")))),
|
||||
redRatio(redExp->getValue() / greenExp->getValue()),
|
||||
blueRatio(blueExp->getValue() / greenExp->getValue())
|
||||
{
|
||||
redExp->set_sensitive(false);
|
||||
blueExp->set_sensitive(false);
|
||||
|
||||
lockChannels->set_tooltip_text(M("TP_FILMNEGATIVE_LOCKCHANNELS_TOOLTIP"));
|
||||
lockChannels->set_active (true);
|
||||
|
||||
spotgrid->get_style_context()->add_class("grid-spacing");
|
||||
setExpandAlignProperties(spotgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||
|
||||
@@ -86,11 +93,13 @@ FilmNegative::FilmNegative() :
|
||||
// spotgrid->attach (*slab, 1, 0, 1, 1);
|
||||
// spotgrid->attach (*wbsizehelper, 2, 0, 1, 1);
|
||||
|
||||
pack_start(*lockChannels, Gtk::PACK_SHRINK, 0);
|
||||
pack_start(*redExp, Gtk::PACK_SHRINK, 0);
|
||||
pack_start(*greenExp, Gtk::PACK_SHRINK, 0);
|
||||
pack_start(*blueExp, Gtk::PACK_SHRINK, 0);
|
||||
pack_start(*spotgrid, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
lockChannels->signal_toggled().connect(sigc::mem_fun(*this, &FilmNegative::lockChannelsToggled));
|
||||
spotbutton->signal_toggled().connect(sigc::mem_fun(*this, &FilmNegative::editToggled));
|
||||
// spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) );
|
||||
|
||||
@@ -102,7 +111,7 @@ FilmNegative::FilmNegative() :
|
||||
|
||||
// Stick a dummy rectangle over the whole image in mouseOverGeometry.
|
||||
// This is to make sure the getCursor() call is fired everywhere.
|
||||
Rectangle* imgRect = new Rectangle();
|
||||
Rectangle* const imgRect = new Rectangle();
|
||||
imgRect->filled = true;
|
||||
|
||||
mouseOverGeometry.push_back(imgRect);
|
||||
@@ -172,12 +181,18 @@ void FilmNegative::setDefaults(const rtengine::procparams::ProcParams* defParams
|
||||
|
||||
void FilmNegative::setBatchMode(bool batchMode)
|
||||
{
|
||||
spotConn.disconnect();
|
||||
removeIfThere(this, spotgrid, false);
|
||||
ToolPanel::setBatchMode(batchMode);
|
||||
redExp->showEditedCB();
|
||||
greenExp->showEditedCB();
|
||||
blueExp->showEditedCB();
|
||||
if (batchMode) {
|
||||
spotConn.disconnect();
|
||||
lockChannelsConn.disconnect();
|
||||
removeIfThere(this, spotgrid, false);
|
||||
removeIfThere(this, lockChannels, false);
|
||||
redExp->set_sensitive(true);
|
||||
blueExp->set_sensitive(true);
|
||||
ToolPanel::setBatchMode(batchMode);
|
||||
redExp->showEditedCB();
|
||||
greenExp->showEditedCB();
|
||||
blueExp->showEditedCB();
|
||||
}
|
||||
}
|
||||
|
||||
void FilmNegative::adjusterChanged(Adjuster* a, double newval)
|
||||
@@ -231,9 +246,9 @@ void FilmNegative::enabledChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void FilmNegative::setFilmNegProvider(FilmNegProvider* p)
|
||||
void FilmNegative::setFilmNegProvider(FilmNegProvider* provider)
|
||||
{
|
||||
fnp = p;
|
||||
fnp = provider;
|
||||
}
|
||||
|
||||
void FilmNegative::setEditProvider(EditDataProvider* provider)
|
||||
@@ -349,3 +364,10 @@ void FilmNegative::editToggled()
|
||||
unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
void FilmNegative::lockChannelsToggled()
|
||||
{
|
||||
const bool unlocked = !lockChannels->get_active();
|
||||
redExp->set_sensitive(unlocked);
|
||||
blueExp->set_sensitive(unlocked);
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
void adjusterAutoToggled(Adjuster* a, bool newval) override;
|
||||
void enabledChanged() override;
|
||||
|
||||
void setFilmNegProvider(FilmNegProvider* p);
|
||||
void setFilmNegProvider(FilmNegProvider* provider);
|
||||
|
||||
void setEditProvider(EditDataProvider* provider) override;
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
|
||||
private:
|
||||
void editToggled();
|
||||
void lockChannelsToggled();
|
||||
|
||||
const rtengine::ProcEvent evFilmNegativeExponents;
|
||||
const rtengine::ProcEvent evFilmNegativeEnabled;
|
||||
@@ -84,6 +85,9 @@ private:
|
||||
Adjuster* const greenExp;
|
||||
Adjuster* const blueExp;
|
||||
|
||||
Gtk::CheckButton* const lockChannels;
|
||||
sigc::connection lockChannelsConn;
|
||||
|
||||
Gtk::Grid* const spotgrid;
|
||||
Gtk::ToggleButton* const spotbutton;
|
||||
sigc::connection spotConn;
|
||||
|
Reference in New Issue
Block a user