Commit 554ae2bd authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix loading / saving of outline color

svn path=/trunk/kdenlive/; revision=4207
parent 9f3ddf35
......@@ -96,17 +96,14 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
content.setAttribute("font-pixel-size", font.pixelSize());
content.setAttribute("font-italic", font.italic());
content.setAttribute("font-underline", font.underline());
{
QTextCursor cursor(t->document());
cursor.select(QTextCursor::Document);
QColor fontcolor = cursor.charFormat().foreground().color();
content.setAttribute("font-color", colorToString(fontcolor));
content.setAttribute("font-outline", t->data(101).toDouble());
content.setAttribute("font-outline-color", t->data(102).toString());
if (!t->data(101).isNull()) content.setAttribute("font-outline", t->data(101).toDouble());
if (!t->data(102).isNull()) content.setAttribute("font-outline-color", colorToString(QColor(t->data(102).toString())));
}
if (!t->data(100).isNull()) {
QStringList effectParams = t->data(100).toStringList();
QString effectName = effectParams.takeFirst();
......
......@@ -677,11 +677,10 @@ void TitleWidget::slotNewText(QGraphicsTextItem *tt)
outlineColor.setAlpha(textOutlineAlpha->value());
double outlineWidth = textOutline->value() / 10.0;
if (outlineWidth > 0.0) {
tt->setData(101, outlineWidth);
tt->setData(102, outlineColor);
cformat.setTextOutline(QPen(outlineColor, outlineWidth));
}
tt->setData(101, outlineWidth);
tt->setData(102, outlineColor);
if (outlineWidth > 0.0) cformat.setTextOutline(QPen(outlineColor, outlineWidth));
cformat.setForeground(QBrush(color));
cur.setCharFormat(cformat);
cur.setBlockFormat(format);
......@@ -1354,11 +1353,11 @@ void TitleWidget::slotUpdateText()
item->setFont(font);
QTextCharFormat cformat = cur.charFormat();
if (outlineWidth > 0.0) {
item->setData(101, outlineWidth);
item->setData(102, outlineColor);
cformat.setTextOutline(QPen(outlineColor, outlineWidth));
}
item->setData(101, outlineWidth);
item->setData(102, outlineColor);
if (outlineWidth > 0.0) cformat.setTextOutline(QPen(outlineColor, outlineWidth));
cformat.setForeground(QBrush(color));
cur.setCharFormat(cformat);
cur.setBlockFormat(format);
......
......@@ -188,6 +188,12 @@
</item>
<item row="2" column="0" colspan="8">
<widget class="QSplitter" name="splitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -935,6 +941,9 @@
<property name="maximum">
<number>255</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>255</number>
</property>
......@@ -948,6 +957,12 @@
</item>
<item>
<widget class="QSlider" name="textOutline">
<property name="maximum">
<number>200</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -958,6 +973,9 @@
<property name="maximum">
<number>255</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>255</number>
</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment