24 m_widget =
new Ui_WdgMultigridPatternOptions();
29 grad.setColorAt(0, Qt::green);
30 grad.setColorAt(1.0, Qt::blue);
33 widget()->wdgGradient->setCompactMode(
true);
35 widget()->sldDivisions->setRange(0, 100);
36 widget()->sldDivisions->setPrefix(i18n(
"Divisions:"));
38 widget()->sldDimensions->setRange(3, 36);
39 widget()->sldDimensions->setPrefix(i18nc(
"The Dimensions of Multigrid pattern generator",
"Dimensions:"));
41 widget()->sldOffset->setRange(0.01, 0.49, 2);
42 widget()->sldOffset->setPrefix(i18n(
"Offset:"));
44 widget()->sldColorRatio->setRange(-2.0, 2.0, 2);
45 widget()->sldColorRatio->setPrefix(i18nc(
"Ratio as in fill layer options",
"Ratio:"));
47 widget()->sldColorIndex->setRange(-2.0, 2.0, 2);
48 widget()->sldColorIndex->setPrefix(i18nc(
"Index number of how far away from center",
"Index:"));
50 widget()->sldColorIntersect->setRange(-2.0, 2.0, 2);
51 widget()->sldColorIntersect->setPrefix(i18n(
"Intersect:"));
53 widget()->cmbConnectorType->addItem(i18n(
"No Connectors"));
54 widget()->cmbConnectorType->addItem(i18n(
"Acute Angles"));
55 widget()->cmbConnectorType->addItem(i18n(
"Obtuse Angles"));
56 widget()->cmbConnectorType->addItem(i18n(
"Cross Shape"));
57 widget()->cmbConnectorType->addItem(i18n(
"Center Dot"));
58 widget()->cmbConnectorType->addItem(i18n(
"Corner Dot"));
86 if (config->hasProperty(
"gradientXML")) {
88 doc.setContent(config->getString(
"gradientXML",
""));
90 if (gradient.
stops().size() > 0) {
97 KoColor c = config->getColor(
"lineColor");
99 widget()->bnLineColor->setColor(c);
101 widget()->spnLineWidth->setValue(config->getInt(
"lineWidth", 1));
103 widget()->sldDivisions->setValue(config->getInt(
"divisions", 1));
105 widget()->sldDimensions->setValue(config->getInt(
"dimensions", 5));
106 widget()->sldOffset->setValue(config->getFloat(
"offset", 0.2));
108 widget()->sldColorIndex->setValue(config->getFloat(
"colorIndex", 1.0));
109 widget()->sldColorRatio->setValue(config->getFloat(
"colorRatio", 0.0));
110 widget()->sldColorIntersect->setValue(config->getFloat(
"colorIntersect", 0.0));
112 c = config->getColor(
"connectorColor");
114 widget()->bnConnectorColor->setColor(c);
115 widget()->cmbConnectorType->setCurrentIndex(config->getInt(
"connectorType", 1));
116 widget()->spnConnectorWidth->setValue(config->getInt(
"connectorWidth", 1));
125 QDomElement elt = doc.createElement(
"gradient");
127 doc.appendChild(elt);
128 config->setProperty(
"gradientXML", doc.toString());
135 config->setProperty(
"lineColor",
v);
136 config->setProperty(
"lineWidth",
widget()->spnLineWidth->value());
138 config->setProperty(
"divisions",
widget()->sldDivisions->value());
140 config->setProperty(
"dimensions",
widget()->sldDimensions->value());
141 config->setProperty(
"offset",
widget()->sldOffset->value());
143 config->setProperty(
"colorRatio",
widget()->sldColorRatio->value());
144 config->setProperty(
"colorIndex",
widget()->sldColorIndex->value());
145 config->setProperty(
"colorIntersect",
widget()->sldColorIntersect->value());
149 config->setProperty(
"connectorColor",
v);
150 config->setProperty(
"connectorType",
widget()->cmbConnectorType->currentIndex());
151 config->setProperty(
"connectorWidth",
widget()->spnConnectorWidth->value());