diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 719d3921f..00a066ca3 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 9b2efca0e..1b3ffc7c2 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 31fb7cacb..a3cac6a36 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 047c24989..f507c40d2 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -25,7 +25,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 197e861eb..891d948c9 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 2f3579179..9ab9ffe1f 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 68733278b..65db3b3ac 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -22,7 +22,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 c411cb07e..995e4879b 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -24,7 +24,7 @@ #include -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 9d9193263..25f762002 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -23,7 +23,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Resize::Resize () : maxw(100000), maxh(100000) { +Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100000) { enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); pack_start(*enabled); diff --git a/rtgui/resize.h b/rtgui/resize.h index 18ebb467e..e80cef164 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 d09e284ac..1f1295433 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -143,32 +143,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 () { @@ -382,3 +367,22 @@ void ToolPanelCoordinator::updateCurveBackgroundHistogram (unsigned* histrgb, un curve->updateCurveBackgroundHistogram (histrgb); 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); + } + } + } +} diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 5fd2d1b53..5d757c591 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -121,7 +121,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: @@ -133,6 +134,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;