diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index 9b450d58b..c44e9b958 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -231,7 +231,7 @@ void CurveEditor::setBottomBarBgGradient (const std::vector & } void CurveEditor::refresh () { - subGroup->switchGUI(); + subGroup->refresh(this); } void CurveEditor::setCurveColorProvider(ColorProvider* cp, int callerId) { diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 517df0f36..b34b092ae 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -114,6 +114,7 @@ public: int getValLinear() { return valLinear; } virtual void updateBackgroundHistogram (CurveEditor* ce) {} virtual void switchGUI() = 0; + virtual void refresh(CurveEditor *curveToRefresh) = 0; protected: diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index dbb577cda..236c99174 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -238,6 +238,29 @@ DiagonalCurveEditor* DiagonalCurveEditorSubGroup::addCurve(Glib::ustring curveLa return newCE; } +/* + * Force the resize of the curve editor, if the displayed one is the requested one + */ +void DiagonalCurveEditorSubGroup::refresh(CurveEditor *curveToRefresh) { + if (curveToRefresh != NULL && curveToRefresh == static_cast(parent->displayedCurve)) { + switch((DiagonalCurveType)(curveToRefresh->curveType->getSelected())) { + case (DCT_Spline): + customCurve->refresh(); + break; + case (DCT_Parametric): + paramCurve->refresh(); + shcSelector->refresh(); + break; + case (DCT_NURBS): + NURBSCurve->refresh(); + break; + default: // (DCT_Linear, DCT_Unchanged) + // ... do nothing + break; + } + } +} + /* * Switch the editor widgets to the currently edited curve */ diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 996943ef1..d4fac0949 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -65,6 +65,7 @@ public: DiagonalCurveEditor* addCurve(Glib::ustring curveLabel = ""); virtual void updateBackgroundHistogram (CurveEditor* ce); void switchGUI(); + void refresh(CurveEditor *curveToRefresh); protected: void storeCurveValues (CurveEditor* ce, const std::vector& p); diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index 5efe14c8c..869cb555c 100644 --- a/rtgui/flatcurveeditorsubgroup.cc +++ b/rtgui/flatcurveeditorsubgroup.cc @@ -83,6 +83,22 @@ FlatCurveEditor* FlatCurveEditorSubGroup::addCurve(Glib::ustring curveLabel, boo return newCE; } +/* + * Force the resize of the curve editor, if the displayed one is the requested one + */ +void FlatCurveEditorSubGroup::refresh(CurveEditor *curveToRefresh) { + if (curveToRefresh != NULL && curveToRefresh == static_cast(parent->displayedCurve)) { + switch(FlatCurveType(curveToRefresh->curveType->getSelected())) { + case (FCT_MinMaxCPoints): + CPointsCurve->refresh(); + break; + default: // (DCT_Linear, DCT_Unchanged) + // ... do nothing + break; + } + } +} + /* * Switch the editor widgets to the currently edited curve */ @@ -311,6 +327,7 @@ bool FlatCurveEditorSubGroup::curveReset(int cType) { return false; break; } + return true; } /*void FlatCurveEditorSubGroup::updateBackgroundHistogram (CurveEditor* ce) { diff --git a/rtgui/flatcurveeditorsubgroup.h b/rtgui/flatcurveeditorsubgroup.h index 0122b16a6..630f4cd49 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -43,6 +43,7 @@ public: FlatCurveEditor* addCurve(Glib::ustring curveLabel = "", bool periodic = true); //virtual void updateBackgroundHistogram (CurveEditor* ce); void switchGUI(); + void refresh(CurveEditor *curveToRefresh); protected: void storeCurveValues (CurveEditor* ce, const std::vector& p); diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index c2fedfb02..2ee601f2b 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -100,3 +100,15 @@ void MyCurve::styleChanged (const Glib::RefPtr& style) { queue_draw (); } +void MyCurve::refresh() { + if (leftBar != NULL) + leftBar->setDirty(true); + if (bottomBar != NULL) + bottomBar->setDirty(true); + + setDirty(true); + + Glib::RefPtr win = get_window(); + if (win) + win->invalidate(true); +} diff --git a/rtgui/mycurve.h b/rtgui/mycurve.h index 40368af05..8e76739c5 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -106,6 +106,7 @@ class MyCurve : public Gtk::DrawingArea, public BackBuffer, public ColorCaller { void notifyListener (); void updateBackgroundHistogram (LUTu & hist) {return;} ; void forceResize() { sized = RS_Force; } + void refresh(); void styleChanged (const Glib::RefPtr& style); virtual std::vector getPoints () = 0; virtual void setPoints (const std::vector& p) = 0; diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index 70ae7bbfa..891c14a44 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -237,3 +237,10 @@ bool SHCSelector::reset () { // : movingPosition(-1), cl(NULL) { } return false; } + +void SHCSelector::refresh() { + setDirty(true); + Glib::RefPtr win = get_window(); + if (win) + win->invalidate(true); +} diff --git a/rtgui/shcselector.h b/rtgui/shcselector.h index 4c4b3057d..7096d6d23 100644 --- a/rtgui/shcselector.h +++ b/rtgui/shcselector.h @@ -66,6 +66,7 @@ class SHCSelector : public Gtk::DrawingArea, public ColoredBar { bool on_motion_notify_event (GdkEventMotion* event); void styleChanged (const Glib::RefPtr& style); bool reset (); + void refresh(); }; #endif