Add reset button to whitebalance panel (back to Camera defaults).
Fixes #5054
This commit is contained in:
@@ -248,10 +248,17 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
|
||||
std::vector<Gtk::CellRenderer*> cells = method->get_cells();
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*>(cells.at(1));
|
||||
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
|
||||
|
||||
resetButton = Gtk::manage (new Gtk::Button()); // No label, keep it short
|
||||
setExpandAlignProperties(resetButton, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
|
||||
resetButton->set_relief(Gtk::RELIEF_NONE);
|
||||
resetButton->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT);
|
||||
resetButton->set_image (*Gtk::manage (new RTImage ("undo-small.png")));
|
||||
|
||||
method->set_active (0); // Camera
|
||||
methodgrid->attach (*lab, 0, 0, 1, 1);
|
||||
methodgrid->attach (*method, 1, 0, 1, 1);
|
||||
methodgrid->attach (*resetButton, 2, 0, 1, 1);
|
||||
pack_start (*methodgrid, Gtk::PACK_SHRINK, 0 );
|
||||
opt = 0;
|
||||
|
||||
@@ -362,6 +369,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
|
||||
|
||||
spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) );
|
||||
methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) );
|
||||
resetButton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::resetWB) );
|
||||
spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) );
|
||||
}
|
||||
|
||||
@@ -828,6 +836,11 @@ void WhiteBalance::setWB (int vtemp, double vgreen)
|
||||
|
||||
}
|
||||
|
||||
void WhiteBalance::resetWB ()
|
||||
{
|
||||
setActiveMethod("Camera");
|
||||
}
|
||||
|
||||
void WhiteBalance::setAdjusterBehavior (bool tempadd, bool greenadd, bool equaladd, bool tempbiasadd)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user