respect defaultColor for barline and textlines

This commit is contained in:
lasconic 2013-06-19 09:53:15 +02:00
parent 5bc26d966e
commit 9858b7a104
4 changed files with 11 additions and 8 deletions

View file

@ -2016,7 +2016,7 @@ void Measure::read(XmlReader& e, int staffIdx)
else if (barLine->barLineType() == START_REPEAT) else if (barLine->barLineType() == START_REPEAT)
segment = getSegment(Segment::SegStartRepeatBarLine, e.tick()); segment = getSegment(Segment::SegStartRepeatBarLine, e.tick());
else { else {
setEndBarLineType(barLine->barLineType(), false, true, Qt::black); setEndBarLineType(barLine->barLineType(), false, true);
if(!barLine->customSpan()) { if(!barLine->customSpan()) {
Staff* staff = score()->staff(staffIdx); Staff* staff = score()->staff(staffIdx);
barLine->setSpan(staff->barLineSpan()); barLine->setSpan(staff->barLineSpan());
@ -2745,7 +2745,10 @@ void Measure::setEndBarLineType(BarLineType val, bool g, bool visible, QColor co
_endBarLineType = val; _endBarLineType = val;
_endBarLineGenerated = g; _endBarLineGenerated = g;
_endBarLineVisible = visible; _endBarLineVisible = visible;
_endBarLineColor = color; if(color.isValid())
_endBarLineColor = color;
else
_endBarLineColor = curColor();
} }
//--------------------------------------------------------- //---------------------------------------------------------

View file

@ -251,7 +251,7 @@ class Measure : public MeasureBase {
bool createEndBarLines(); bool createEndBarLines();
void setEndBarLineType(BarLineType val, bool g, bool visible = true, QColor color = Qt::black); void setEndBarLineType(BarLineType val, bool g, bool visible = true, QColor color = QColor());
BarLineType endBarLineType() const { return _endBarLineType; } BarLineType endBarLineType() const { return _endBarLineType; }
void setMmEndBarLineType(BarLineType v) { _mmEndBarLineType = v; } void setMmEndBarLineType(BarLineType v) { _mmEndBarLineType = v; }

View file

@ -81,7 +81,7 @@ void TextLineSegment::draw(QPainter* painter) const
color = textLine()->curColor(); color = textLine()->curColor();
normalColor = true; normalColor = true;
} }
qDebug() << "normal color" << color;
qreal l = 0.0; qreal l = 0.0;
int sym = spannerSegmentType() == SEGMENT_MIDDLE ? tl->continueSymbol() : tl->beginSymbol(); int sym = spannerSegmentType() == SEGMENT_MIDDLE ? tl->continueSymbol() : tl->beginSymbol();
if (_text) { if (_text) {
@ -110,7 +110,7 @@ void TextLineSegment::draw(QPainter* painter) const
QPen pen(normalColor ? tl->lineColor() : color, textlineLineWidth); QPen pen(normalColor ? tl->lineColor() : color, textlineLineWidth);
pen.setStyle(tl->lineStyle()); pen.setStyle(tl->lineStyle());
painter->setPen(pen); painter->setPen(pen);
qDebug() << "pen color" << pen.color();
if (spannerSegmentType() == SEGMENT_SINGLE || spannerSegmentType() == SEGMENT_END) { if (spannerSegmentType() == SEGMENT_SINGLE || spannerSegmentType() == SEGMENT_END) {
if (tl->endSymbol() != -1) { if (tl->endSymbol() != -1) {
int sym = tl->endSymbol(); int sym = tl->endSymbol();
@ -320,8 +320,8 @@ TextLine::TextLine(Score* s)
_lineStyle = Qt::SolidLine; _lineStyle = Qt::SolidLine;
_beginTextPlace = PLACE_LEFT; _beginTextPlace = PLACE_LEFT;
_continueTextPlace = PLACE_LEFT; _continueTextPlace = PLACE_LEFT;
_lineColor = Qt::black; _lineColor = curColor();
qDebug() << _lineColor;
_beginSymbol = noSym; _beginSymbol = noSym;
_continueSymbol = noSym; _continueSymbol = noSym;
_endSymbol = noSym; _endSymbol = noSym;

View file

@ -127,7 +127,7 @@ class TextLine : public SLine {
Spatium endHookHeight() const { return _endHookHeight; } Spatium endHookHeight() const { return _endHookHeight; }
Spatium lineWidth() const { return _lineWidth; } Spatium lineWidth() const { return _lineWidth; }
QColor lineColor() const { return _lineColor; } QColor lineColor() const { return (_lineColor == Qt::black)? curColor() : _lineColor; }
Qt::PenStyle lineStyle() const { return _lineStyle; } Qt::PenStyle lineStyle() const { return _lineStyle; }
void setLineWidth(const Spatium& v) { _lineWidth = v; } void setLineWidth(const Spatium& v) { _lineWidth = v; }
void setLineColor(const QColor& v) { _lineColor = v; } void setLineColor(const QColor& v) { _lineColor = v; }