diff --git a/sources/customelement.cpp b/sources/customelement.cpp index 45f4e1305..2c5154ea3 100644 --- a/sources/customelement.cpp +++ b/sources/customelement.cpp @@ -765,6 +765,15 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) { } else if (style_value == "black") { brush.setStyle(Qt::SolidPattern); brush.setColor(Qt::black); + } else if (style_value == "blue") { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::blue); + } else if (style_value == "red") { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::red); + } else if (style_value == "green") { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::green); } else if (style_value == "none") { brush.setStyle(Qt::NoBrush); } diff --git a/sources/editor/customelementgraphicpart.cpp b/sources/editor/customelementgraphicpart.cpp index 2fb0b4b6e..bd9abbcee 100644 --- a/sources/editor/customelementgraphicpart.cpp +++ b/sources/editor/customelementgraphicpart.cpp @@ -39,6 +39,10 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const { if (_filling == NoneFilling) css_like_styles += "none"; else if (_filling == BlackFilling) css_like_styles += "black"; else if (_filling == WhiteFilling) css_like_styles += "white"; + else if (_filling == GreenFilling) css_like_styles += "green"; + else if (_filling == BlueFilling) css_like_styles += "blue"; + else if (_filling == RedFilling) css_like_styles += "red"; + css_like_styles += ";color:"; if (_color == WhiteColor) css_like_styles += "white"; @@ -76,6 +80,9 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde) { } else if (style_name == "filling") { if (style_value == "white") _filling = WhiteFilling; else if (style_value == "black") _filling = BlackFilling; + else if (style_value == "reed") _filling = RedFilling; + else if (style_value == "green") _filling = GreenFilling; + else if (style_value == "blue") _filling = BlueFilling; else if (style_value == "none") _filling = NoneFilling; } else if (style_name == "color") { if (style_value == "black") _color = BlackColor; @@ -126,6 +133,15 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const { } else if (_filling == WhiteFilling) { brush.setStyle(Qt::SolidPattern); brush.setColor(Qt::white); + } else if (_filling == GreenFilling) { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::green); + } else if (_filling == RedFilling) { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::red); + } else if (_filling == BlueFilling) { + brush.setStyle(Qt::SolidPattern); + brush.setColor(Qt::blue); } // applique la couleur de trait diff --git a/sources/editor/customelementgraphicpart.h b/sources/editor/customelementgraphicpart.h index 15b126fea..eb31be1d9 100644 --- a/sources/editor/customelementgraphicpart.h +++ b/sources/editor/customelementgraphicpart.h @@ -46,7 +46,10 @@ class CustomElementGraphicPart : public CustomElementPart { enum Filling { NoneFilling, ///< No filling (i.e. transparent) BlackFilling, ///< Black filling - WhiteFilling ///< White filling + WhiteFilling, ///< White filling + GreenFilling, ///< Green filling + RedFilling, ///< Red filling + BlueFilling ///< Green filling }; /// This enum lists the various line colors available to draw primitives. diff --git a/sources/editor/styleeditor.cpp b/sources/editor/styleeditor.cpp index 6223f0071..35f3c020e 100644 --- a/sources/editor/styleeditor.cpp +++ b/sources/editor/styleeditor.cpp @@ -32,6 +32,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p, color = new QButtonGroup(this); color -> addButton(black_color = new QRadioButton(tr("Noir", "element part color")), CustomElementGraphicPart::BlackColor); color -> addButton(white_color = new QRadioButton(tr("Blanc", "element part color")), CustomElementGraphicPart::WhiteColor); + // style style = new QButtonGroup(this); @@ -51,7 +52,10 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p, filling -> addButton(no_filling = new QRadioButton(tr("Aucun", "element part filling")), CustomElementGraphicPart::NoneFilling ); filling -> addButton(black_filling = new QRadioButton(tr("Noir", "element part filling")), CustomElementGraphicPart::BlackFilling); filling -> addButton(white_filling = new QRadioButton(tr("Blanc", "element part filling")), CustomElementGraphicPart::WhiteFilling); - + filling -> addButton(green_filling = new QRadioButton(tr("Vert", "element part filling")), CustomElementGraphicPart::GreenFilling); + filling -> addButton(red_filling = new QRadioButton(tr("Rouge", "element part filling")), CustomElementGraphicPart::RedFilling); + filling -> addButton(blue_filling = new QRadioButton(tr("Blue", "element part filling")), CustomElementGraphicPart::BlueFilling); + // antialiasing antialiasing = new QCheckBox(tr("Antialiasing")); @@ -91,11 +95,14 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p, filling_layout -> addWidget(no_filling); filling_layout -> addWidget(black_filling); filling_layout -> addWidget(white_filling); + filling_layout -> addWidget(green_filling); + filling_layout -> addWidget(red_filling); + filling_layout -> addWidget(blue_filling); filling_layout -> addStretch(); main_layout -> addLayout(filling_layout); main_layout -> addStretch(); - + setLayout(main_layout); } diff --git a/sources/editor/styleeditor.h b/sources/editor/styleeditor.h index 904a6f364..23f52cb89 100644 --- a/sources/editor/styleeditor.h +++ b/sources/editor/styleeditor.h @@ -41,9 +41,9 @@ class StyleEditor : public ElementItemEditor { CustomElementGraphicPart *part; QVBoxLayout *main_layout; QButtonGroup *color, *style, *weight, *filling; - QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dotted_style; + QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dotted_style; QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling; - QRadioButton *black_filling, *white_filling; + QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling; QCheckBox *antialiasing; // methods