diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index e2122f79e..a4d28c104 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -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(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + colorShape = static_cast(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); colorShape->setCurveColorProvider(this, 1); std::vector milestones; @@ -89,7 +89,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR opacityCurveEditorG->setCurveListener (this); rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve); - opacityShape = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShape = static_cast(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(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg)); + clshape = static_cast(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(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby)); + cl2shape = static_cast(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")); diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index 5428677c3..117051b2a 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -200,6 +200,7 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd leftBarCP = nullptr; curveCP = nullptr; relatedWidget = nullptr; + expandRelatedWidget = true; group = ceGroup; subGroup = ceSubGroup; diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index a3ba68436..3f279ff05 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -66,6 +66,7 @@ protected: CurveEditorGroup* group; CurveEditorSubGroup* subGroup; Gtk::Widget* relatedWidget; + bool expandRelatedWidget; std::vector tempCurve; sigc::connection typeconn; diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index ecb4c8542..aad30ac37 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -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++; } diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index caf08b4a4..097bfd3e3 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -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 (); diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index f4ad271b3..3cee199f8 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -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(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + lshape = static_cast(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(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + ccshape = static_cast(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index dd5048320..61d9073ae 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -105,7 +105,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), std::vector defaultCurve; rtengine::RetinexParams::getDefaulttransmissionCurve(defaultCurve); - transmissionShape = static_cast(transmissionCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + transmissionShape = static_cast(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 defaultCurve; rtengine::RetinexParams::getDefaultgaintransmissionCurve(defaultCurve); - gaintransmissionShape = static_cast(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false)); + gaintransmissionShape = static_cast(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false, false)); gaintransmissionShape->setIdentityValue(0.); gaintransmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); gaintransmissionShape->setBottomBarBgGradient(milestones); diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 3e30ffe00..2d7f6dd2e 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -421,7 +421,7 @@ Wavelet::Wavelet() : std::vector defaultCurve; rtengine::WaveletParams::getDefaultOpacityCurveRG(defaultCurve); - opacityShapeRG = static_cast(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeRG = static_cast(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(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeBY = static_cast(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(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + ccshape = static_cast(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(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false)); + opacityShape = static_cast(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(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeWL = static_cast(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeWL->setIdentityValue(0.); opacityShapeWL->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP")); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 75873b680..e000e6738 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -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 cells = method->get_cells(); + Gtk::CellRendererText* cellRenderer = dynamic_cast(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"));