diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index ba8ad6157..150fef5c4 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -248,10 +248,17 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB std::vector cells = method->get_cells(); Gtk::CellRendererText* cellRenderer = dynamic_cast(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) { diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 17e45e8bb..1ed99a2aa 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -65,6 +65,7 @@ protected: Glib::RefPtr refTreeModel; MethodColumns methodColumns; MyComboBox* method; + Gtk::Button* resetButton; MyComboBoxText* spotsize; Adjuster* temp; Adjuster* green; @@ -122,6 +123,7 @@ public: wblistener = l; } void setWB (int temp, double green); + void resetWB (); void WBChanged (double temp, double green, float studgood) override; void setAdjusterBehavior (bool tempadd, bool greenadd, bool equaladd, bool tempbiasadd);