[qet] [2187] Add basic color line in symbol editor

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


Revision: 2187
Author:   scorpio810
Date:     2013-05-31 15:30:50 +0200 (Fri, 31 May 2013)
Log Message:
-----------
Add basic color line in symbol editor

Modified Paths:
--------------
    trunk/sources/customelement.cpp
    trunk/sources/editor/customelementgraphicpart.cpp
    trunk/sources/editor/customelementgraphicpart.h
    trunk/sources/editor/styleeditor.cpp
    trunk/sources/editor/styleeditor.h

Modified: trunk/sources/customelement.cpp
===================================================================
--- trunk/sources/customelement.cpp	2013-05-30 15:46:08 UTC (rev 2186)
+++ trunk/sources/customelement.cpp	2013-05-31 13:30:50 UTC (rev 2187)
@@ -737,6 +737,9 @@
 	pen.setJoinStyle(Qt::BevelJoin);
 	pen.setCapStyle(Qt::SquareCap);
 	pen.setColor(Qt::black);
+	pen.setColor(Qt::red);
+	pen.setColor(Qt::blue);
+	pen.setColor(Qt::green);
 	pen.setStyle(Qt::SolidLine);
 	pen.setWidthF(1.0);
 	brush.setStyle(Qt::NoBrush);
@@ -782,6 +785,12 @@
 					pen.setColor(QColor(0, 0, 0, pen.color().alpha()));
 				} else if (style_value == "white") {
 					pen.setColor(QColor(255, 255, 255, pen.color().alpha()));
+				} else if (style_value == "red") {
+					pen.setColor(Qt::red);
+				}else if (style_value == "blue") {
+					pen.setColor(Qt::blue);
+				}else if (style_value == "green") {
+					pen.setColor(Qt::green);
 				}
 			}
 		}

Modified: trunk/sources/editor/customelementgraphicpart.cpp
===================================================================
--- trunk/sources/editor/customelementgraphicpart.cpp	2013-05-30 15:46:08 UTC (rev 2186)
+++ trunk/sources/editor/customelementgraphicpart.cpp	2013-05-31 13:30:50 UTC (rev 2187)
@@ -47,6 +47,9 @@
 	css_like_styles += ";color:";
 	if      (_color == WhiteColor) css_like_styles += "white";
 	else if (_color == BlackColor) css_like_styles += "black";
+	else if (_color == GreenColor) css_like_styles += "black";
+	else if (_color == RedColor) css_like_styles += "black";
+	else if (_color == BlueColor) css_like_styles += "black";
 	
 	qde.setAttribute("style", css_like_styles);
 	qde.setAttribute("antialias", _antialiased ? "true" : "false");
@@ -80,13 +83,16 @@
 		} else if (style_name == "filling") {
 			if      (style_value == "white") _filling = WhiteFilling;
 			else if (style_value == "black") _filling = BlackFilling;
-			else if (style_value == "red") _filling = RedFilling;
+			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 == "blue") _filling  = BlueFilling;
 			else if (style_value == "none")  _filling = NoneFilling;
 		} else if (style_name == "color") {
 			if      (style_value == "black") _color = BlackColor;
 			else if (style_value == "white") _color = WhiteColor;
+			else if (style_value == "green") _color = GreenColor;
+			else if (style_value == "red") _color   = RedColor;
+			else if (style_value == "blue") _color  = BlueColor;
 		}
 	}
 	
@@ -147,6 +153,9 @@
 	// applique la couleur de trait
 	if      (_color == WhiteColor) pen.setColor(QColor(255, 255, 255, pen.color().alpha()));
 	else if (_color == BlackColor) pen.setColor(QColor(  0,   0,   0, pen.color().alpha()));
+	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));
 	
 	
 	// applique l'antialiasing

Modified: trunk/sources/editor/customelementgraphicpart.h
===================================================================
--- trunk/sources/editor/customelementgraphicpart.h	2013-05-30 15:46:08 UTC (rev 2186)
+++ trunk/sources/editor/customelementgraphicpart.h	2013-05-31 13:30:50 UTC (rev 2187)
@@ -55,7 +55,10 @@
 	/// This enum lists the various line colors available to draw primitives.
 	enum Color {
 		BlackColor, ///< Black line
-		WhiteColor  ///< White line
+		WhiteColor, ///< White line
+		GreenColor, ///< Green line
+		RedColor,  ///<  Red line
+		BlueColor  ///<  Blue line
 	};
 	
 	// constructors, destructor

Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp	2013-05-30 15:46:08 UTC (rev 2186)
+++ trunk/sources/editor/styleeditor.cpp	2013-05-31 13:30:50 UTC (rev 2187)
@@ -32,6 +32,9 @@
 	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);
+	color -> addButton(green_color = new QRadioButton(tr("Vert", "element part color")), CustomElementGraphicPart::GreenColor);
+	color -> addButton(red_color = new QRadioButton(tr("Rouge", "element part color")), CustomElementGraphicPart::RedColor);
+	color -> addButton(blue_color = new QRadioButton(tr("Bleu", "element part color")),  CustomElementGraphicPart::BlueColor);
 
 	
 	// style
@@ -70,6 +73,9 @@
 	color_layout -> addWidget(new QLabel(tr("Couleur : ")));
 	color_layout -> addWidget(black_color);
 	color_layout -> addWidget(white_color);
+	color_layout -> addWidget(green_color);
+	color_layout -> addWidget(red_color);
+	color_layout -> addWidget(blue_color);
 	color_layout -> addStretch();
 	main_layout -> addLayout(color_layout);
 	

Modified: trunk/sources/editor/styleeditor.h
===================================================================
--- trunk/sources/editor/styleeditor.h	2013-05-30 15:46:08 UTC (rev 2186)
+++ trunk/sources/editor/styleeditor.h	2013-05-31 13:30:50 UTC (rev 2187)
@@ -41,7 +41,7 @@
 	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, *green_color, *red_color, *blue_color;
 	QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
 	QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling;
 	QCheckBox *antialiasing;


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