[qet] [2181] Add basic color for filling symbols |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2181
Author: scorpio810
Date: 2013-05-29 11:02:26 +0200 (Wed, 29 May 2013)
Log Message:
-----------
Add basic color for filling symbols
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-28 16:50:35 UTC (rev 2180)
+++ trunk/sources/customelement.cpp 2013-05-29 09:02:26 UTC (rev 2181)
@@ -765,6 +765,15 @@
} 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);
}
Modified: trunk/sources/editor/customelementgraphicpart.cpp
===================================================================
--- trunk/sources/editor/customelementgraphicpart.cpp 2013-05-28 16:50:35 UTC (rev 2180)
+++ trunk/sources/editor/customelementgraphicpart.cpp 2013-05-29 09:02:26 UTC (rev 2181)
@@ -39,6 +39,10 @@
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 @@
} 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 @@
} 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
Modified: trunk/sources/editor/customelementgraphicpart.h
===================================================================
--- trunk/sources/editor/customelementgraphicpart.h 2013-05-28 16:50:35 UTC (rev 2180)
+++ trunk/sources/editor/customelementgraphicpart.h 2013-05-29 09:02:26 UTC (rev 2181)
@@ -46,7 +46,10 @@
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.
Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp 2013-05-28 16:50:35 UTC (rev 2180)
+++ trunk/sources/editor/styleeditor.cpp 2013-05-29 09:02:26 UTC (rev 2181)
@@ -32,6 +32,7 @@
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 @@
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 @@
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);
}
Modified: trunk/sources/editor/styleeditor.h
===================================================================
--- trunk/sources/editor/styleeditor.h 2013-05-28 16:50:35 UTC (rev 2180)
+++ trunk/sources/editor/styleeditor.h 2013-05-29 09:02:26 UTC (rev 2181)
@@ -41,9 +41,9 @@
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