Backporting patch from issue #3446
This commit change the way that the Curve buttons and Accompanying object expands, and fix the alignment of the WB's buttons.
This commit is contained in:
parent
0b66f64a3b
commit
c90b701999
@ -40,7 +40,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
|
||||
colorCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_COLOR"));
|
||||
colorCurveEditorG->setCurveListener (this);
|
||||
|
||||
colorShape = static_cast<FlatCurveEditor*>(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
colorShape = static_cast<FlatCurveEditor*>(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
colorShape->setCurveColorProvider(this, 1);
|
||||
std::vector<GradientMilestone> milestones;
|
||||
|
||||
@ -89,7 +89,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
|
||||
opacityCurveEditorG->setCurveListener (this);
|
||||
|
||||
rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve);
|
||||
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
opacityShape->setIdentityValue(0.);
|
||||
opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
opacityShape->setBottomBarBgGradient(milestones);
|
||||
@ -108,7 +108,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
|
||||
clCurveEditorG->setCurveListener (this);
|
||||
|
||||
rtengine::ColorToningParams::getDefaultCLCurve(defaultCurve);
|
||||
clshape = static_cast<DiagonalCurveEditor*>(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg));
|
||||
clshape = static_cast<DiagonalCurveEditor*>(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false));
|
||||
clshape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
|
||||
|
||||
@ -128,7 +128,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
|
||||
cl2CurveEditorG->setCurveListener (this);
|
||||
|
||||
rtengine::ColorToningParams::getDefaultCL2Curve(defaultCurve);
|
||||
cl2shape = static_cast<DiagonalCurveEditor*>(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby));
|
||||
cl2shape = static_cast<DiagonalCurveEditor*>(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false));
|
||||
cl2shape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
|
||||
|
||||
|
@ -200,6 +200,7 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd
|
||||
leftBarCP = nullptr;
|
||||
curveCP = nullptr;
|
||||
relatedWidget = nullptr;
|
||||
expandRelatedWidget = true;
|
||||
|
||||
group = ceGroup;
|
||||
subGroup = ceSubGroup;
|
||||
|
@ -66,6 +66,7 @@ protected:
|
||||
CurveEditorGroup* group;
|
||||
CurveEditorSubGroup* subGroup;
|
||||
Gtk::Widget* relatedWidget;
|
||||
bool expandRelatedWidget;
|
||||
|
||||
std::vector<double> tempCurve;
|
||||
sigc::connection typeconn;
|
||||
|
@ -73,7 +73,7 @@ void CurveEditorGroup::hideCurrentCurve()
|
||||
* periodic: for FlatCurve only, ask the curve to be periodic (default: True)
|
||||
*
|
||||
*/
|
||||
CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool periodic)
|
||||
CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool expandRelatedWidget, bool periodic)
|
||||
{
|
||||
switch (cType) {
|
||||
case (CT_Diagonal): {
|
||||
@ -84,6 +84,7 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe
|
||||
// We add it to the curve editor list
|
||||
DiagonalCurveEditor* newCE = diagonalSubGroup->addCurve(curveLabel);
|
||||
newCE->relatedWidget = relatedWidget;
|
||||
newCE->expandRelatedWidget = expandRelatedWidget;
|
||||
curveEditors.push_back(newCE);
|
||||
return (newCE);
|
||||
}
|
||||
@ -96,6 +97,7 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe
|
||||
// We add it to the curve editor list
|
||||
FlatCurveEditor* newCE = flatSubGroup->addCurve(curveLabel, periodic);
|
||||
newCE->relatedWidget = relatedWidget;
|
||||
newCE->expandRelatedWidget = expandRelatedWidget;
|
||||
curveEditors.push_back(newCE);
|
||||
return (newCE);
|
||||
}
|
||||
@ -131,20 +133,21 @@ void CurveEditorGroup::newLine()
|
||||
}
|
||||
|
||||
int j = numberOfPackedCurve;
|
||||
bool hasRelatedWidget = false;
|
||||
|
||||
bool rwe = false;
|
||||
|
||||
for (int i = (int)(curveEditors.size()) - 1; i >= j; i--) {
|
||||
if (curveEditors[i]->relatedWidget != nullptr) {
|
||||
hasRelatedWidget = true;
|
||||
if (curveEditors[i]->relatedWidget != nullptr && curveEditors[i]->expandRelatedWidget) {
|
||||
rwe = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = (int)(curveEditors.size()) - 1; i >= j; i--) {
|
||||
if (curveEditors[i]->relatedWidget != nullptr) {
|
||||
headerBox->pack_end (*curveEditors[i]->relatedWidget, Gtk::PACK_EXPAND_WIDGET, 2);
|
||||
headerBox->pack_end (*curveEditors[i]->relatedWidget, curveEditors[i]->expandRelatedWidget ? Gtk::PACK_EXPAND_WIDGET : Gtk::PACK_SHRINK, 2);
|
||||
}
|
||||
|
||||
headerBox->pack_end (*curveEditors[i]->curveType->buttonGroup, hasRelatedWidget ? Gtk::PACK_SHRINK : Gtk::PACK_EXPAND_WIDGET, 2);
|
||||
headerBox->pack_end (*curveEditors[i]->curveType->buttonGroup, rwe ? Gtk::PACK_SHRINK : Gtk::PACK_EXPAND_WIDGET, 2);
|
||||
numberOfPackedCurve++;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
return displayedCurve;
|
||||
}
|
||||
//void on_realize ();
|
||||
CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool periodic = true);
|
||||
CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool expandRelatedWidget = true, bool periodic = true);
|
||||
|
||||
protected:
|
||||
//void curveTypeToggled ();
|
||||
|
@ -64,7 +64,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP
|
||||
//curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir);
|
||||
NoiscurveEditorG->setCurveListener (this);
|
||||
rtengine::DirPyrDenoiseParams::getDefaultNoisCurve(defaultCurve);
|
||||
lshape = static_cast<FlatCurveEditor*>(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
lshape = static_cast<FlatCurveEditor*>(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
lshape->setIdentityValue(0.);
|
||||
lshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
|
||||
@ -154,7 +154,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP
|
||||
CCcurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_CCCURVE"));
|
||||
CCcurveEditorG->setCurveListener (this);
|
||||
rtengine::DirPyrDenoiseParams::getDefaultCCCurve(defaultCurve);
|
||||
ccshape = static_cast<FlatCurveEditor*>(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
ccshape = static_cast<FlatCurveEditor*>(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
ccshape->setIdentityValue(0.);
|
||||
ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
|
||||
|
@ -105,7 +105,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
|
||||
|
||||
std::vector<double> defaultCurve;
|
||||
rtengine::RetinexParams::getDefaulttransmissionCurve(defaultCurve);
|
||||
transmissionShape = static_cast<FlatCurveEditor*>(transmissionCurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
transmissionShape = static_cast<FlatCurveEditor*>(transmissionCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
transmissionShape->setIdentityValue(0.);
|
||||
transmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
transmissionShape->setBottomBarBgGradient(milestones);
|
||||
@ -184,7 +184,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
|
||||
|
||||
// std::vector<double> defaultCurve;
|
||||
rtengine::RetinexParams::getDefaultgaintransmissionCurve(defaultCurve);
|
||||
gaintransmissionShape = static_cast<FlatCurveEditor*>(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false));
|
||||
gaintransmissionShape = static_cast<FlatCurveEditor*>(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
gaintransmissionShape->setIdentityValue(0.);
|
||||
gaintransmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
gaintransmissionShape->setBottomBarBgGradient(milestones);
|
||||
|
@ -421,7 +421,7 @@ Wavelet::Wavelet() :
|
||||
std::vector<double> defaultCurve;
|
||||
|
||||
rtengine::WaveletParams::getDefaultOpacityCurveRG(defaultCurve);
|
||||
opacityShapeRG = static_cast<FlatCurveEditor*>(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
opacityShapeRG = static_cast<FlatCurveEditor*>(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
opacityShapeRG->setIdentityValue(0.);
|
||||
opacityShapeRG->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
|
||||
@ -433,7 +433,7 @@ Wavelet::Wavelet() :
|
||||
opacityCurveEditorG->setCurveListener (this);
|
||||
|
||||
rtengine::WaveletParams::getDefaultOpacityCurveBY(defaultCurve);
|
||||
opacityShapeBY = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
opacityShapeBY = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
opacityShapeBY->setIdentityValue(0.);
|
||||
opacityShapeBY->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
|
||||
@ -517,7 +517,7 @@ Wavelet::Wavelet() :
|
||||
CCWcurveEditorG->setCurveListener (this);
|
||||
|
||||
rtengine::WaveletParams::getDefaultCCWCurve(defaultCurve);
|
||||
ccshape = static_cast<FlatCurveEditor*>(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false));
|
||||
ccshape = static_cast<FlatCurveEditor*>(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
|
||||
ccshape->setIdentityValue(0.);
|
||||
ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
@ -809,7 +809,7 @@ Wavelet::Wavelet() :
|
||||
opacityCurveEditorW->setCurveListener (this);
|
||||
|
||||
rtengine::WaveletParams::getDefaultOpacityCurveW(defaultCurve);
|
||||
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false));
|
||||
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
opacityShape->setIdentityValue(0.);
|
||||
opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
opacityShape->setBottomBarBgGradient(milestones2);
|
||||
@ -826,7 +826,7 @@ Wavelet::Wavelet() :
|
||||
opacityCurveEditorWL->setCurveListener (this);
|
||||
|
||||
rtengine::WaveletParams::getDefaultOpacityCurveWL(defaultCurve);
|
||||
opacityShapeWL = static_cast<FlatCurveEditor*>(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false));
|
||||
opacityShapeWL = static_cast<FlatCurveEditor*>(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false));
|
||||
opacityShapeWL->setIdentityValue(0.);
|
||||
opacityShapeWL->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
|
||||
opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP"));
|
||||
|
@ -151,6 +151,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
|
||||
{
|
||||
|
||||
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ());
|
||||
hbox->set_spacing(4);
|
||||
hbox->show ();
|
||||
Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD")));
|
||||
lab->show ();
|
||||
@ -238,14 +239,19 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
|
||||
method->pack_start(methodColumns.colIcon, false);
|
||||
method->pack_start(methodColumns.colLabel, true);
|
||||
|
||||
std::vector<Gtk::CellRenderer*> cells = method->get_cells();
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*>(cells.at(1));
|
||||
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
|
||||
|
||||
method->set_active (0); // Camera
|
||||
method->show ();
|
||||
hbox->pack_start (*lab, Gtk::PACK_SHRINK, 4);
|
||||
hbox->pack_start (*lab, Gtk::PACK_SHRINK, 0);
|
||||
hbox->pack_start (*method);
|
||||
pack_start (*hbox, Gtk::PACK_SHRINK, 4);
|
||||
pack_start (*hbox, Gtk::PACK_SHRINK, 0);
|
||||
opt = 0;
|
||||
|
||||
Gtk::HBox* spotbox = Gtk::manage (new Gtk::HBox ());
|
||||
spotbox->set_spacing(4);
|
||||
spotbox->show ();
|
||||
|
||||
spotbutton = Gtk::manage (new Gtk::Button (M("TP_WBALANCE_SPOTWB")));
|
||||
@ -291,10 +297,10 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
|
||||
spotsize->set_active(4);
|
||||
}
|
||||
|
||||
spotbox->pack_end (*spotsize, Gtk::PACK_EXPAND_WIDGET, 4);
|
||||
spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 4);
|
||||
spotbox->pack_end (*spotsize, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
pack_start (*spotbox, Gtk::PACK_SHRINK, 4);
|
||||
pack_start (*spotbox, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
Gtk::Image* itempL = Gtk::manage (new RTImage ("ajd-wb-temp1.png"));
|
||||
Gtk::Image* itempR = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user