From: Jean-Baptiste Mardelle Date: Tue, 5 Jan 2010 12:22:50 +0000 (+0000) Subject: indent X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=84f3c046e0d2bcb13a77533581a01df75ad6101a;p=kdenlive indent svn path=/trunk/kdenlive/; revision=4204 --- diff --git a/src/titledocument.cpp b/src/titledocument.cpp index c959e04b..18c60662 100644 --- a/src/titledocument.cpp +++ b/src/titledocument.cpp @@ -273,22 +273,22 @@ int TitleDocument::loadFromXml(QDomDocument doc, QGraphicsRectItem* startv, QGra font.setPixelSize(txtProperties.namedItem("font-pixel-size").nodeValue().toInt()); QColor col(stringToColor(txtProperties.namedItem("font-color").nodeValue())); QGraphicsTextItem *txt = m_scene->addText(items.item(i).namedItem("content").firstChild().nodeValue(), font); - if (txtProperties.namedItem("font-outline").nodeValue().toDouble()>0.0){ - txt->setData(101,txtProperties.namedItem("font-outline").nodeValue().toDouble()); - txt->setData(102,stringToColor( txtProperties.namedItem( "font-outline-color" ).nodeValue() )); - QTextCursor cursor(txt->document()); - cursor.select(QTextCursor::Document); - QTextCharFormat format; - format.setTextOutline( - QPen(QColor( stringToColor( txtProperties.namedItem( "font-outline-color" ).nodeValue() ) ), - txtProperties.namedItem("font-outline").nodeValue().toDouble()) - ); - format.setForeground(QBrush(col)); - - cursor.mergeCharFormat(format); - } else { - txt->setDefaultTextColor( col ); - } + if (txtProperties.namedItem("font-outline").nodeValue().toDouble() > 0.0) { + txt->setData(101, txtProperties.namedItem("font-outline").nodeValue().toDouble()); + txt->setData(102, stringToColor(txtProperties.namedItem("font-outline-color").nodeValue())); + QTextCursor cursor(txt->document()); + cursor.select(QTextCursor::Document); + QTextCharFormat format; + format.setTextOutline( + QPen(QColor(stringToColor(txtProperties.namedItem("font-outline-color").nodeValue())), + txtProperties.namedItem("font-outline").nodeValue().toDouble()) + ); + format.setForeground(QBrush(col)); + + cursor.mergeCharFormat(format); + } else { + txt->setDefaultTextColor(col); + } txt->setTextInteractionFlags(Qt::NoTextInteraction); if (txtProperties.namedItem("alignment").isNull() == false) { txt->setTextWidth(txt->boundingRect().width()); diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 9cf416fb..1b1384b5 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -805,25 +805,25 @@ void TitleWidget::selectionChanged() setFontBoxWeight(font.weight()); QColor color = i->defaultTextColor(); - QTextCursor cursor(i->document()); - cursor.select(QTextCursor::Document); - color=cursor.charFormat().foreground().color(); + QTextCursor cursor(i->document()); + cursor.select(QTextCursor::Document); + color = cursor.charFormat().foreground().color(); fontColorButton->setColor(color); textAlpha->setValue(color.alpha()); - if (!i->data(101).isNull()){ - textOutline->blockSignals(true); - textOutline->setValue(i->data(101).toDouble()*10); - textOutline->blockSignals(false); - } - if (!i->data(102).isNull()){ - textOutlineColor->blockSignals(true); - textOutlineAlpha->blockSignals(true); - textOutlineColor->setColor(i->data(102).toString()); - textOutlineAlpha->setValue(QColor(i->data(102).toString()).alpha()); - textOutlineColor->blockSignals(false); - textOutlineAlpha->blockSignals(false); - } + if (!i->data(101).isNull()) { + textOutline->blockSignals(true); + textOutline->setValue(i->data(101).toDouble()*10); + textOutline->blockSignals(false); + } + if (!i->data(102).isNull()) { + textOutlineColor->blockSignals(true); + textOutlineAlpha->blockSignals(true); + textOutlineColor->setColor(i->data(102).toString()); + textOutlineAlpha->setValue(QColor(i->data(102).toString()).alpha()); + textOutlineColor->blockSignals(false); + textOutlineAlpha->blockSignals(false); + } QTextCursor cur = i->textCursor(); QTextBlockFormat format = cur.blockFormat(); if (i->textWidth() == -1) buttonAlignNone->setChecked(true); @@ -1312,9 +1312,9 @@ void TitleWidget::slotUpdateText() QColor color = fontColorButton->color(); color.setAlpha(textAlpha->value()); - QColor outlineColor=textOutlineColor->color(); + QColor outlineColor = textOutlineColor->color(); outlineColor.setAlpha(textOutlineAlpha->value()); - double outlineWidth=textOutline->value()/10.0; + double outlineWidth = textOutline->value() / 10.0; QGraphicsTextItem* item = NULL; QList l = graphicsView->scene()->selectedItems(); if (l.size() == 1 && l.at(0)->type() == TEXTITEM) { @@ -1336,18 +1336,18 @@ void TitleWidget::slotUpdateText() { item->setFont(font); - if (outlineWidth>0.0){ - item->setData(101,outlineWidth); - item->setData(102,outlineColor); - QTextCursor cursor(item->document()); - cursor.select(QTextCursor::Document); - QTextCharFormat format; - format.setTextOutline( QPen(outlineColor,outlineWidth )); - format.setForeground(QBrush(color)); - cursor.mergeCharFormat(format); - }else{ - item->setDefaultTextColor(color); - } + if (outlineWidth > 0.0) { + item->setData(101, outlineWidth); + item->setData(102, outlineColor); + QTextCursor cursor(item->document()); + cursor.select(QTextCursor::Document); + QTextCharFormat format; + format.setTextOutline(QPen(outlineColor, outlineWidth)); + format.setForeground(QBrush(color)); + cursor.mergeCharFormat(format); + } else { + item->setDefaultTextColor(color); + } cur.select(QTextCursor::Document); cur.setBlockFormat(format); item->setTextCursor(cur);