From e0d100466ea22e64973bcc552e6bb978f494ad41 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sat, 12 Mar 2016 03:22:30 +0100 Subject: [PATCH] Fix #3207: "Paste button is missing in curves" --- rtgui/curveeditorgroup.h | 1 - rtgui/diagonalcurveeditorsubgroup.cc | 69 ++++++++++------------------ rtgui/flatcurveeditorsubgroup.cc | 25 ++++------ 3 files changed, 34 insertions(+), 61 deletions(-) diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 1f1120f83..abbe608d9 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -115,7 +115,6 @@ protected: int valLinear; int valUnchanged; CurveEditorGroup *parent; - int curveBBoxPos; // 0=above, 1=right, 2=below, 3=left ColoredBar* leftBar; ColoredBar* bottomBar; diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index c5b42668f..4cd47ec10 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -38,7 +38,7 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, editedAdjuster = NULL; editedAdjusterValue = 0; - curveBBoxPos = options.curvebboxpos; + Gtk::PositionType side = options.curvebboxpos == 0 || options.curvebboxpos == 2 ? Gtk::POS_LEFT : Gtk::POS_TOP; valLinear = (int)DCT_Linear; valUnchanged = (int)DCT_Unchanged; @@ -60,8 +60,10 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { setExpandAlignProperties(custombbox, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + custombbox->set_row_homogeneous(true); } else { setExpandAlignProperties(custombbox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + custombbox->set_column_homogeneous(true); } editPointCustom = Gtk::manage (new Gtk::ToggleButton ()); @@ -80,6 +82,7 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, copyCustom->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(copyCustom, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); pasteCustom = Gtk::manage (new Gtk::Button ()); + pasteCustom->add (*Gtk::manage (new RTImage ("edit-paste.png"))); pasteCustom->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(pasteCustom, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); loadCustom = Gtk::manage (new Gtk::Button ()); @@ -91,21 +94,12 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, saveCustom->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(saveCustom, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { - custombbox->attach(*editCustom, 0, 0, 1, 1); - custombbox->attach(*editPointCustom, 1, 0, 1, 1); - custombbox->attach(*copyCustom, 2, 0, 1, 1); - custombbox->attach(*pasteCustom, 3, 0, 1, 1); - custombbox->attach(*loadCustom, 4, 0, 1, 1); - custombbox->attach(*saveCustom, 5, 0, 1, 1); - } else { - custombbox->attach(*editCustom, 0, 0, 1, 1); - custombbox->attach(*editPointCustom, 0, 1, 1, 1); - custombbox->attach(*copyCustom, 0, 2, 1, 1); - custombbox->attach(*pasteCustom, 0, 3, 1, 1); - custombbox->attach(*loadCustom, 0, 4, 1, 1); - custombbox->attach(*saveCustom, 0, 5, 1, 1); - } + custombbox->attach_next_to(*saveCustom, side, 1, 1); + custombbox->attach_next_to(*loadCustom, side, 1, 1); + custombbox->attach_next_to(*pasteCustom, side, 1, 1); + custombbox->attach_next_to(*copyCustom, side, 1, 1); + custombbox->attach_next_to(*editPointCustom, side, 1, 1); + custombbox->attach_next_to(*editCustom, side, 1, 1); customCoordAdjuster = Gtk::manage (new CoordinateAdjuster(customCurve, this)); @@ -158,8 +152,10 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { setExpandAlignProperties(NURBSbbox, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + NURBSbbox->set_row_homogeneous(true); } else { setExpandAlignProperties(NURBSbbox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + NURBSbbox->set_column_homogeneous(true); } editPointNURBS = Gtk::manage (new Gtk::ToggleButton ()); @@ -190,21 +186,12 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, saveNURBS->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(saveNURBS, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { - NURBSbbox->attach(*editNURBS, 0, 0, 1, 1); - NURBSbbox->attach(*editPointNURBS, 1, 0, 1, 1); - NURBSbbox->attach(*copyNURBS, 2, 0, 1, 1); - NURBSbbox->attach(*pasteNURBS, 3, 0, 1, 1); - NURBSbbox->attach(*loadNURBS, 4, 0, 1, 1); - NURBSbbox->attach(*saveNURBS, 5, 0, 1, 1); - } else { - NURBSbbox->attach(*editNURBS, 0, 0, 1, 1); - NURBSbbox->attach(*editPointNURBS, 0, 1, 1, 1); - NURBSbbox->attach(*copyNURBS, 0, 2, 1, 1); - NURBSbbox->attach(*pasteNURBS, 0, 3, 1, 1); - NURBSbbox->attach(*loadNURBS, 0, 4, 1, 1); - NURBSbbox->attach(*saveNURBS, 0, 5, 1, 1); - } + NURBSbbox->attach_next_to(*saveNURBS, side, 1, 1); + NURBSbbox->attach_next_to(*loadNURBS, side, 1, 1); + NURBSbbox->attach_next_to(*pasteNURBS, side, 1, 1); + NURBSbbox->attach_next_to(*copyNURBS, side, 1, 1); + NURBSbbox->attach_next_to(*editPointNURBS, side, 1, 1); + NURBSbbox->attach_next_to(*editNURBS, side, 1, 1); NURBSCoordAdjuster = Gtk::manage (new CoordinateAdjuster(NURBSCurve, this)); @@ -257,8 +244,10 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { setExpandAlignProperties(parambbox, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + parambbox->set_row_homogeneous(true); } else { setExpandAlignProperties(parambbox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + parambbox->set_column_homogeneous(true); } shcSelector = Gtk::manage (new SHCSelector ()); @@ -287,19 +276,11 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, saveParam->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(saveParam, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { - parambbox->attach(*editParam, 0, 0, 1, 1); - parambbox->attach(*copyParam, 1, 0, 1, 1); - parambbox->attach(*pasteParam, 2, 0, 1, 1); - parambbox->attach(*loadParam, 3, 0, 1, 1); - parambbox->attach(*saveParam, 4, 0, 1, 1); - } else { - parambbox->attach(*editParam, 0, 0, 1, 1); - parambbox->attach(*copyParam, 0, 1, 1, 1); - parambbox->attach(*pasteParam, 0, 2, 1, 1); - parambbox->attach(*loadParam, 0, 3, 1, 1); - parambbox->attach(*saveParam, 0, 4, 1, 1); - } + parambbox->attach_next_to(*saveParam, side, 1, 1); + parambbox->attach_next_to(*loadParam, side, 1, 1); + parambbox->attach_next_to(*pasteParam, side, 1, 1); + parambbox->attach_next_to(*copyParam, side, 1, 1); + parambbox->attach_next_to(*editParam, side, 1, 1); saveParam->signal_clicked().connect( sigc::mem_fun(*this, &DiagonalCurveEditorSubGroup::savePressed) ); loadParam->signal_clicked().connect( sigc::mem_fun(*this, &DiagonalCurveEditorSubGroup::loadPressed) ); diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index fa5183fc0..48ebbcec1 100644 --- a/rtgui/flatcurveeditorsubgroup.cc +++ b/rtgui/flatcurveeditorsubgroup.cc @@ -40,7 +40,7 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u valUnchanged = (int)FCT_Unchanged; parent = prt; - curveBBoxPos = options.curvebboxpos; + Gtk::PositionType side = options.curvebboxpos == 0 || options.curvebboxpos == 2 ? Gtk::POS_LEFT : Gtk::POS_TOP; // ControlPoints curve CPointsCurveGrid = new Gtk::Grid (); @@ -56,8 +56,10 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { setExpandAlignProperties(CPointsbbox, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + CPointsbbox->set_row_homogeneous(true); } else { setExpandAlignProperties(CPointsbbox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); + CPointsbbox->set_column_homogeneous(true); } editCPoints = Gtk::manage (new Gtk::ToggleButton()); @@ -88,21 +90,12 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u saveCPoints->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); setExpandAlignProperties(saveCPoints, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { - CPointsbbox->attach(*editCPoints, 0, 0, 1, 1); - CPointsbbox->attach(*editPointCPoints, 1, 0, 1, 1); - CPointsbbox->attach(*copyCPoints, 2, 0, 1, 1); - CPointsbbox->attach(*pasteCPoints, 3, 0, 1, 1); - CPointsbbox->attach(*loadCPoints, 4, 0, 1, 1); - CPointsbbox->attach(*saveCPoints, 5, 0, 1, 1); - } else { - CPointsbbox->attach(*editCPoints, 0, 0, 1, 1); - CPointsbbox->attach(*editPointCPoints, 0, 1, 1, 1); - CPointsbbox->attach(*copyCPoints, 0, 2, 1, 1); - CPointsbbox->attach(*pasteCPoints, 0, 3, 1, 1); - CPointsbbox->attach(*loadCPoints, 0, 4, 1, 1); - CPointsbbox->attach(*saveCPoints, 0, 5, 1, 1); - } + CPointsbbox->attach_next_to(*saveCPoints, side, 1, 1); + CPointsbbox->attach_next_to(*loadCPoints, side, 1, 1); + CPointsbbox->attach_next_to(*pasteCPoints, side, 1, 1); + CPointsbbox->attach_next_to(*copyCPoints, side, 1, 1); + CPointsbbox->attach_next_to(*editPointCPoints, side, 1, 1); + CPointsbbox->attach_next_to(*editCPoints, side, 1, 1); { std::vector axis;