Add classes to curves for css styling (#4986)
This commit is contained in:
@@ -127,7 +127,6 @@ void CoordinateAdjuster::createWidgets(const std::vector<Axis> &axis)
|
|||||||
|
|
||||||
Gtk::Grid *box = Gtk::manage (new Gtk::Grid());
|
Gtk::Grid *box = Gtk::manage (new Gtk::Grid());
|
||||||
box->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
box->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
box->set_column_spacing(3);
|
|
||||||
|
|
||||||
setExpandAlignProperties(currAdjuster->label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(currAdjuster->label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
|
||||||
setExpandAlignProperties(currAdjuster->spinButton, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(currAdjuster->spinButton, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
|
@@ -52,20 +52,34 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
// custom curve
|
// custom curve
|
||||||
customCurveGrid = new Gtk::Grid ();
|
customCurveGrid = new Gtk::Grid ();
|
||||||
customCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
customCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
customCurveGrid->set_row_spacing(2);
|
customCurveGrid->get_style_context()->add_class("curve-mainbox");
|
||||||
customCurveGrid->set_column_spacing(2);
|
|
||||||
|
|
||||||
customCurve = Gtk::manage (new MyDiagonalCurve ());
|
customCurve = Gtk::manage (new MyDiagonalCurve ());
|
||||||
customCurve->setType (DCT_Spline);
|
customCurve->setType (DCT_Spline);
|
||||||
|
|
||||||
|
Gtk::Grid* customCurveBox= Gtk::manage (new Gtk::Grid ());
|
||||||
|
customCurveBox->get_style_context()->add_class("curve-curvebox");
|
||||||
|
customCurveBox->add(*customCurve);
|
||||||
|
|
||||||
Gtk::Grid* custombbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left
|
Gtk::Grid* custombbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left
|
||||||
|
custombbox->get_style_context()->add_class("curve-buttonbox");
|
||||||
|
|
||||||
if (options.curvebboxpos == 0 || options.curvebboxpos == 2) {
|
if (options.curvebboxpos == 0) {
|
||||||
custombbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
custombbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
setExpandAlignProperties(custombbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(custombbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
} else {
|
customCurveGrid->get_style_context()->add_class("top");
|
||||||
|
} else if (options.curvebboxpos == 2) {
|
||||||
|
custombbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
|
setExpandAlignProperties(custombbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
|
customCurveGrid->get_style_context()->add_class("bottom");
|
||||||
|
} else if (options.curvebboxpos == 1) {
|
||||||
custombbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
custombbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
setExpandAlignProperties(custombbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(custombbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
customCurveGrid->get_style_context()->add_class("right");
|
||||||
|
} else if (options.curvebboxpos == 3){
|
||||||
|
custombbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
setExpandAlignProperties(custombbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
customCurveGrid->get_style_context()->add_class("left");
|
||||||
}
|
}
|
||||||
|
|
||||||
editPointCustom = Gtk::manage (new Gtk::ToggleButton ());
|
editPointCustom = Gtk::manage (new Gtk::ToggleButton ());
|
||||||
@@ -90,22 +104,23 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
custombbox->attach_next_to(*saveCustom, sideEnd, 1, 1);
|
custombbox->attach_next_to(*saveCustom, sideEnd, 1, 1);
|
||||||
|
|
||||||
customCoordAdjuster = Gtk::manage (new CoordinateAdjuster(customCurve, this));
|
customCoordAdjuster = Gtk::manage (new CoordinateAdjuster(customCurve, this));
|
||||||
|
customCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox");
|
||||||
|
|
||||||
// Button box position: 0=above, 1=right, 2=below, 3=left
|
// Button box position: 0=above, 1=right, 2=below, 3=left
|
||||||
customCurveGrid->add(*customCurve);
|
customCurveGrid->add(*customCurveBox);
|
||||||
customCurve->set_hexpand(true);
|
customCurve->set_hexpand(true);
|
||||||
|
|
||||||
if (options.curvebboxpos == 0) {
|
if (options.curvebboxpos == 0) {
|
||||||
customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_TOP, 1, 1);
|
customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_TOP, 1, 1);
|
||||||
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 1, 1);
|
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 1) {
|
} else if (options.curvebboxpos == 1) {
|
||||||
customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_RIGHT, 1, 1);
|
customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_RIGHT, 1, 1);
|
||||||
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 2, 1);
|
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
} else if (options.curvebboxpos == 2) {
|
} else if (options.curvebboxpos == 2) {
|
||||||
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 1, 1);
|
customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
customCurveGrid->attach_next_to(*custombbox, *customCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
customCurveGrid->attach_next_to(*custombbox, *customCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 3) {
|
} else if (options.curvebboxpos == 3) {
|
||||||
customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_LEFT, 1, 1);
|
customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_LEFT, 1, 1);
|
||||||
customCurveGrid->attach_next_to(*customCoordAdjuster, *custombbox, Gtk::POS_BOTTOM, 2, 1);
|
customCurveGrid->attach_next_to(*customCoordAdjuster, *custombbox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,21 +143,35 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
|
|
||||||
// NURBS curve
|
// NURBS curve
|
||||||
NURBSCurveGrid = new Gtk::Grid ();
|
NURBSCurveGrid = new Gtk::Grid ();
|
||||||
NURBSCurveGrid->set_row_spacing(4);
|
|
||||||
NURBSCurveGrid->set_column_spacing(4);
|
|
||||||
NURBSCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
NURBSCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
NURBSCurveGrid->get_style_context()->add_class("curve-mainbox");
|
||||||
|
|
||||||
NURBSCurve = Gtk::manage (new MyDiagonalCurve ());
|
NURBSCurve = Gtk::manage (new MyDiagonalCurve ());
|
||||||
NURBSCurve->setType (DCT_NURBS);
|
NURBSCurve->setType (DCT_NURBS);
|
||||||
|
|
||||||
|
Gtk::Grid* NURBSCurveBox= Gtk::manage (new Gtk::Grid ());
|
||||||
|
NURBSCurveBox->get_style_context()->add_class("curve-curvebox");
|
||||||
|
NURBSCurveBox->add(*NURBSCurve);
|
||||||
|
|
||||||
Gtk::Grid* NURBSbbox = Gtk::manage (new Gtk::Grid ());
|
Gtk::Grid* NURBSbbox = Gtk::manage (new Gtk::Grid ());
|
||||||
|
NURBSbbox->get_style_context()->add_class("curve-buttonbox");
|
||||||
|
|
||||||
if (options.curvebboxpos == 0 || options.curvebboxpos == 2) {
|
if (options.curvebboxpos == 0) {
|
||||||
NURBSbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
NURBSbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
setExpandAlignProperties(NURBSbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(NURBSbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
} else {
|
NURBSCurveGrid->get_style_context()->add_class("top");
|
||||||
|
} else if (options.curvebboxpos == 2) {
|
||||||
|
NURBSbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
|
setExpandAlignProperties(NURBSbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
|
NURBSCurveGrid->get_style_context()->add_class("bottom");
|
||||||
|
} else if (options.curvebboxpos == 1) {
|
||||||
NURBSbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
NURBSbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
setExpandAlignProperties(NURBSbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(NURBSbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
NURBSCurveGrid->get_style_context()->add_class("right");
|
||||||
|
} else if (options.curvebboxpos == 3){
|
||||||
|
NURBSbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
setExpandAlignProperties(NURBSbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
NURBSCurveGrid->get_style_context()->add_class("left");
|
||||||
}
|
}
|
||||||
|
|
||||||
editPointNURBS = Gtk::manage (new Gtk::ToggleButton ());
|
editPointNURBS = Gtk::manage (new Gtk::ToggleButton ());
|
||||||
@@ -167,22 +196,23 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
NURBSbbox->attach_next_to(*saveNURBS, sideEnd, 1, 1);
|
NURBSbbox->attach_next_to(*saveNURBS, sideEnd, 1, 1);
|
||||||
|
|
||||||
NURBSCoordAdjuster = Gtk::manage (new CoordinateAdjuster(NURBSCurve, this));
|
NURBSCoordAdjuster = Gtk::manage (new CoordinateAdjuster(NURBSCurve, this));
|
||||||
|
NURBSCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox");
|
||||||
|
|
||||||
// Button box position: 0=above, 1=right, 2=below, 3=left
|
// Button box position: 0=above, 1=right, 2=below, 3=left
|
||||||
NURBSCurveGrid->add(*NURBSCurve);
|
NURBSCurveGrid->add(*NURBSCurveBox);
|
||||||
NURBSCurve->set_hexpand(true);
|
NURBSCurve->set_hexpand(true);
|
||||||
|
|
||||||
if (options.curvebboxpos == 0) {
|
if (options.curvebboxpos == 0) {
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_TOP, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_TOP, 1, 1);
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 1) {
|
} else if (options.curvebboxpos == 1) {
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_RIGHT, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_RIGHT, 1, 1);
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 2, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
} else if (options.curvebboxpos == 2) {
|
} else if (options.curvebboxpos == 2) {
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 3) {
|
} else if (options.curvebboxpos == 3) {
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_LEFT, 1, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_LEFT, 1, 1);
|
||||||
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSbbox, Gtk::POS_BOTTOM, 2, 1);
|
NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSbbox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,25 +235,40 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
|
|
||||||
// parametric curve
|
// parametric curve
|
||||||
paramCurveGrid = new Gtk::Grid ();
|
paramCurveGrid = new Gtk::Grid ();
|
||||||
paramCurveGrid->set_row_spacing(4);
|
|
||||||
paramCurveGrid->set_column_spacing(4);
|
|
||||||
paramCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
paramCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
paramCurveGrid->get_style_context()->add_class("curve-mainbox");
|
||||||
|
|
||||||
paramCurve = Gtk::manage (new MyDiagonalCurve ());
|
paramCurve = Gtk::manage (new MyDiagonalCurve ());
|
||||||
paramCurve->setType (DCT_Parametric);
|
paramCurve->setType (DCT_Parametric);
|
||||||
|
|
||||||
|
Gtk::Grid* paramCurveBox= Gtk::manage (new Gtk::Grid ());
|
||||||
|
paramCurveBox->get_style_context()->add_class("curve-curvebox");
|
||||||
|
paramCurveBox->add(*paramCurve);
|
||||||
|
|
||||||
Gtk::Grid* parambbox = Gtk::manage (new Gtk::Grid ());
|
Gtk::Grid* parambbox = Gtk::manage (new Gtk::Grid ());
|
||||||
|
parambbox->get_style_context()->add_class("curve-buttonbox");
|
||||||
|
|
||||||
if (options.curvebboxpos == 0 || options.curvebboxpos == 2) {
|
if (options.curvebboxpos == 0) {
|
||||||
parambbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
parambbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
setExpandAlignProperties(parambbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(parambbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
} else {
|
paramCurveGrid->get_style_context()->add_class("top");
|
||||||
|
} else if (options.curvebboxpos == 2) {
|
||||||
|
parambbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
|
setExpandAlignProperties(parambbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
|
paramCurveGrid->get_style_context()->add_class("bottom");
|
||||||
|
} else if (options.curvebboxpos == 1) {
|
||||||
parambbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
parambbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
setExpandAlignProperties(parambbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(parambbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
paramCurveGrid->get_style_context()->add_class("right");
|
||||||
|
} else if (options.curvebboxpos == 3){
|
||||||
|
parambbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
setExpandAlignProperties(parambbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
paramCurveGrid->get_style_context()->add_class("left");
|
||||||
}
|
}
|
||||||
|
|
||||||
shcSelector = Gtk::manage (new SHCSelector ());
|
shcSelector = Gtk::manage (new SHCSelector ());
|
||||||
shcSelector->set_name("CurveSHCSelector"); // To handle the 4px gap between the SHCSelector and the curve through CSS
|
shcSelector->set_name("CurveSHCSelector");
|
||||||
|
paramCurveBox->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1);
|
||||||
|
|
||||||
editParam = Gtk::manage (new Gtk::ToggleButton());
|
editParam = Gtk::manage (new Gtk::ToggleButton());
|
||||||
initButton(*editParam, Glib::ustring("crosshair-node-curve.png"), Gtk::ALIGN_START, false, "EDIT_PIPETTE_TOOLTIP");
|
initButton(*editParam, Glib::ustring("crosshair-node-curve.png"), Gtk::ALIGN_START, false, "EDIT_PIPETTE_TOOLTIP");
|
||||||
@@ -272,8 +317,7 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
// paramCurveSliderBox needed to set vspacing(4) between curve+shc and sliders without vspacing between each slider
|
// paramCurveSliderBox needed to set vspacing(4) between curve+shc and sliders without vspacing between each slider
|
||||||
Gtk::Grid* paramCurveSliderBox = Gtk::manage (new Gtk::Grid());
|
Gtk::Grid* paramCurveSliderBox = Gtk::manage (new Gtk::Grid());
|
||||||
paramCurveSliderBox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
paramCurveSliderBox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
paramCurveSliderBox->set_column_spacing(2);
|
paramCurveSliderBox->get_style_context()->add_class("curve-sliderbox");
|
||||||
paramCurveSliderBox->set_row_spacing(2);
|
|
||||||
|
|
||||||
paramCurveSliderBox->attach_next_to(*evhighlights, Gtk::POS_TOP, 1, 1);
|
paramCurveSliderBox->attach_next_to(*evhighlights, Gtk::POS_TOP, 1, 1);
|
||||||
paramCurveSliderBox->attach_next_to(*evlights, Gtk::POS_TOP, 1, 1);
|
paramCurveSliderBox->attach_next_to(*evlights, Gtk::POS_TOP, 1, 1);
|
||||||
@@ -283,24 +327,20 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt,
|
|||||||
paramCurveGrid->show_all ();
|
paramCurveGrid->show_all ();
|
||||||
|
|
||||||
// Button box position: 0=above, 1=right, 2=below, 3=left
|
// Button box position: 0=above, 1=right, 2=below, 3=left
|
||||||
paramCurveGrid->add(*paramCurve);
|
paramCurveGrid->add(*paramCurveBox);
|
||||||
paramCurve->set_hexpand(true);
|
paramCurve->set_hexpand(true);
|
||||||
|
|
||||||
if (options.curvebboxpos == 0) {
|
if (options.curvebboxpos == 0) {
|
||||||
paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_TOP, 1, 1);
|
paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_TOP, 1, 1);
|
||||||
paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1);
|
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *paramCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *shcSelector, Gtk::POS_BOTTOM, 1, 1);
|
|
||||||
} else if (options.curvebboxpos == 1) {
|
} else if (options.curvebboxpos == 1) {
|
||||||
paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1);
|
paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_RIGHT, 1, 1);
|
||||||
paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_RIGHT, 1, 2);
|
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *paramCurveBox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *shcSelector, Gtk::POS_BOTTOM, 2, 1);
|
|
||||||
} else if (options.curvebboxpos == 2) {
|
} else if (options.curvebboxpos == 2) {
|
||||||
paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1);
|
paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
paramCurveGrid->attach_next_to(*parambbox, *shcSelector, Gtk::POS_BOTTOM, 1, 1);
|
|
||||||
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 1, 1);
|
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 3) {
|
} else if (options.curvebboxpos == 3) {
|
||||||
paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1);
|
paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_LEFT, 1, 1);
|
||||||
paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_LEFT, 1, 2);
|
|
||||||
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 2, 1);
|
paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,21 +47,35 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u
|
|||||||
|
|
||||||
// ControlPoints curve
|
// ControlPoints curve
|
||||||
CPointsCurveGrid = new Gtk::Grid ();
|
CPointsCurveGrid = new Gtk::Grid ();
|
||||||
CPointsCurveGrid->set_row_spacing(2);
|
|
||||||
CPointsCurveGrid->set_column_spacing(2);
|
|
||||||
CPointsCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
CPointsCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
CPointsCurveGrid->get_style_context()->add_class("curve-mainbox");
|
||||||
|
|
||||||
CPointsCurve = Gtk::manage (new MyFlatCurve ());
|
CPointsCurve = Gtk::manage (new MyFlatCurve ());
|
||||||
CPointsCurve->setType (FCT_MinMaxCPoints);
|
CPointsCurve->setType (FCT_MinMaxCPoints);
|
||||||
|
|
||||||
|
Gtk::Grid* CPointsCurveBox = Gtk::manage (new Gtk::Grid ());
|
||||||
|
CPointsCurveBox->get_style_context()->add_class("curve-curvebox");
|
||||||
|
CPointsCurveBox->add(*CPointsCurve);
|
||||||
|
|
||||||
Gtk::Grid* CPointsbbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left
|
Gtk::Grid* CPointsbbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left
|
||||||
|
CPointsbbox->get_style_context()->add_class("curve-buttonbox");
|
||||||
|
|
||||||
if (options.curvebboxpos == 0 || options.curvebboxpos == 2) {
|
if (options.curvebboxpos == 0) {
|
||||||
CPointsbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
CPointsbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
setExpandAlignProperties(CPointsbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(CPointsbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
} else {
|
CPointsCurveGrid->get_style_context()->add_class("top");
|
||||||
|
} else if (options.curvebboxpos == 2) {
|
||||||
|
CPointsbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
|
||||||
|
setExpandAlignProperties(CPointsbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
|
CPointsCurveGrid->get_style_context()->add_class("bottom");
|
||||||
|
} else if (options.curvebboxpos == 1) {
|
||||||
CPointsbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
CPointsbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
setExpandAlignProperties(CPointsbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(CPointsbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
CPointsCurveGrid->get_style_context()->add_class("right");
|
||||||
|
} else if (options.curvebboxpos == 3){
|
||||||
|
CPointsbbox->set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
|
setExpandAlignProperties(CPointsbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||||
|
CPointsCurveGrid->get_style_context()->add_class("left");
|
||||||
}
|
}
|
||||||
|
|
||||||
editCPoints = Gtk::manage (new Gtk::ToggleButton());
|
editCPoints = Gtk::manage (new Gtk::ToggleButton());
|
||||||
@@ -92,23 +106,24 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u
|
|||||||
axis.at(2).setValues(M("CURVEEDITOR_AXIS_LEFT_TAN"), 5, 0.01, 0.1, 0., 1.);
|
axis.at(2).setValues(M("CURVEEDITOR_AXIS_LEFT_TAN"), 5, 0.01, 0.1, 0., 1.);
|
||||||
axis.at(3).setValues(M("CURVEEDITOR_AXIS_RIGHT_TAN"), 5, 0.01, 0.1, 0., 1.);
|
axis.at(3).setValues(M("CURVEEDITOR_AXIS_RIGHT_TAN"), 5, 0.01, 0.1, 0., 1.);
|
||||||
CPointsCoordAdjuster = Gtk::manage (new CoordinateAdjuster(CPointsCurve, this, axis));
|
CPointsCoordAdjuster = Gtk::manage (new CoordinateAdjuster(CPointsCurve, this, axis));
|
||||||
|
CPointsCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Button box position: 0=above, 1=right, 2=below, 3=left
|
// Button box position: 0=above, 1=right, 2=below, 3=left
|
||||||
CPointsCurveGrid->add(*CPointsCurve);
|
CPointsCurveGrid->add(*CPointsCurveBox);
|
||||||
CPointsCurve->set_hexpand(true);
|
CPointsCurve->set_hexpand(true);
|
||||||
|
|
||||||
if (options.curvebboxpos == 0) {
|
if (options.curvebboxpos == 0) {
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_TOP, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_TOP, 1, 1);
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 1) {
|
} else if (options.curvebboxpos == 1) {
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_RIGHT, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_RIGHT, 1, 1);
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 2, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
} else if (options.curvebboxpos == 2) {
|
} else if (options.curvebboxpos == 2) {
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 1, 1);
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCoordAdjuster, Gtk::POS_BOTTOM, 1, 1);
|
||||||
} else if (options.curvebboxpos == 3) {
|
} else if (options.curvebboxpos == 3) {
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_LEFT, 1, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_LEFT, 1, 1);
|
||||||
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsbbox, Gtk::POS_BOTTOM, 2, 1);
|
CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsbbox, Gtk::POS_BOTTOM, 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user