When the right mouse button is clisked over a section title, it unfold that section and fold all the other one of the same level (RMB on Vignetting won't fold Resize)

This commit is contained in:
Hombre
2011-02-06 14:21:46 +01:00
parent 3711a6df5e
commit 4c6f9176c7
63 changed files with 738 additions and 656 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class CACorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class CACorrection : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* red;

View File

@@ -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("<span foreground=\"red\"><b>") + M("TP_CHMIXER_RED") + Glib::ustring(":</b></span>"));

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ChMixer : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ChMixer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster *red[3];

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ColorBoost : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* colorboost;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ColorDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ColorDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* amount;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ColorShift : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ColorShift : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* ashift;

View File

@@ -34,7 +34,7 @@ class RefreshSpinHelper {
: crop(_crop), notify(_notify) {}
};
Crop::Crop () {
Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) {
clistener = NULL;

View File

@@ -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;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class Defringe : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class Defringe : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* radius;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* luma;

View File

@@ -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);

View File

@@ -24,7 +24,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class DirPyrEqualizer : public Gtk::VBox, public AdjusterListener, public ToolPanel
class DirPyrEqualizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel
{
protected:

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class Distortion : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class Distortion : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* distor;

View File

@@ -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);

View File

@@ -24,7 +24,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class Equalizer : public Gtk::VBox, public AdjusterListener, public ToolPanel
class Equalizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel
{
protected:

View File

@@ -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);

View File

@@ -22,7 +22,7 @@
#include <gtkmm.h>
#include <toolpanel.h>
class HLRecovery : public Gtk::VBox, public ToolPanel {
class HLRecovery : public Gtk::VBox, public FoldableToolPanel {
protected:
Gtk::CheckButton* enabled;

View File

@@ -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);

View File

@@ -26,7 +26,7 @@
#include <guiutils.h>
class HSVEqualizer : public Gtk::VBox, public AdjusterListener, public ToolPanel
class HSVEqualizer : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel
{
protected:

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* thresh;

View File

@@ -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));

View File

@@ -25,7 +25,7 @@
#include <curveeditor.h>
#include <mycurve.h>
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;

View File

@@ -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);

View File

@@ -25,7 +25,7 @@
#include <curveeditor.h>
#include <mycurve.h>
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;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <toolpanel.h>
#include <lensgeomlistener.h>
class LensGeometry : public Gtk::VBox, public ToolPanel {
class LensGeometry : public Gtk::VBox, public FoldableToolPanel {
protected:
Gtk::Button* autoCrop;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class LumaDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class LumaDenoise : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* radius;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class PerspCorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class PerspCorrection : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* horiz;

View File

@@ -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));

View File

@@ -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:

View File

@@ -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") +": ")));

View File

@@ -24,7 +24,7 @@
#include <toolpanel.h>
class RawProcess : public Gtk::VBox, public AdjusterListener, public ToolPanel{
class RawProcess : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel{
protected:

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
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;

View File

@@ -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;

View File

@@ -24,7 +24,7 @@
#include <toolpanel.h>
#include <lensgeomlistener.h>
class Rotate : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class Rotate : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* degree;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* highlights;

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class Sharpening : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class Sharpening : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Gtk::ComboBoxText* method;

View File

@@ -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 ());

View File

@@ -26,7 +26,7 @@
#include <curveeditorgroup.h>
#include <mycurve.h>
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;

54
rtgui/toolpanel.cc Normal file
View File

@@ -0,0 +1,54 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <toolpanel.h>
#include <toolpanelcoord.h>
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("<b>") + label + "</b>")));
exp = Gtk::manage (new Gtk::Expander ());
exp->set_border_width (4);
//Glib::RefPtr<Gtk::Style> *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);
}
}

View File

@@ -19,12 +19,16 @@
#ifndef __TOOLPANEL__
#define __TOOLPANEL__
#include <gtkmm.h>
#include <glibmm.h>
#include <rtengine.h>
#include <procparams.h>
#include <multilangmgr.h>
#include <paramsedited.h>
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

View File

@@ -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("<b>") + label + "</b>")));
Gtk::Expander* exp = Gtk::manage (new Gtk::Expander (Glib::ustring("<b>") + label + "</b>"));
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; i<toolPanels.size(); i++) {
currentTP = (FoldableToolPanel*)toolPanels[i];
if (currentTP->getParent() == 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;

View File

@@ -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); }

View File

@@ -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);

View File

@@ -23,7 +23,7 @@
#include <adjuster.h>
#include <toolpanel.h>
class Vignetting : public Gtk::VBox, public AdjusterListener, public ToolPanel {
class Vignetting : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
protected:
Adjuster* amount;

View File

@@ -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 ();

View File

@@ -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;