[qet] [3963] Add others colors for element part |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3963
Author: scorpio810
Date: 2015-05-12 16:49:41 +0200 (Tue, 12 May 2015)
Log Message:
-----------
Add others colors for element part
Modified Paths:
--------------
trunk/sources/editor/graphicspart/customelementgraphicpart.cpp
trunk/sources/editor/graphicspart/customelementgraphicpart.h
trunk/sources/editor/styleeditor.cpp
trunk/sources/editor/styleeditor.h
trunk/sources/qetgraphicsitem/customelement.cpp
Modified: trunk/sources/editor/graphicspart/customelementgraphicpart.cpp
===================================================================
--- trunk/sources/editor/graphicspart/customelementgraphicpart.cpp 2015-05-11 20:06:41 UTC (rev 3962)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.cpp 2015-05-12 14:49:41 UTC (rev 3963)
@@ -173,7 +173,11 @@
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";
+ else if (_filling == CyanFilling) css_like_styles += "cyan";
+ else if (_filling == MagentaFilling) css_like_styles += "magenta";
+ else if (_filling == LightgrayFilling) css_like_styles += "lightgray";
+ else if (_filling == OrangeFilling) css_like_styles += "orange";
+ else if (_filling == PurpleFilling) css_like_styles += "purple";
css_like_styles += ";color:";
@@ -185,6 +189,11 @@
else if (_color == GrayColor) css_like_styles += "gray";
else if (_color == BrunColor) css_like_styles += "brun";
else if (_color == YellowColor) css_like_styles += "yellow";
+ else if (_color == CyanColor) css_like_styles += "cyan";
+ else if (_color == MagentaColor) css_like_styles += "magenta";
+ else if (_color == LightgrayColor) css_like_styles += "lightgray";
+ else if (_color == OrangeColor) css_like_styles += "orange";
+ else if (_color == PurpleColor) css_like_styles += "purple";
qde.setAttribute("style", css_like_styles);
qde.setAttribute("antialias", _antialiased ? "true" : "false");
@@ -235,6 +244,11 @@
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 == "cyan") _filling = CyanFilling;
+ else if (style_value == "magenta") _filling = MagentaFilling;
+ else if (style_value == "lightgray") _filling = LightgrayFilling;
+ else if (style_value == "orange") _filling = OrangeFilling;
+ else if (style_value == "purple") _filling = PurpleFilling;
else if (style_value == "none") _filling = NoneFilling;
}
else if (style_name == "color")
@@ -247,6 +261,11 @@
else if (style_value == "gray") _color = GrayColor;
else if (style_value == "brun") _color = BrunColor;
else if (style_value == "yellow") _color = YellowColor;
+ else if (style_value == "cyan") _color = CyanColor;
+ else if (style_value == "magenta") _color = MagentaColor;
+ else if (style_value == "lightgray") _color = LightgrayColor;
+ else if (style_value == "orange") _color = OrangeColor;
+ else if (style_value == "purple") _color = PurpleColor;
}
}
//Get antialiasing
@@ -305,6 +324,11 @@
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);
+ else if (_filling == CyanFilling) brush.setColor(Qt::cyan);
+ else if (_filling == MagentaFilling) brush.setColor(Qt::magenta);
+ else if (_filling == LightgrayFilling) brush.setColor(Qt::lightGray);
+ else if (_filling == OrangeFilling) brush.setColor(QColor(255, 128, 0));
+ else if (_filling == PurpleFilling) brush.setColor(QColor(136, 28, 168));
}
//Apply pen color
@@ -316,6 +340,11 @@
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));
+ else if (_color == CyanColor) pen.setColor(Qt::cyan);
+ else if (_color == MagentaColor) pen.setColor(Qt::magenta);
+ else if (_color == LightgrayColor) pen.setColor(Qt::lightGray);
+ else if (_color == OrangeColor) pen.setColor(QColor(255, 128, 0));
+ else if (_color == PurpleColor) pen.setColor(QColor(136, 28, 168));
//Apply antialiasing
painter.setRenderHint(QPainter::Antialiasing, _antialiased);
Modified: trunk/sources/editor/graphicspart/customelementgraphicpart.h
===================================================================
--- trunk/sources/editor/graphicspart/customelementgraphicpart.h 2015-05-11 20:06:41 UTC (rev 3962)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.h 2015-05-12 14:49:41 UTC (rev 3963)
@@ -56,10 +56,10 @@
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, BrunFilling, YellowFilling};
+ enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling };
//Line color
- enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor};
+ enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor};
// constructors, destructor
public:
Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp 2015-05-11 20:06:41 UTC (rev 3962)
+++ trunk/sources/editor/styleeditor.cpp 2015-05-12 14:49:41 UTC (rev 3963)
@@ -38,6 +38,11 @@
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);
+ outline_color -> addItem(tr("Cyan", "element part color"), CustomElementGraphicPart::CyanColor);
+ outline_color -> addItem(tr("Magenta", "element part color"), CustomElementGraphicPart::MagentaColor);
+ outline_color -> addItem(tr("Gris clair", "element part color"), CustomElementGraphicPart::LightgrayColor);
+ outline_color -> addItem(tr("Orange", "element part color"), CustomElementGraphicPart::OrangeColor);
+ outline_color -> addItem(tr("Violet", "element part color"), CustomElementGraphicPart::PurpleColor);
// style
line_style = new QComboBox(this);
@@ -66,6 +71,11 @@
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);
+ filling_color -> addItem(tr("Cyan", "element part filling"), CustomElementGraphicPart::CyanFilling);
+ filling_color -> addItem(tr("Magenta", "element part filling"), CustomElementGraphicPart::MagentaFilling);
+ filling_color -> addItem(tr("Gris clair", "element part filling"), CustomElementGraphicPart::LightgrayFilling);
+ filling_color -> addItem(tr("Orange", "element part filling"), CustomElementGraphicPart::OrangeFilling);
+ filling_color -> addItem(tr("Violet", "element part filling"), CustomElementGraphicPart::PurpleFilling);
// antialiasing
antialiasing = new QCheckBox(tr("Antialiasing"));
Modified: trunk/sources/editor/styleeditor.h
===================================================================
--- trunk/sources/editor/styleeditor.h 2015-05-11 20:06:41 UTC (rev 3962)
+++ trunk/sources/editor/styleeditor.h 2015-05-12 14:49:41 UTC (rev 3963)
@@ -43,9 +43,9 @@
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, *brun_color, *yellow_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, *cyan_color, *magenta_color, *gris_clair_color, orange_color, *violet_color;
QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
- QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling, *brun_filling, *yellow_filling;
+ QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling, *brun_filling, *yellow_filling, *cyan_filling, *magenta_filling, *gris_clair_filling, orange_filling, *violet_filling;
QCheckBox *antialiasing;
QComboBox *filling_color, *outline_color, *size_weight, *line_style;
Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp 2015-05-11 20:06:41 UTC (rev 3962)
+++ trunk/sources/qetgraphicsitem/customelement.cpp 2015-05-12 14:49:41 UTC (rev 3963)
@@ -825,6 +825,10 @@
- gray : remplissage gris
- brun : remplissage marron
- yellow : remplissage jaune
+ - cyan : remplissage cyan
+ - lightgray : remplissage gris clair
+ - orange : remplissage orange
+ - purple : remplissage violet
- none : pas de remplissage [par defaut]
- color : couleur du trait et du texte
- white : trait noir [par defaut]
@@ -835,6 +839,10 @@
- gray : trait gris
- brun : trait marron
- yellow : trait jaune
+ - cyan : trait cyan
+ - lightgray : trait gris clair
+ - orange : trait orange
+ - purple : trait violet
Les autres valeurs ne sont pas prises en compte.
@param e L'element XML a parser
@@ -895,6 +903,21 @@
} else if (style_value == "yellow") {
brush.setStyle(Qt::SolidPattern);
brush.setColor(Qt::yellow);
+ } else if (style_value == "cyan") {
+ brush.setStyle(Qt::SolidPattern);
+ brush.setColor(Qt::cyan);
+ } else if (style_value == "magenta") {
+ brush.setStyle(Qt::SolidPattern);
+ brush.setColor(Qt::magenta);
+ } else if (style_value == "lightgray") {
+ brush.setStyle(Qt::SolidPattern);
+ brush.setColor(Qt::lightGray);
+ } else if (style_value == "orange") {
+ brush.setStyle(Qt::SolidPattern);
+ brush.setColor(QColor(255, 128, 0));
+ } else if (style_value == "purple") {
+ brush.setStyle(Qt::SolidPattern);
+ brush.setColor(QColor(136, 28, 168));
} else if (style_value == "none") {
brush.setStyle(Qt::NoBrush);
}
@@ -915,7 +938,16 @@
pen.setColor(QColor(97, 44, 0));
}else if (style_value == "yellow") {
pen.setColor(Qt::yellow);
-
+ }else if (style_value == "cyan") {
+ pen.setColor(Qt::cyan);
+ }else if (style_value == "magenta") {
+ pen.setColor(Qt::magenta);
+ }else if (style_value == "lightgray") {
+ pen.setColor(Qt::lightGray);
+ }else if (style_value == "orange") {
+ pen.setColor(QColor(255, 128, 0));
+ }else if (style_value == "purple") {
+ pen.setColor(QColor(136, 28, 168));
}
}
}