mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Add brun and yellow colors for element part
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3952 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -172,6 +172,8 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
|
||||
else if (_filling == BlueFilling) css_like_styles += "blue";
|
||||
else if (_filling == RedFilling) css_like_styles += "red";
|
||||
else if (_filling == GrayFilling) css_like_styles += "gray";
|
||||
else if (_filling == BrunFilling) css_like_styles += "brun";
|
||||
else if (_filling == YellowFilling) css_like_styles += "yellow";
|
||||
|
||||
|
||||
css_like_styles += ";color:";
|
||||
@@ -181,6 +183,8 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
|
||||
else if (_color == RedColor) css_like_styles += "red";
|
||||
else if (_color == BlueColor) css_like_styles += "blue";
|
||||
else if (_color == GrayColor) css_like_styles += "gray";
|
||||
else if (_color == BrunColor) css_like_styles += "brun";
|
||||
else if (_color == YellowColor) css_like_styles += "yellow";
|
||||
|
||||
qde.setAttribute("style", css_like_styles);
|
||||
qde.setAttribute("antialias", _antialiased ? "true" : "false");
|
||||
@@ -229,6 +233,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
else if (style_value == "green") _filling = GreenFilling;
|
||||
else if (style_value == "blue") _filling = BlueFilling;
|
||||
else if (style_value == "gray") _filling = GrayFilling;
|
||||
else if (style_value == "brun") _filling = BrunFilling;
|
||||
else if (style_value == "yellow") _filling = YellowFilling;
|
||||
else if (style_value == "none") _filling = NoneFilling;
|
||||
}
|
||||
else if (style_name == "color")
|
||||
@@ -239,6 +245,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
else if (style_value == "red") _color = RedColor;
|
||||
else if (style_value == "blue") _color = BlueColor;
|
||||
else if (style_value == "gray") _color = GrayColor;
|
||||
else if (style_value == "brun") _color = BrunColor;
|
||||
else if (style_value == "yellow") _color = YellowColor;
|
||||
}
|
||||
}
|
||||
//Get antialiasing
|
||||
@@ -295,6 +303,8 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
|
||||
else if (_filling == RedFilling) brush.setColor(Qt::red);
|
||||
else if (_filling == BlueFilling) brush.setColor(Qt::blue);
|
||||
else if (_filling == GrayFilling) brush.setColor(Qt::gray);
|
||||
else if (_filling == BrunFilling) brush.setColor(QColor(97, 44, 0));
|
||||
else if (_filling == YellowFilling) brush.setColor(Qt::yellow);
|
||||
}
|
||||
|
||||
//Apply pen color
|
||||
@@ -304,6 +314,8 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
|
||||
else if (_color == RedColor) pen.setColor(QColor(Qt::red));
|
||||
else if (_color == BlueColor) pen.setColor(QColor(Qt::blue));
|
||||
else if (_color == GrayColor) pen.setColor(QColor(Qt::gray));
|
||||
else if (_color == BrunColor) pen.setColor(QColor(97, 44, 0));
|
||||
else if (_color == YellowColor) pen.setColor(QColor(Qt::yellow));
|
||||
|
||||
//Apply antialiasing
|
||||
painter.setRenderHint(QPainter::Antialiasing, _antialiased);
|
||||
|
||||
@@ -56,10 +56,10 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar
|
||||
enum LineWeight {NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight};
|
||||
|
||||
//Filling color of the part : NoneFilling -> No filling (i.e. transparent)
|
||||
enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling};
|
||||
enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling};
|
||||
|
||||
//Line color
|
||||
enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor};
|
||||
enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor};
|
||||
|
||||
// constructors, destructor
|
||||
public:
|
||||
|
||||
@@ -36,6 +36,8 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
outline_color -> addItem(tr("Rouge", "element part color"), CustomElementGraphicPart::RedColor);
|
||||
outline_color -> addItem(tr("Bleu", "element part color"), CustomElementGraphicPart::BlueColor);
|
||||
outline_color -> addItem(tr("Gris", "element part color"), CustomElementGraphicPart::GrayColor);
|
||||
outline_color -> addItem(tr("Marron", "element part color"), CustomElementGraphicPart::BrunColor);
|
||||
outline_color -> addItem(tr("Jaune", "element part color"), CustomElementGraphicPart::YellowColor);
|
||||
|
||||
// style
|
||||
line_style = new QComboBox(this);
|
||||
@@ -62,6 +64,8 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
filling_color -> addItem(tr("Rouge", "element part filling"), CustomElementGraphicPart::RedFilling);
|
||||
filling_color -> addItem(tr("Bleu", "element part filling"), CustomElementGraphicPart::BlueFilling);
|
||||
filling_color -> addItem(tr("Gris", "element part filling"), CustomElementGraphicPart::GrayFilling);
|
||||
filling_color -> addItem(tr("marron", "element part filling"), CustomElementGraphicPart::BrunFilling);
|
||||
filling_color -> addItem(tr("Jaune", "element part filling"), CustomElementGraphicPart::YellowFilling);
|
||||
|
||||
// antialiasing
|
||||
antialiasing = new QCheckBox(tr("Antialiasing"));
|
||||
|
||||
@@ -43,9 +43,9 @@ class StyleEditor : public ElementItemEditor
|
||||
QList <CustomElementGraphicPart *> m_part_list;
|
||||
QList <CustomElementPart *> m_cep_list;
|
||||
QVBoxLayout *main_layout;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color, *gray_color;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color, *gray_color, *brun_color, *yellow_color;
|
||||
QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
|
||||
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling;
|
||||
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling, *brun_filling, *yellow_filling;
|
||||
QCheckBox *antialiasing;
|
||||
QComboBox *filling_color, *outline_color, *size_weight, *line_style;
|
||||
|
||||
|
||||
@@ -823,6 +823,8 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
- blue : remplissage bleu
|
||||
- green : remplissage vert
|
||||
- gray : remplissage gris
|
||||
- brun : remplissage marron
|
||||
- yellow : remplissage jaune
|
||||
- none : pas de remplissage [par defaut]
|
||||
- color : couleur du trait et du texte
|
||||
- white : trait noir [par defaut]
|
||||
@@ -831,6 +833,8 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
- blue : trait bleu
|
||||
- green : trait vert
|
||||
- gray : trait gris
|
||||
- brun : trait marron
|
||||
- yellow : trait jaune
|
||||
|
||||
Les autres valeurs ne sont pas prises en compte.
|
||||
@param e L'element XML a parser
|
||||
@@ -885,6 +889,12 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
} else if (style_value == "gray") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::gray);
|
||||
} else if (style_value == "brun") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(QColor(97, 44, 0));
|
||||
} else if (style_value == "yellow") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::yellow);
|
||||
} else if (style_value == "none") {
|
||||
brush.setStyle(Qt::NoBrush);
|
||||
}
|
||||
@@ -901,6 +911,11 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
pen.setColor(Qt::green);
|
||||
}else if (style_value == "gray") {
|
||||
pen.setColor(Qt::gray);
|
||||
}else if (style_value == "brun") {
|
||||
pen.setColor(QColor(97, 44, 0));
|
||||
}else if (style_value == "yellow") {
|
||||
pen.setColor(Qt::yellow);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user