diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 3ea6d649c..eaaf62cee 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -9,7 +9,7 @@ set (BASESOURCEFILES colorboost.cc resize.cc icmpanel.cc crop.cc shadowshighlights.cc colordenoise.cc impulsedenoise.cc dirpyrdenoise.cc - exifpanel.cc + exifpanel.cc toolpanel.cc sharpening.cc whitebalance.cc vignetting.cc rotate.cc distortion.cc crophandler.cc curveeditorgroup.cc curveeditor.cc dirbrowser.cc diff --git a/rtgui/cacorrection.cc b/rtgui/cacorrection.cc index 382b963bb..34eef052f 100644 --- a/rtgui/cacorrection.cc +++ b/rtgui/cacorrection.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -CACorrection::CACorrection () : vAdd(false) { +CACorrection::CACorrection () : Gtk::VBox(), FoldableToolPanel(this), vAdd(false) { red = Gtk::manage (new Adjuster (M("TP_CACORRECTION_RED"), -0.005, 0.005, 0.0001, 0)); red->setAdjusterListener (this); diff --git a/rtgui/cacorrection.h b/rtgui/cacorrection.h index 6fbd284ff..e3ac82a98 100644 --- a/rtgui/cacorrection.h +++ b/rtgui/cacorrection.h @@ -23,7 +23,7 @@ #include #include -class CACorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class CACorrection : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* red; diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index b41f44a9b..2ac6355d1 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -21,7 +21,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ChMixer::ChMixer () { +ChMixer::ChMixer (): Gtk::VBox(), FoldableToolPanel(this) { Gtk::Label* rlabel = Gtk::manage (new Gtk::Label ()); rlabel->set_markup (Glib::ustring("") + M("TP_CHMIXER_RED") + Glib::ustring(":")); diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h index e6eb6afc0..e9707b50f 100644 --- a/rtgui/chmixer.h +++ b/rtgui/chmixer.h @@ -23,7 +23,7 @@ #include #include -class ChMixer : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ChMixer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster *red[3]; diff --git a/rtgui/colorboost.cc b/rtgui/colorboost.cc index 2b2ecff79..3d998b98a 100644 --- a/rtgui/colorboost.cc +++ b/rtgui/colorboost.cc @@ -23,7 +23,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ColorBoost::ColorBoost () : ToolPanel(), cbAdd(false) { +ColorBoost::ColorBoost () : Gtk::VBox(), FoldableToolPanel(this), cbAdd(false) { colorboost = new Adjuster (M("TP_COLORBOOST_AMOUNT"), -100, 300, 1, 0); diff --git a/rtgui/colorboost.h b/rtgui/colorboost.h index d7efc4ad6..f027dc608 100644 --- a/rtgui/colorboost.h +++ b/rtgui/colorboost.h @@ -23,7 +23,7 @@ #include #include -class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ColorBoost : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* colorboost; diff --git a/rtgui/colordenoise.cc b/rtgui/colordenoise.cc index 956315518..602002d1f 100644 --- a/rtgui/colordenoise.cc +++ b/rtgui/colordenoise.cc @@ -24,7 +24,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ColorDenoise::ColorDenoise () : ToolPanel() { +ColorDenoise::ColorDenoise () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/colordenoise.h b/rtgui/colordenoise.h index 2980ce30c..aea0b67fc 100644 --- a/rtgui/colordenoise.h +++ b/rtgui/colordenoise.h @@ -23,7 +23,7 @@ #include #include -class ColorDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ColorDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* amount; diff --git a/rtgui/colorshift.cc b/rtgui/colorshift.cc index 4568df63a..8b045041b 100644 --- a/rtgui/colorshift.cc +++ b/rtgui/colorshift.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ColorShift::ColorShift () : ToolPanel(), aAdd(false), bAdd(false) { +ColorShift::ColorShift () : Gtk::VBox(), FoldableToolPanel(this), aAdd(false), bAdd(false) { ashift = Gtk::manage (new Adjuster (M("TP_COLORSHIFT_GREENMAGENTA"), -25, 25, 0.1, 0)); pack_start (*ashift); diff --git a/rtgui/colorshift.h b/rtgui/colorshift.h index 7445398df..6d8659bab 100644 --- a/rtgui/colorshift.h +++ b/rtgui/colorshift.h @@ -23,7 +23,7 @@ #include #include -class ColorShift : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ColorShift : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* ashift; diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 3dc34a807..43592be86 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -34,7 +34,7 @@ class RefreshSpinHelper { : crop(_crop), notify(_notify) {} }; -Crop::Crop () { +Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { clistener = NULL; diff --git a/rtgui/crop.h b/rtgui/crop.h index f2f30ce44..62a36095d 100644 --- a/rtgui/crop.h +++ b/rtgui/crop.h @@ -30,7 +30,7 @@ class CropPanelListener { }; -class Crop : public Gtk::VBox, public CropGUIListener, public ToolPanel, public rtengine::SizeListener { +class Crop : public Gtk::VBox, public CropGUIListener, public FoldableToolPanel, public rtengine::SizeListener { protected: Gtk::CheckButton* enabled; diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index fb3954e74..a4a3292c9 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -23,7 +23,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Defringe::Defringe () : ToolPanel () { +Defringe::Defringe () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/defringe.h b/rtgui/defringe.h index 4d41d8bc6..df0c908c6 100644 --- a/rtgui/defringe.h +++ b/rtgui/defringe.h @@ -23,7 +23,7 @@ #include #include -class Defringe : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class Defringe : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* radius; diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 9fcb09375..809cfdc9d 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -23,7 +23,7 @@ using namespace rtengine; using namespace rtengine::procparams; -DirPyrDenoise::DirPyrDenoise () : ToolPanel () { +DirPyrDenoise::DirPyrDenoise () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/dirpyrdenoise.h b/rtgui/dirpyrdenoise.h index e9f91b017..714131f37 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -23,7 +23,7 @@ #include #include -class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* luma; diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index eec259bf7..bb4545add 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -DirPyrEqualizer::DirPyrEqualizer () : ToolPanel() { +DirPyrEqualizer::DirPyrEqualizer () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h index ddad93034..c47090dc9 100644 --- a/rtgui/dirpyrequalizer.h +++ b/rtgui/dirpyrequalizer.h @@ -24,7 +24,7 @@ #include #include -class DirPyrEqualizer : public Gtk::VBox, public AdjusterListener, public ToolPanel +class DirPyrEqualizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index df9e12949..ab3bc3eee 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Distortion::Distortion () { +Distortion::Distortion (): Gtk::VBox(), FoldableToolPanel(this) { distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0)); distor->setAdjusterListener (this); diff --git a/rtgui/distortion.h b/rtgui/distortion.h index dc1f927ef..4b6162f9b 100644 --- a/rtgui/distortion.h +++ b/rtgui/distortion.h @@ -23,7 +23,7 @@ #include #include -class Distortion : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class Distortion : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* distor; diff --git a/rtgui/equalizer.cc b/rtgui/equalizer.cc index 6fe4a6ea1..dee93b340 100644 --- a/rtgui/equalizer.cc +++ b/rtgui/equalizer.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Equalizer::Equalizer () : ToolPanel() { +Equalizer::Equalizer () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); diff --git a/rtgui/equalizer.h b/rtgui/equalizer.h index 85790f952..fc07020e9 100644 --- a/rtgui/equalizer.h +++ b/rtgui/equalizer.h @@ -24,7 +24,7 @@ #include #include -class Equalizer : public Gtk::VBox, public AdjusterListener, public ToolPanel +class Equalizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: diff --git a/rtgui/hlrec.cc b/rtgui/hlrec.cc index 0939cf3bd..378caf57d 100644 --- a/rtgui/hlrec.cc +++ b/rtgui/hlrec.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -HLRecovery::HLRecovery () : ToolPanel() { +HLRecovery::HLRecovery () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLE"))); enabled->set_active (false); diff --git a/rtgui/hlrec.h b/rtgui/hlrec.h index c77e47fab..e282c04cd 100644 --- a/rtgui/hlrec.h +++ b/rtgui/hlrec.h @@ -22,7 +22,7 @@ #include #include -class HLRecovery : public Gtk::VBox, public ToolPanel { +class HLRecovery : public Gtk::VBox, public FoldableToolPanel { protected: Gtk::CheckButton* enabled; diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index c9e9b29fd..3af59c94a 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -24,7 +24,7 @@ using namespace rtengine::procparams; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -HSVEqualizer::HSVEqualizer () : ToolPanel () { +HSVEqualizer::HSVEqualizer () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index 468c710c6..8e01610e5 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -26,7 +26,7 @@ #include -class HSVEqualizer : public Gtk::VBox, public AdjusterListener, public ToolPanel +class HSVEqualizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 208868e62..88492be57 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -26,7 +26,7 @@ using namespace rtengine::procparams; extern Options options; -ICMPanel::ICMPanel () : ToolPanel(), iunchanged(NULL), icmplistener(NULL) { +ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), icmplistener(NULL) { // set_border_width (4); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index d022e9b4c..c83c55cf6 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -28,7 +28,7 @@ class ICMPanelListener { virtual void saveInputICCReference (Glib::ustring fname) {} }; -class ICMPanel : public Gtk::VBox, public ToolPanel { +class ICMPanel : public Gtk::VBox, public FoldableToolPanel { private: Gtk::RadioButton* inone; diff --git a/rtgui/impulsedenoise.cc b/rtgui/impulsedenoise.cc index f09cce743..aadf6c759 100644 --- a/rtgui/impulsedenoise.cc +++ b/rtgui/impulsedenoise.cc @@ -24,7 +24,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ImpulseDenoise::ImpulseDenoise () : ToolPanel() { +ImpulseDenoise::ImpulseDenoise () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/impulsedenoise.h b/rtgui/impulsedenoise.h index 8aefd5e48..e2cba771d 100644 --- a/rtgui/impulsedenoise.h +++ b/rtgui/impulsedenoise.h @@ -23,7 +23,7 @@ #include #include -class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* thresh; diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index be30e66df..f2b96b96b 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -LCurve::LCurve () : ToolPanel(), brAdd(false), contrAdd(false), satAdd(false) { +LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this), brAdd(false), contrAdd(false), satAdd(false) { brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100, 100, 0.01, 0)); contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100, 100, 1, 0)); diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index ce404f959..f93d9a8eb 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -25,7 +25,7 @@ #include #include -class LCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public CurveListener { +class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public CurveListener { protected: Gtk::ComboBoxText* channel; diff --git a/rtgui/lcurve.cc b/rtgui/lcurve.cc index 55bea0a9b..ba5f3c27e 100644 --- a/rtgui/lcurve.cc +++ b/rtgui/lcurve.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -LCurve::LCurve () : ToolPanel(), brAdd(false), contrAdd(false) { +LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this), brAdd(false), contrAdd(false) { Gtk::HBox* abox = Gtk::manage (new Gtk::HBox ()); abox->set_border_width (2); diff --git a/rtgui/lcurve.h b/rtgui/lcurve.h index b8174b49c..1a553e195 100644 --- a/rtgui/lcurve.h +++ b/rtgui/lcurve.h @@ -25,7 +25,7 @@ #include #include -class LCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public CurveListener { +class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public CurveListener { protected: Adjuster* brightness; diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index a7032c674..e7d3c0924 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -24,7 +24,7 @@ extern Glib::ustring argv0; using namespace rtengine; using namespace rtengine::procparams; -LensGeometry::LensGeometry () : ToolPanel(), rlistener(NULL) { +LensGeometry::LensGeometry () : Gtk::VBox(), FoldableToolPanel(this), rlistener(NULL) { fill = Gtk::manage (new Gtk::CheckButton (M("TP_LENSGEOM_FILL"))); pack_start (*fill); diff --git a/rtgui/lensgeom.h b/rtgui/lensgeom.h index b176605e3..355b066ee 100644 --- a/rtgui/lensgeom.h +++ b/rtgui/lensgeom.h @@ -23,7 +23,7 @@ #include #include -class LensGeometry : public Gtk::VBox, public ToolPanel { +class LensGeometry : public Gtk::VBox, public FoldableToolPanel { protected: Gtk::Button* autoCrop; diff --git a/rtgui/lumadenoise.cc b/rtgui/lumadenoise.cc index 29d0b7aea..d0f084d0b 100644 --- a/rtgui/lumadenoise.cc +++ b/rtgui/lumadenoise.cc @@ -23,7 +23,7 @@ using namespace rtengine; using namespace rtengine::procparams; -LumaDenoise::LumaDenoise () : ToolPanel () { +LumaDenoise::LumaDenoise () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/lumadenoise.h b/rtgui/lumadenoise.h index bb3b74233..148f47def 100644 --- a/rtgui/lumadenoise.h +++ b/rtgui/lumadenoise.h @@ -23,7 +23,7 @@ #include #include -class LumaDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class LumaDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* radius; diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index e03212f05..31ef3f4bb 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -21,7 +21,7 @@ using namespace rtengine; using namespace rtengine::procparams; -PerspCorrection::PerspCorrection () : vAdd(false) { +PerspCorrection::PerspCorrection () : Gtk::VBox(), FoldableToolPanel(this), vAdd(false) { horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 1, 0)); horiz->setAdjusterListener (this); diff --git a/rtgui/perspective.h b/rtgui/perspective.h index 7812a4472..d575f1e5b 100644 --- a/rtgui/perspective.h +++ b/rtgui/perspective.h @@ -23,7 +23,7 @@ #include #include -class PerspCorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class PerspCorrection : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* horiz; diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index 455e43973..f11151625 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -25,7 +25,7 @@ using namespace rtengine; using namespace rtengine::procparams; -PreProcess::PreProcess () +PreProcess::PreProcess (): Gtk::VBox(), FoldableToolPanel(this) { hbdf = Gtk::manage(new Gtk::HBox()); darkFrameFile = Gtk::manage(new Gtk::FileChooserButton(M("TP_PREPROCESS_DARKFRAME"), Gtk::FILE_CHOOSER_ACTION_OPEN)); diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h index 950941125..5709704fd 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -36,7 +36,7 @@ class FFProvider { // add other info here }; -class PreProcess : public Gtk::VBox, public AdjusterListener, public ToolPanel{ +class PreProcess : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel{ protected: diff --git a/rtgui/rawprocess.cc b/rtgui/rawprocess.cc index 6f526947e..6484c6fb0 100644 --- a/rtgui/rawprocess.cc +++ b/rtgui/rawprocess.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -RawProcess::RawProcess () +RawProcess::RawProcess () : Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("PREFERENCES_DMETHOD") +": "))); diff --git a/rtgui/rawprocess.h b/rtgui/rawprocess.h index e3eeab49d..385354359 100644 --- a/rtgui/rawprocess.h +++ b/rtgui/rawprocess.h @@ -24,7 +24,7 @@ #include -class RawProcess : public Gtk::VBox, public AdjusterListener, public ToolPanel{ +class RawProcess : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel{ protected: diff --git a/rtgui/resize.cc b/rtgui/resize.cc index 37e9ff354..afcc3cc1e 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -1,576 +1,576 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -Resize::Resize () : maxw(100000), maxh(100000) { - - cropw = 0; - croph = 0; - - enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); - pack_start(*enabled); - pack_start(*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2); - - Gtk::Table* combos = Gtk::manage (new Gtk::Table (2, 2)); - - appliesTo = Gtk::manage (new Gtk::ComboBoxText ()); - appliesTo->append_text (M("TP_RESIZE_CROPPEDAREA")); - appliesTo->append_text (M("TP_RESIZE_FULLIMAGE")); - appliesTo->set_active (0); - - combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_APPLIESTO"))), 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - combos->attach (*appliesTo, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - method = Gtk::manage (new Gtk::ComboBoxText ()); - method->append_text (M("TP_RESIZE_NEAREST")); - method->append_text (M("TP_RESIZE_BILINEAR")); - method->append_text (M("TP_RESIZE_BICUBIC")); - method->append_text (M("TP_RESIZE_BICUBICSF")); - method->append_text (M("TP_RESIZE_BICUBICSH")); - method->append_text (M("TP_RESIZE_DOWNSCALEB")); - method->append_text (M("TP_RESIZE_DOWNSCALEF")); - method->append_text (M("TP_RESIZE_LANCZOS")); - method->set_active (0); - - combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_METHOD"))), 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - combos->attach (*method, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - spec = Gtk::manage (new Gtk::ComboBoxText ()); - spec->append_text (M("TP_RESIZE_SCALE")); - spec->append_text (M("TP_RESIZE_WIDTH")); - spec->append_text (M("TP_RESIZE_HEIGHT")); - spec->append_text (M("TP_RESIZE_FITBOX")); - spec->set_active (0); - - combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_SPECIFY"))), 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - combos->attach (*spec, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - pack_start (*combos, Gtk::PACK_SHRINK, 4); - - scale = new Adjuster (M("TP_RESIZE_SCALE"), 0.01, 4, 0.01, 1.); - scale->setAdjusterListener (this); - - pack_start (*scale, Gtk::PACK_SHRINK, 4); - - sizeBox = Gtk::manage (new Gtk::VBox ()); - - Gtk::HBox* sbox = Gtk::manage (new Gtk::HBox ()); - Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); - Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); - w = Gtk::manage (new Gtk::SpinButton ()); - h = Gtk::manage (new Gtk::SpinButton ()); - wbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_W"))), Gtk::PACK_SHRINK, 4); - wbox->pack_start (*w); - hbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_H"))), Gtk::PACK_SHRINK, 4); - hbox->pack_start (*h); - sbox->pack_start (*wbox); - sbox->pack_start (*hbox); - - sizeBox->pack_start (*sbox, Gtk::PACK_SHRINK, 4); - sizeBox->show_all (); - sizeBox->reference (); - - w->set_digits (0); - w->set_increments (1,100); - w->set_value (800); - w->set_range (32, 4*maxw); - - h->set_digits (0); - h->set_increments (1,100); - h->set_value (600); - h->set_range (32, 4*maxh); - - wconn = w->signal_value_changed().connect ( sigc::mem_fun(*this, &Resize::entryWChanged), true); - hconn = h->signal_value_changed().connect ( sigc::mem_fun(*this, &Resize::entryHChanged), true); - aconn = appliesTo->signal_changed().connect ( sigc::mem_fun(*this, &Resize::appliesToChanged) ); - method->signal_changed().connect ( sigc::mem_fun(*this, &Resize::methodChanged) ); - sconn = spec->signal_changed().connect ( sigc::mem_fun(*this, &Resize::specChanged) ); - enaConn = enabled->signal_toggled().connect ( sigc::mem_fun(*this, &Resize::enabledToggled) ); - - show_all(); -} - -Resize::~Resize () { - - delete scale; - delete sizeBox; -} - -void Resize::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - aconn.block (true); - wconn.block (true); - hconn.block (true); - sconn.block (true); - scale->block(true); - - scale->setValue (pp->resize.scale); - w->set_value (pp->resize.width); - h->set_value (pp->resize.height); - enabled->set_active (pp->resize.enabled); - spec->set_active (pp->resize.dataspec); - updateGUI(); - - appliesTo->set_active (0); - if (pp->resize.appliesTo == "Cropped area") - appliesTo->set_active (0); - else if (pp->resize.appliesTo == "Full image") - appliesTo->set_active (1); - - method->set_active (2); - if (pp->resize.method == "Nearest") - method->set_active (0); - else if (pp->resize.method == "Bilinear") - method->set_active (1); - else if (pp->resize.method == "Bicubic") - method->set_active (2); - else if (pp->resize.method == "Bicubic (Softer)") - method->set_active (3); - else if (pp->resize.method == "Bicubic (Sharper)") - method->set_active (4); - else if (pp->resize.method == "Downscale (Better)") - method->set_active (5); - else if (pp->resize.method == "Downscale (Faster)") - method->set_active (6); - else if (pp->resize.method == "Lanczos") - method->set_active (7); - - wDirty = false; - hDirty = false; - - if (pedited) { - wDirty = pedited->resize.width; - hDirty = pedited->resize.height; - scale->setEditedState (pedited->resize.scale ? Edited : UnEdited); - if (!pedited->resize.appliesTo) - method->set_active (2); - if (!pedited->resize.method) - method->set_active (8); - if (!pedited->resize.dataspec) - spec->set_active (4); - enabled->set_inconsistent (!pedited->resize.enabled); - } - - lastEnabled = pp->resize.enabled; - - scale->block(false); - sconn.block (false); - wconn.block (false); - hconn.block (false); - aconn.block (false); - enableListener (); -} - -void Resize::write (ProcParams* pp, ParamsEdited* pedited) { - int dataSpec = spec->get_active_row_number(); - - pp->resize.scale = scale->getValue(); - - pp->resize.appliesTo = "Cropped area"; - if (appliesTo->get_active_row_number() == 0) - pp->resize.appliesTo = "Cropped area"; - else if (appliesTo->get_active_row_number() == 1) - pp->resize.appliesTo = "Full image"; - - pp->resize.method = "Bicubic"; - if (method->get_active_row_number() == 0) - pp->resize.method = "Nearest"; - else if (method->get_active_row_number() == 1) - pp->resize.method = "Bilinear"; - else if (method->get_active_row_number() == 2) - pp->resize.method = "Bicubic"; - else if (method->get_active_row_number() == 3) - pp->resize.method = "Bicubic (Softer)"; - else if (method->get_active_row_number() == 4) - pp->resize.method = "Bicubic (Sharper)"; - else if (method->get_active_row_number() == 5) - pp->resize.method = "Downscale (Better)"; - else if (method->get_active_row_number() == 6) - pp->resize.method = "Downscale (Faster)"; - else if (method->get_active_row_number() == 7) - pp->resize.method = "Lanczos"; - - pp->resize.dataspec = dataSpec; - pp->resize.width = w->get_value_as_int (); - pp->resize.height = h->get_value_as_int (); - pp->resize.enabled = enabled->get_active (); - //printf(" L:%d H:%d\n", pp->resize.width, pp->resize.height); - - if (pedited) { - pedited->resize.enabled = !enabled->get_inconsistent(); - pedited->resize.dataspec = dataSpec != 4; - pedited->resize.appliesTo = appliesTo->get_active_row_number() != 2; - pedited->resize.method = method->get_active_row_number() != 8; - if (pedited->resize.dataspec) { - pedited->resize.scale = scale->getEditedState (); - pedited->resize.width = wDirty; - pedited->resize.height = hDirty; - } - else { - pedited->resize.scale = false; - pedited->resize.width = false; - pedited->resize.height = false; - } - } -} - -void Resize::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - scale->setDefault (defParams->resize.scale); - - if (pedited) - scale->setDefaultEditedState (pedited->resize.scale ? Edited : UnEdited); - else - scale->setDefaultEditedState (Irrelevant); -} - -void Resize::adjusterChanged (Adjuster* a, double newval) { - - if (!batchMode) { - wconn.block (true); - hconn.block (true); - h->set_value ((croph && appliesTo->get_active_row_number()==0 ? croph : maxh) * a->getValue ()); - w->set_value ((cropw && appliesTo->get_active_row_number()==0 ? cropw : maxw) * a->getValue ()); - wconn.block (false); - hconn.block (false); - } - - if (listener && (enabled->get_active () || batchMode)) - listener->panelChanged (EvResizeScale, Glib::ustring::format (std::setw(5), std::fixed, std::setprecision(2), scale->getValue())); -} - -int Resize::getComputedWidth() { - - if (cropw && appliesTo->get_active_row_number()==0) - // we use the crop dimensions - return (int)((double)(cropw) * (h->get_value()/(double)(croph)) + 0.5); - else - // we use the image dimensions - return (int)((double)(maxw) * (h->get_value()/(double)(maxh)) + 0.5); -} - -int Resize::getComputedHeight() { - - if (croph && appliesTo->get_active_row_number()==0) - // we use the crop dimensions - return (int)((double)(croph) * (w->get_value()/(double)(cropw)) + 0.5); - else - // we use the image dimensions - return (int)((double)(maxh) * (w->get_value()/(double)(maxw)) + 0.5); -} - -void Resize::appliesToChanged () { - - //printf("\nPASSAGE EN MODE \"%s\"\n\n", appliesTo->get_active_text().c_str()); - setDimensions(); - if (listener && (enabled->get_active () || batchMode)) { - //printf("Appel du listener\n"); - listener->panelChanged (EvResizeAppliesTo, appliesTo->get_active_text()); - } -} - -void Resize::methodChanged () { - - if (listener && (enabled->get_active () || batchMode)) - listener->panelChanged (EvResizeMethod, method->get_active_text()); -} - -void Resize::update (bool isCropped, int cw, int ch, int ow, int oh) { - - // updating crop values now - if (isCropped) { - cropw = cw; - croph = ch; - } - else { - cropw = 0; - croph = 0; - } - - // updating the full image dimensions - if (ow && oh) { - maxw = ow; - maxh = oh; - } - // updating the GUI synchronously - setDimensions(); -} - -void Resize::sizeChanged (int mw, int mh, int ow, int oh) { - - // updating max values now - maxw = ow; - maxh = oh; - - // updating the GUI synchronously - setDimensions(); -} - -void Resize::setDimensions () { - - int refw, refh; - - wconn.block (true); - hconn.block (true); - scale->block(true); - - if (appliesTo->get_active_row_number()==0 && cropw) { - // Applies to Cropped area - refw = cropw; - refh = croph; - } - else { - // Applies to Full image or crop is disabled - refw = maxw; - refh = maxh; - } - w->set_range (32, 4*refw); - h->set_range (32, 4*refh); - - double tmpScale; - switch (spec->get_active_row_number()) { - case (0): // Scale mode - w->set_value((double)((int)( (double)(refw) * scale->getValue() + 0.5) )); - h->set_value((double)((int)( (double)(refh) * scale->getValue() + 0.5) )); - break; - case (1): // Width mode - tmpScale = w->get_value() / (double)refw; - scale->setValue (tmpScale); - h->set_value((double)((int)( (double)(refh) * tmpScale + 0.5) )); - break; - case (2): // Height mode - tmpScale = h->get_value() / (double)refh; - scale->setValue (tmpScale); - w->set_value((double)((int)( (double)(refw) * tmpScale + 0.5) )); - case (3): { // Bounding box mode - double wSliderValue = w->get_value(); - double hSliderValue = h->get_value(); - if ( (wSliderValue/hSliderValue) < ((double)refw/(double)refh)) { - tmpScale = wSliderValue / (double)refw; - } - else { - tmpScale = hSliderValue / (double)refh; - } - scale->setValue (tmpScale); - break; - } - default: - break; - } - - scale->block(false); - wconn.block (false); - hconn.block (false); -} - -void Resize::fitBoxScale() { - double tmpScale; - double neww = w->get_value (); - double newh = h->get_value (); - - if (cropw && appliesTo->get_active_row_number()==0) { - // we use the crop dimensions - if (((double)(cropw) / (double)(croph)) > (neww / newh)) { - // the new scale is given by the image width - tmpScale = neww / (double)(cropw); - } - else { - // the new scale is given by the image height - tmpScale = newh / (double)(croph); - } - } - else { - // we use the image dimensions - if (((double)(maxw) / (double)(maxh)) > (neww / newh)) { - // the new scale is given by the image width - tmpScale = neww / (double)(maxw); - } - else { - // the new scale is given by the image height - tmpScale = newh / (double)(maxh); - } - } - scale->setValue (tmpScale); -} - -void Resize::entryWChanged () { - - wDirty = true; - - // updating width - if (!batchMode) { - if (spec->get_active_row_number() == 3) { - // Fit box mode - fitBoxScale(); - } - else { - // Other modes - hconn.block (true); - scale->block (true); - - h->set_value ((double)(getComputedHeight())); - scale->setValue (w->get_value () / (cropw && appliesTo->get_active_row_number()==0 ? (double)cropw : (double)maxw)); - - scale->block (false); - hconn.block (false); - } - } - - if (listener) { - if (spec->get_active_row_number() == 3) - notifyBBox(); - else { - if (enabled->get_active () || batchMode) - listener->panelChanged (EvResizeWidth, Glib::ustring::format (w->get_value_as_int())); - } - } -} - -void Resize::entryHChanged () { - - hDirty = true; - - if (!batchMode && listener) { - if (spec->get_active_row_number() == 3) { - // Fit box mode - fitBoxScale(); - } - else { - // Other modes - wconn.block (true); - scale->block (true); - - w->set_value ((double)(getComputedWidth())); - scale->setValue (h->get_value () / (croph && appliesTo->get_active_row_number()==0 ? (double)croph : (double)maxh)); - - scale->block (false); - wconn.block (false); - } - } - - if (listener) { - if (spec->get_active_row_number() == 3) - notifyBBox(); - else { - if (enabled->get_active () || batchMode) - listener->panelChanged (EvResizeHeight, Glib::ustring::format (h->get_value_as_int())); - } - } -} - -void Resize::specChanged () { - - switch (spec->get_active_row_number()) { - case (0): - // Scale mode - scale->sliderChanged (); - break; - case (1): - // Width mode - w->set_value((double)(getComputedWidth())); - entryWChanged (); - break; - case (2): - // Height mode - h->set_value((double)(getComputedHeight())); - entryHChanged (); - break; - case (3): - // Bounding box mode - notifyBBox(); - default: - break; - } - updateGUI(); -} - -void Resize::updateGUI () { - - removeIfThere (this, scale, false); - removeIfThere (this, sizeBox, false); - - switch (spec->get_active_row_number()) { - case (0): - // Scale mode - pack_start (*scale, Gtk::PACK_SHRINK, 4); - break; - case (1): - // Width mode - pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); - w->set_sensitive (true); - h->set_sensitive (false); - break; - case (2): - // Height mode - pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); - w->set_sensitive (false); - h->set_sensitive (true); - break; - case (3): - // Bounding box mode - pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); - w->set_sensitive (true); - h->set_sensitive (true); - default: - break; - } -} - -void Resize::notifyBBox() { - if (listener && (enabled->get_active () || batchMode)) - listener->panelChanged (EvResizeBoundingBox, Glib::ustring::compose("(%1x%2)",(int)w->get_value(), (int)h->get_value() )); -} - -void Resize::setBatchMode (bool batchMode) { - - method->append_text (M("GENERAL_UNCHANGED")); - spec->append_text (M("GENERAL_UNCHANGED")); - ToolPanel::setBatchMode (batchMode); - scale->showEditedCB (); -} - -void Resize::enabledToggled () { - - if (batchMode) { - if (enabled->get_inconsistent()) { - enabled->set_inconsistent (false); - enaConn.block (true); - enabled->set_active (false); - enaConn.block (false); - } - else if (lastEnabled) - enabled->set_inconsistent (true); - - lastEnabled = enabled->get_active (); - } - - if (listener) { - if (enabled->get_active ()) - listener->panelChanged (EvResizeEnabled, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvResizeEnabled, M("GENERAL_DISABLED")); - } -} - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100000) { + + cropw = 0; + croph = 0; + + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); + pack_start(*enabled); + pack_start(*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2); + + Gtk::Table* combos = Gtk::manage (new Gtk::Table (2, 2)); + + appliesTo = Gtk::manage (new Gtk::ComboBoxText ()); + appliesTo->append_text (M("TP_RESIZE_CROPPEDAREA")); + appliesTo->append_text (M("TP_RESIZE_FULLIMAGE")); + appliesTo->set_active (0); + + combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_APPLIESTO"))), 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + combos->attach (*appliesTo, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + method = Gtk::manage (new Gtk::ComboBoxText ()); + method->append_text (M("TP_RESIZE_NEAREST")); + method->append_text (M("TP_RESIZE_BILINEAR")); + method->append_text (M("TP_RESIZE_BICUBIC")); + method->append_text (M("TP_RESIZE_BICUBICSF")); + method->append_text (M("TP_RESIZE_BICUBICSH")); + method->append_text (M("TP_RESIZE_DOWNSCALEB")); + method->append_text (M("TP_RESIZE_DOWNSCALEF")); + method->append_text (M("TP_RESIZE_LANCZOS")); + method->set_active (0); + + combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_METHOD"))), 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + combos->attach (*method, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + spec = Gtk::manage (new Gtk::ComboBoxText ()); + spec->append_text (M("TP_RESIZE_SCALE")); + spec->append_text (M("TP_RESIZE_WIDTH")); + spec->append_text (M("TP_RESIZE_HEIGHT")); + spec->append_text (M("TP_RESIZE_FITBOX")); + spec->set_active (0); + + combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_SPECIFY"))), 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + combos->attach (*spec, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + pack_start (*combos, Gtk::PACK_SHRINK, 4); + + scale = new Adjuster (M("TP_RESIZE_SCALE"), 0.01, 4, 0.01, 1.); + scale->setAdjusterListener (this); + + pack_start (*scale, Gtk::PACK_SHRINK, 4); + + sizeBox = Gtk::manage (new Gtk::VBox ()); + + Gtk::HBox* sbox = Gtk::manage (new Gtk::HBox ()); + Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); + Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + w = Gtk::manage (new Gtk::SpinButton ()); + h = Gtk::manage (new Gtk::SpinButton ()); + wbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_W"))), Gtk::PACK_SHRINK, 4); + wbox->pack_start (*w); + hbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_H"))), Gtk::PACK_SHRINK, 4); + hbox->pack_start (*h); + sbox->pack_start (*wbox); + sbox->pack_start (*hbox); + + sizeBox->pack_start (*sbox, Gtk::PACK_SHRINK, 4); + sizeBox->show_all (); + sizeBox->reference (); + + w->set_digits (0); + w->set_increments (1,100); + w->set_value (800); + w->set_range (32, 4*maxw); + + h->set_digits (0); + h->set_increments (1,100); + h->set_value (600); + h->set_range (32, 4*maxh); + + wconn = w->signal_value_changed().connect ( sigc::mem_fun(*this, &Resize::entryWChanged), true); + hconn = h->signal_value_changed().connect ( sigc::mem_fun(*this, &Resize::entryHChanged), true); + aconn = appliesTo->signal_changed().connect ( sigc::mem_fun(*this, &Resize::appliesToChanged) ); + method->signal_changed().connect ( sigc::mem_fun(*this, &Resize::methodChanged) ); + sconn = spec->signal_changed().connect ( sigc::mem_fun(*this, &Resize::specChanged) ); + enaConn = enabled->signal_toggled().connect ( sigc::mem_fun(*this, &Resize::enabledToggled) ); + + show_all(); +} + +Resize::~Resize () { + + delete scale; + delete sizeBox; +} + +void Resize::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + aconn.block (true); + wconn.block (true); + hconn.block (true); + sconn.block (true); + scale->block(true); + + scale->setValue (pp->resize.scale); + w->set_value (pp->resize.width); + h->set_value (pp->resize.height); + enabled->set_active (pp->resize.enabled); + spec->set_active (pp->resize.dataspec); + updateGUI(); + + appliesTo->set_active (0); + if (pp->resize.appliesTo == "Cropped area") + appliesTo->set_active (0); + else if (pp->resize.appliesTo == "Full image") + appliesTo->set_active (1); + + method->set_active (2); + if (pp->resize.method == "Nearest") + method->set_active (0); + else if (pp->resize.method == "Bilinear") + method->set_active (1); + else if (pp->resize.method == "Bicubic") + method->set_active (2); + else if (pp->resize.method == "Bicubic (Softer)") + method->set_active (3); + else if (pp->resize.method == "Bicubic (Sharper)") + method->set_active (4); + else if (pp->resize.method == "Downscale (Better)") + method->set_active (5); + else if (pp->resize.method == "Downscale (Faster)") + method->set_active (6); + else if (pp->resize.method == "Lanczos") + method->set_active (7); + + wDirty = false; + hDirty = false; + + if (pedited) { + wDirty = pedited->resize.width; + hDirty = pedited->resize.height; + scale->setEditedState (pedited->resize.scale ? Edited : UnEdited); + if (!pedited->resize.appliesTo) + method->set_active (2); + if (!pedited->resize.method) + method->set_active (8); + if (!pedited->resize.dataspec) + spec->set_active (4); + enabled->set_inconsistent (!pedited->resize.enabled); + } + + lastEnabled = pp->resize.enabled; + + scale->block(false); + sconn.block (false); + wconn.block (false); + hconn.block (false); + aconn.block (false); + enableListener (); +} + +void Resize::write (ProcParams* pp, ParamsEdited* pedited) { + int dataSpec = spec->get_active_row_number(); + + pp->resize.scale = scale->getValue(); + + pp->resize.appliesTo = "Cropped area"; + if (appliesTo->get_active_row_number() == 0) + pp->resize.appliesTo = "Cropped area"; + else if (appliesTo->get_active_row_number() == 1) + pp->resize.appliesTo = "Full image"; + + pp->resize.method = "Bicubic"; + if (method->get_active_row_number() == 0) + pp->resize.method = "Nearest"; + else if (method->get_active_row_number() == 1) + pp->resize.method = "Bilinear"; + else if (method->get_active_row_number() == 2) + pp->resize.method = "Bicubic"; + else if (method->get_active_row_number() == 3) + pp->resize.method = "Bicubic (Softer)"; + else if (method->get_active_row_number() == 4) + pp->resize.method = "Bicubic (Sharper)"; + else if (method->get_active_row_number() == 5) + pp->resize.method = "Downscale (Better)"; + else if (method->get_active_row_number() == 6) + pp->resize.method = "Downscale (Faster)"; + else if (method->get_active_row_number() == 7) + pp->resize.method = "Lanczos"; + + pp->resize.dataspec = dataSpec; + pp->resize.width = w->get_value_as_int (); + pp->resize.height = h->get_value_as_int (); + pp->resize.enabled = enabled->get_active (); + //printf(" L:%d H:%d\n", pp->resize.width, pp->resize.height); + + if (pedited) { + pedited->resize.enabled = !enabled->get_inconsistent(); + pedited->resize.dataspec = dataSpec != 4; + pedited->resize.appliesTo = appliesTo->get_active_row_number() != 2; + pedited->resize.method = method->get_active_row_number() != 8; + if (pedited->resize.dataspec) { + pedited->resize.scale = scale->getEditedState (); + pedited->resize.width = wDirty; + pedited->resize.height = hDirty; + } + else { + pedited->resize.scale = false; + pedited->resize.width = false; + pedited->resize.height = false; + } + } +} + +void Resize::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + scale->setDefault (defParams->resize.scale); + + if (pedited) + scale->setDefaultEditedState (pedited->resize.scale ? Edited : UnEdited); + else + scale->setDefaultEditedState (Irrelevant); +} + +void Resize::adjusterChanged (Adjuster* a, double newval) { + + if (!batchMode) { + wconn.block (true); + hconn.block (true); + h->set_value ((croph && appliesTo->get_active_row_number()==0 ? croph : maxh) * a->getValue ()); + w->set_value ((cropw && appliesTo->get_active_row_number()==0 ? cropw : maxw) * a->getValue ()); + wconn.block (false); + hconn.block (false); + } + + if (listener && (enabled->get_active () || batchMode)) + listener->panelChanged (EvResizeScale, Glib::ustring::format (std::setw(5), std::fixed, std::setprecision(2), scale->getValue())); +} + +int Resize::getComputedWidth() { + + if (cropw && appliesTo->get_active_row_number()==0) + // we use the crop dimensions + return (int)((double)(cropw) * (h->get_value()/(double)(croph)) + 0.5); + else + // we use the image dimensions + return (int)((double)(maxw) * (h->get_value()/(double)(maxh)) + 0.5); +} + +int Resize::getComputedHeight() { + + if (croph && appliesTo->get_active_row_number()==0) + // we use the crop dimensions + return (int)((double)(croph) * (w->get_value()/(double)(cropw)) + 0.5); + else + // we use the image dimensions + return (int)((double)(maxh) * (w->get_value()/(double)(maxw)) + 0.5); +} + +void Resize::appliesToChanged () { + + //printf("\nPASSAGE EN MODE \"%s\"\n\n", appliesTo->get_active_text().c_str()); + setDimensions(); + if (listener && (enabled->get_active () || batchMode)) { + //printf("Appel du listener\n"); + listener->panelChanged (EvResizeAppliesTo, appliesTo->get_active_text()); + } +} + +void Resize::methodChanged () { + + if (listener && (enabled->get_active () || batchMode)) + listener->panelChanged (EvResizeMethod, method->get_active_text()); +} + +void Resize::update (bool isCropped, int cw, int ch, int ow, int oh) { + + // updating crop values now + if (isCropped) { + cropw = cw; + croph = ch; + } + else { + cropw = 0; + croph = 0; + } + + // updating the full image dimensions + if (ow && oh) { + maxw = ow; + maxh = oh; + } + // updating the GUI synchronously + setDimensions(); +} + +void Resize::sizeChanged (int mw, int mh, int ow, int oh) { + + // updating max values now + maxw = ow; + maxh = oh; + + // updating the GUI synchronously + setDimensions(); +} + +void Resize::setDimensions () { + + int refw, refh; + + wconn.block (true); + hconn.block (true); + scale->block(true); + + if (appliesTo->get_active_row_number()==0 && cropw) { + // Applies to Cropped area + refw = cropw; + refh = croph; + } + else { + // Applies to Full image or crop is disabled + refw = maxw; + refh = maxh; + } + w->set_range (32, 4*refw); + h->set_range (32, 4*refh); + + double tmpScale; + switch (spec->get_active_row_number()) { + case (0): // Scale mode + w->set_value((double)((int)( (double)(refw) * scale->getValue() + 0.5) )); + h->set_value((double)((int)( (double)(refh) * scale->getValue() + 0.5) )); + break; + case (1): // Width mode + tmpScale = w->get_value() / (double)refw; + scale->setValue (tmpScale); + h->set_value((double)((int)( (double)(refh) * tmpScale + 0.5) )); + break; + case (2): // Height mode + tmpScale = h->get_value() / (double)refh; + scale->setValue (tmpScale); + w->set_value((double)((int)( (double)(refw) * tmpScale + 0.5) )); + case (3): { // Bounding box mode + double wSliderValue = w->get_value(); + double hSliderValue = h->get_value(); + if ( (wSliderValue/hSliderValue) < ((double)refw/(double)refh)) { + tmpScale = wSliderValue / (double)refw; + } + else { + tmpScale = hSliderValue / (double)refh; + } + scale->setValue (tmpScale); + break; + } + default: + break; + } + + scale->block(false); + wconn.block (false); + hconn.block (false); +} + +void Resize::fitBoxScale() { + double tmpScale; + double neww = w->get_value (); + double newh = h->get_value (); + + if (cropw && appliesTo->get_active_row_number()==0) { + // we use the crop dimensions + if (((double)(cropw) / (double)(croph)) > (neww / newh)) { + // the new scale is given by the image width + tmpScale = neww / (double)(cropw); + } + else { + // the new scale is given by the image height + tmpScale = newh / (double)(croph); + } + } + else { + // we use the image dimensions + if (((double)(maxw) / (double)(maxh)) > (neww / newh)) { + // the new scale is given by the image width + tmpScale = neww / (double)(maxw); + } + else { + // the new scale is given by the image height + tmpScale = newh / (double)(maxh); + } + } + scale->setValue (tmpScale); +} + +void Resize::entryWChanged () { + + wDirty = true; + + // updating width + if (!batchMode) { + if (spec->get_active_row_number() == 3) { + // Fit box mode + fitBoxScale(); + } + else { + // Other modes + hconn.block (true); + scale->block (true); + + h->set_value ((double)(getComputedHeight())); + scale->setValue (w->get_value () / (cropw && appliesTo->get_active_row_number()==0 ? (double)cropw : (double)maxw)); + + scale->block (false); + hconn.block (false); + } + } + + if (listener) { + if (spec->get_active_row_number() == 3) + notifyBBox(); + else { + if (enabled->get_active () || batchMode) + listener->panelChanged (EvResizeWidth, Glib::ustring::format (w->get_value_as_int())); + } + } +} + +void Resize::entryHChanged () { + + hDirty = true; + + if (!batchMode && listener) { + if (spec->get_active_row_number() == 3) { + // Fit box mode + fitBoxScale(); + } + else { + // Other modes + wconn.block (true); + scale->block (true); + + w->set_value ((double)(getComputedWidth())); + scale->setValue (h->get_value () / (croph && appliesTo->get_active_row_number()==0 ? (double)croph : (double)maxh)); + + scale->block (false); + wconn.block (false); + } + } + + if (listener) { + if (spec->get_active_row_number() == 3) + notifyBBox(); + else { + if (enabled->get_active () || batchMode) + listener->panelChanged (EvResizeHeight, Glib::ustring::format (h->get_value_as_int())); + } + } +} + +void Resize::specChanged () { + + switch (spec->get_active_row_number()) { + case (0): + // Scale mode + scale->sliderChanged (); + break; + case (1): + // Width mode + w->set_value((double)(getComputedWidth())); + entryWChanged (); + break; + case (2): + // Height mode + h->set_value((double)(getComputedHeight())); + entryHChanged (); + break; + case (3): + // Bounding box mode + notifyBBox(); + default: + break; + } + updateGUI(); +} + +void Resize::updateGUI () { + + removeIfThere (this, scale, false); + removeIfThere (this, sizeBox, false); + + switch (spec->get_active_row_number()) { + case (0): + // Scale mode + pack_start (*scale, Gtk::PACK_SHRINK, 4); + break; + case (1): + // Width mode + pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); + w->set_sensitive (true); + h->set_sensitive (false); + break; + case (2): + // Height mode + pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); + w->set_sensitive (false); + h->set_sensitive (true); + break; + case (3): + // Bounding box mode + pack_start (*sizeBox, Gtk::PACK_SHRINK, 4); + w->set_sensitive (true); + h->set_sensitive (true); + default: + break; + } +} + +void Resize::notifyBBox() { + if (listener && (enabled->get_active () || batchMode)) + listener->panelChanged (EvResizeBoundingBox, Glib::ustring::compose("(%1x%2)",(int)w->get_value(), (int)h->get_value() )); +} + +void Resize::setBatchMode (bool batchMode) { + + method->append_text (M("GENERAL_UNCHANGED")); + spec->append_text (M("GENERAL_UNCHANGED")); + ToolPanel::setBatchMode (batchMode); + scale->showEditedCB (); +} + +void Resize::enabledToggled () { + + if (batchMode) { + if (enabled->get_inconsistent()) { + enabled->set_inconsistent (false); + enaConn.block (true); + enabled->set_active (false); + enaConn.block (false); + } + else if (lastEnabled) + enabled->set_inconsistent (true); + + lastEnabled = enabled->get_active (); + } + + if (listener) { + if (enabled->get_active ()) + listener->panelChanged (EvResizeEnabled, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvResizeEnabled, M("GENERAL_DISABLED")); + } +} + diff --git a/rtgui/resize.h b/rtgui/resize.h index 1fbe809ba..85a795a53 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -23,7 +23,7 @@ #include #include -class Resize : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::SizeListener { +class Resize : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::SizeListener { protected: Gtk::CheckButton* enabled; diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index 2678a84e6..809139757 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -25,7 +25,7 @@ extern Glib::ustring argv0; using namespace rtengine; using namespace rtengine::procparams; -Rotate::Rotate () : ToolPanel (), degAdd(false) { +Rotate::Rotate () : Gtk::VBox(), FoldableToolPanel(this), degAdd(false) { rlistener = NULL; diff --git a/rtgui/rotate.h b/rtgui/rotate.h index 5a2ea0bb8..65bc229a7 100644 --- a/rtgui/rotate.h +++ b/rtgui/rotate.h @@ -24,7 +24,7 @@ #include #include -class Rotate : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class Rotate : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* degree; diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc index a70497485..9d20e34c8 100644 --- a/rtgui/shadowshighlights.cc +++ b/rtgui/shadowshighlights.cc @@ -21,7 +21,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ShadowsHighlights::ShadowsHighlights () : ToolPanel() { +ShadowsHighlights::ShadowsHighlights () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/shadowshighlights.h b/rtgui/shadowshighlights.h index e74d64c20..6bfc87327 100644 --- a/rtgui/shadowshighlights.h +++ b/rtgui/shadowshighlights.h @@ -23,7 +23,7 @@ #include #include -class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* highlights; diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index 1ff514313..b0819fa9a 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -24,7 +24,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Sharpening::Sharpening () : ToolPanel () { +Sharpening::Sharpening () : Gtk::VBox(), FoldableToolPanel(this) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index e96edcd41..49efa72a3 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -23,7 +23,7 @@ #include #include -class Sharpening : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class Sharpening : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Gtk::ComboBoxText* method; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 5da391e66..70b96e909 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -25,7 +25,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ToneCurve::ToneCurve () : ToolPanel(), expAdd(false),hlcompAdd(false),hlcompthreshAdd(false), blackAdd(false), shcompAdd(false), brAdd(false), contrAdd(false) { +ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this), expAdd(false),hlcompAdd(false),hlcompthreshAdd(false), blackAdd(false), shcompAdd(false), brAdd(false), contrAdd(false) { //----------- Auto Levels ---------------------------------- abox = Gtk::manage (new Gtk::HBox ()); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index 63aca20aa..006c49f14 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -26,7 +26,7 @@ #include #include -class ToneCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::AutoExpListener, public CurveListener { +class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoExpListener, public CurveListener { protected: Gtk::HBox* abox; diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc new file mode 100644 index 000000000..0097fe5ba --- /dev/null +++ b/rtgui/toolpanel.cc @@ -0,0 +1,54 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +using namespace rtengine::procparams; + +FoldableToolPanel::FoldableToolPanel(Gtk::Box* content) : ToolPanel(), parentContainer(NULL), exp(NULL) { + + // Gtk::Expander* exp = new Gtk::Expander (); + // exp->set_label_widget (*(new ILabel (Glib::ustring("") + label + ""))); + exp = Gtk::manage (new Gtk::Expander ()); + exp->set_border_width (4); + //Glib::RefPtr *style = new Gtk::Style(); + //exp->set_style() + exp->set_use_markup (true); + exp->signal_button_release_event().connect_notify( sigc::mem_fun(this, &FoldableToolPanel::foldThemAll) ); + + Gtk::Frame* pframe = Gtk::manage (new Gtk::Frame ()); + + pframe->set_name ("ToolPanel"); + + pframe->add (*content); + + exp->add (*pframe); + pframe->set_shadow_type (Gtk::SHADOW_ETCHED_IN); + pframe->show (); + exp->show (); +} + +void FoldableToolPanel::foldThemAll (GdkEventButton* event) { + if (event->button == 3) { + if (listener) + ((ToolPanelCoordinator*)listener)->foldAllButOne( parentContainer, this); + else + ((ToolPanelCoordinator*)tmp)->foldAllButOne( parentContainer, this); + } +} diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 83bb005aa..2a63a3b1f 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -19,12 +19,16 @@ #ifndef __TOOLPANEL__ #define __TOOLPANEL__ +#include #include #include #include #include #include +class ToolPanel; +class FoldableToolPanel; + class ToolPanelListener { public: @@ -43,6 +47,8 @@ class ToolPanel { ToolPanel () : listener(NULL), tmp(NULL), batchMode(false) {} + void setParent (Gtk::Box* parent) {} + Gtk::Box* getParent () { return NULL; } void setListener (ToolPanelListener* tpl) { listener = tpl; } virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {} virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {} @@ -53,6 +59,22 @@ class ToolPanel { virtual void setBatchMode (bool batchMode) { this->batchMode = batchMode; } -}; +}; + +class FoldableToolPanel : public ToolPanel { + + protected: + Gtk::Box* parentContainer; + void foldThemAll (GdkEventButton* event); + + public: + Gtk::Expander* exp; + + FoldableToolPanel(Gtk::Box* content); + + void setParent (Gtk::Box* parent) { parentContainer = parent; } + Gtk::Box* getParent () { return parentContainer; } + void setLabel (Glib::ustring label) { exp->set_label(label); } +}; #endif diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 6bde5ba3c..70189906c 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -183,32 +183,17 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { toolBar = new ToolBar (); } -void ToolPanelCoordinator::addPanel (Gtk::Box* where, Gtk::Container* panel, Glib::ustring label) { +void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel, Glib::ustring label) { Gtk::HSeparator *hsep = Gtk::manage (new Gtk::HSeparator()); where->pack_start(*hsep, Gtk::PACK_SHRINK, 0); hsep->show(); -// Gtk::Expander* exp = new Gtk::Expander (); -// exp->set_label_widget (*(new ILabel (Glib::ustring("") + label + ""))); - Gtk::Expander* exp = Gtk::manage (new Gtk::Expander (Glib::ustring("") + label + "")); - exp->set_border_width (4); - exp->set_use_markup (true); - expList.push_back (exp); - - Gtk::Frame* pframe = Gtk::manage (new Gtk::Frame ()); + panel->setParent(where); + panel->setLabel(label); - pframe->set_name ("ToolPanel"); - - pframe->add (*panel); - panel->show (); - - exp->add (*pframe); - pframe->set_shadow_type (Gtk::SHADOW_ETCHED_IN); - pframe->show (); - exp->show (); - - where->pack_start(*exp, false, false); + expList.push_back (panel->exp); + where->pack_start(*panel->exp, false, false); } ToolPanelCoordinator::~ToolPanelCoordinator () { @@ -475,6 +460,25 @@ void ToolPanelCoordinator::updateCurveBackgroundHistogram (unsigned* histrgb, un lcurve->updateCurveBackgroundHistogram (histl); } +void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection) { + + FoldableToolPanel* currentTP; + + for (int i=0; igetParent() == parent) { + // Section in the same tab, we unfold it if it's not the one that has been clicked + if (currentTP != openedSection) { + currentTP->exp->set_expanded(false); + } + else { + if (!currentTP->exp->get_expanded()) + currentTP->exp->set_expanded(true); + } + } + } +} + bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event) { bool ctrl = event->state & GDK_CONTROL_MASK; diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 82507fce7..be50afc0e 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -129,7 +129,8 @@ class ToolPanelCoordinator : public ToolPanelListener, bool hasChanged; - void addPanel (Gtk::Box* where, Gtk::Container* panel, Glib::ustring label); + void addPanel (Gtk::Box* where, FoldableToolPanel* panel, Glib::ustring label); + void foldThemAll (GdkEventButton* event); public: @@ -141,6 +142,7 @@ class ToolPanelCoordinator : public ToolPanelListener, bool getChangedState () { return hasChanged; } void updateCurveBackgroundHistogram (unsigned* histrgb, unsigned* histl); + void foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection); // multiple listeners can be added that are notified on changes (typical: profile panel and the history) void addPParamsChangeListener (PParamsChangeListener* pp) { paramcListeners.push_back (pp); } diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc index 3839326c9..85f44a397 100644 --- a/rtgui/vignetting.cc +++ b/rtgui/vignetting.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Vignetting::Vignetting () : vigAdd(false) { +Vignetting::Vignetting () : Gtk::VBox(), FoldableToolPanel(this), vigAdd(false) { amount = Gtk::manage (new Adjuster (M("TP_VIGNETTING_AMOUNT"), -100, 100, 1, 0)); amount->setAdjusterListener (this); diff --git a/rtgui/vignetting.h b/rtgui/vignetting.h index 64d51c75d..67220bdfc 100644 --- a/rtgui/vignetting.h +++ b/rtgui/vignetting.h @@ -23,7 +23,7 @@ #include #include -class Vignetting : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class Vignetting : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Adjuster* amount; diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index f2da55259..72c40dcee 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -29,7 +29,7 @@ extern Glib::ustring argv0; using namespace rtengine; using namespace rtengine::procparams; -WhiteBalance::WhiteBalance () : ToolPanel(), wbp(NULL), wblistener(NULL), tempAdd(false), greenAdd (false) { +WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), wblistener(NULL), tempAdd(false), greenAdd (false) { Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); hbox->show (); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index f14f91148..12658dd9d 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -30,7 +30,7 @@ class SpotWBListener { virtual void spotWBRequested (int size) {} }; -class WhiteBalance : public Gtk::VBox, public AdjusterListener, public ToolPanel { +class WhiteBalance : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: Gtk::ComboBoxText* method;