[qet] [3951] Add grey color for element part

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3951
Author:   scorpio810
Date:     2015-05-11 13:06:58 +0200 (Mon, 11 May 2015)
Log Message:
-----------
Add grey color 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-10 18:41:48 UTC (rev 3950)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.cpp	2015-05-11 11:06:58 UTC (rev 3951)
@@ -171,6 +171,7 @@
 	else if (_filling == GreenFilling) css_like_styles += "green";
 	else if (_filling == BlueFilling)  css_like_styles += "blue";
 	else if (_filling == RedFilling)   css_like_styles += "red";
+	else if (_filling == GrayFilling)  css_like_styles += "gray";
 
 	
 	css_like_styles += ";color:";
@@ -179,7 +180,8 @@
 	else if (_color == GreenColor) css_like_styles += "green";
 	else if (_color == RedColor)   css_like_styles += "red";
 	else if (_color == BlueColor)  css_like_styles += "blue";
-	
+	else if (_color == GrayColor)  css_like_styles += "gray";
+
 	qde.setAttribute("style", css_like_styles);
 	qde.setAttribute("antialias", _antialiased ? "true" : "false");
 }
@@ -226,6 +228,7 @@
 			else if (style_value == "red")   _filling = RedFilling;
 			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 == "none")  _filling = NoneFilling;
 		}
 		else if (style_name == "color")
@@ -235,6 +238,7 @@
 			else if (style_value == "green") _color = GreenColor;
 			else if (style_value == "red")   _color = RedColor;
 			else if (style_value == "blue")  _color = BlueColor;
+			else if (style_value == "gray")  _color = GrayColor;
 		}
 	}
 		//Get antialiasing
@@ -290,6 +294,7 @@
 		else if (_filling == GreenFilling) brush.setColor(Qt::green);
 		else if (_filling == RedFilling)   brush.setColor(Qt::red);
 		else if (_filling == BlueFilling)  brush.setColor(Qt::blue);
+		else if (_filling == GrayFilling)  brush.setColor(Qt::gray);
 	}
 	
 		//Apply pen color
@@ -298,6 +303,7 @@
 	else if (_color == GreenColor) pen.setColor(QColor(Qt::green));
 	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));
 	
 		//Apply antialiasing
 	painter.setRenderHint(QPainter::Antialiasing,          _antialiased);

Modified: trunk/sources/editor/graphicspart/customelementgraphicpart.h
===================================================================
--- trunk/sources/editor/graphicspart/customelementgraphicpart.h	2015-05-10 18:41:48 UTC (rev 3950)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.h	2015-05-11 11:06:58 UTC (rev 3951)
@@ -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};
+		enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling};
 
 			//Line color
-		enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor};
+		enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor};
 	
 		// constructors, destructor
 	public:

Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp	2015-05-10 18:41:48 UTC (rev 3950)
+++ trunk/sources/editor/styleeditor.cpp	2015-05-11 11:06:58 UTC (rev 3951)
@@ -35,6 +35,7 @@
 	outline_color -> addItem(tr("Vert", "element part color"), CustomElementGraphicPart::GreenColor);
 	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);
 
 	// style
 	line_style = new QComboBox(this);
@@ -60,6 +61,7 @@
 	filling_color -> addItem(tr("Vert", "element part filling"), CustomElementGraphicPart::GreenFilling);
 	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);
 
 	// antialiasing
 	antialiasing = new QCheckBox(tr("Antialiasing"));

Modified: trunk/sources/editor/styleeditor.h
===================================================================
--- trunk/sources/editor/styleeditor.h	2015-05-10 18:41:48 UTC (rev 3950)
+++ trunk/sources/editor/styleeditor.h	2015-05-11 11:06:58 UTC (rev 3951)
@@ -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;
+		QRadioButton *black_color, *white_color,  *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color, *gray_color;
 		QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
-		QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling;
+		QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_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-10 18:41:48 UTC (rev 3950)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2015-05-11 11:06:58 UTC (rev 3951)
@@ -822,6 +822,7 @@
 			 - red   : remplissage rouge
 			- blue  : remplissage bleu
 			- green : remplissage vert
+			- gray : remplissage gris
 			- none : pas de remplissage [par defaut]
 		- color : couleur du trait et du texte
 			- white : trait noir [par defaut]
@@ -829,6 +830,7 @@
 			- red   : trait rouge
 			- blue  : trait bleu
 			- green : trait vert
+			- gray : trait gris
 			
 	Les autres valeurs ne sont pas prises en compte.
 	@param e L'element XML a parser
@@ -880,6 +882,9 @@
 				} else if (style_value == "green") {
 					brush.setStyle(Qt::SolidPattern);
 					brush.setColor(Qt::green);
+				} else if (style_value == "gray") {
+					brush.setStyle(Qt::SolidPattern);
+					brush.setColor(Qt::gray);
 				} else if (style_value == "none") {
 					brush.setStyle(Qt::NoBrush);
 				}
@@ -894,6 +899,8 @@
 					pen.setColor(Qt::blue);
 				}else if (style_value == "green") {
 					pen.setColor(Qt::green);
+				}else if (style_value == "gray") {
+					pen.setColor(Qt::gray);
 				}
 			}
 		}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/