Skip to content

Commit

Permalink
move textline properties to inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 7, 2017
1 parent c66f162 commit fe8a3e5
Show file tree
Hide file tree
Showing 94 changed files with 9,062 additions and 11,130 deletions.
3 changes: 1 addition & 2 deletions libmscore/element.cpp
Expand Up @@ -1217,8 +1217,7 @@ bool Element::setProperty(P_ID propertyId, const QVariant& v)
setSystemFlag(v.toBool());
break;
default:
qFatal("Element::setProperty: unknown <%s>(%d), data <%s>",
propertyName(propertyId), static_cast<int>(propertyId), qPrintable(v.toString()));
qFatal("unknown <%s>(%d), data <%s>", propertyName(propertyId), int(propertyId), qPrintable(v.toString()));
return false;
}
score()->setLayout(tick());
Expand Down
12 changes: 8 additions & 4 deletions libmscore/hairpin.cpp
Expand Up @@ -27,6 +27,14 @@ namespace Ms {

Spatium Hairpin::editHairpinHeight;

//---------------------------------------------------------
// HairpinSegment
//---------------------------------------------------------

HairpinSegment::HairpinSegment(Score* s)
: TextLineBaseSegment(s)
{
}

//---------------------------------------------------------
// lookupDynamic
Expand Down Expand Up @@ -123,10 +131,6 @@ void HairpinSegment::layout()
}
else {
twoLines = true;
delete _text;
delete _endText;
_text = 0;
_endText = 0;

QTransform t;
qreal h1 = hairpin()->hairpinHeight().val() * spatium() * .5;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/hairpin.h
Expand Up @@ -38,7 +38,7 @@ class HairpinSegment : public TextLineBaseSegment {
qreal circledTipRadius;

public:
HairpinSegment(Score* s) : TextLineBaseSegment(s) {}
HairpinSegment(Score* s);
Hairpin* hairpin() const { return (Hairpin*)spanner(); }
virtual HairpinSegment* clone() const override { return new HairpinSegment(*this); }
virtual ElementType type() const override { return ElementType::HAIRPIN_SEGMENT; }
Expand Down
21 changes: 12 additions & 9 deletions libmscore/line.cpp
Expand Up @@ -1053,15 +1053,9 @@ void SLine::writeProperties(XmlWriter& xml) const
Spanner::writeProperties(xml);
if (_diagonal)
xml.tag("diagonal", _diagonal);
if (propertyFlags(P_ID::LINE_WIDTH) != PropertyFlags::STYLED)
xml.tag("lineWidth", lineWidth().val());
if (propertyFlags(P_ID::LINE_STYLE) == PropertyFlags::UNSTYLED || (lineStyle() != Qt::SolidLine)) {
if (propertyFlags(P_ID::LINE_STYLE) != PropertyFlags::STYLED)
xml.tag("lineStyle", int(lineStyle()));
}
if (propertyFlags(P_ID::LINE_COLOR) == PropertyFlags::UNSTYLED || (lineColor() != MScore::defaultColor))
xml.tag("lineColor", lineColor());

writeProperty(xml, P_ID::LINE_WIDTH);
writeProperty(xml, P_ID::LINE_STYLE);
writeProperty(xml, P_ID::LINE_COLOR);
writeProperty(xml, P_ID::ANCHOR);
writeProperty(xml, P_ID::DASH_LINE_LEN);
writeProperty(xml, P_ID::DASH_GAP_LEN);
Expand Down Expand Up @@ -1291,5 +1285,14 @@ QVariant SLine::propertyDefault(P_ID id) const
}
}

//---------------------------------------------------------
// getPropertyStyle
//---------------------------------------------------------

StyleIdx SLine::getPropertyStyle(P_ID id) const
{
return Spanner::getPropertyStyle(id);
}

}

5 changes: 5 additions & 0 deletions libmscore/line.h
Expand Up @@ -77,6 +77,10 @@ class SLine : public Spanner {
qreal _dashGapLen { 5.0 };
bool _diagonal { false };

PropertyFlags lineWidthStyle;
PropertyFlags lineStyleStyle;
PropertyFlags lineColorStyle;

protected:
virtual QPointF linePos(Grip, System** system) const;

Expand Down Expand Up @@ -121,6 +125,7 @@ class SLine : public Spanner {
virtual QVariant getProperty(P_ID id) const override;
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
virtual QVariant propertyDefault(P_ID id) const override;
virtual StyleIdx getPropertyStyle(P_ID) const override;

friend class LineSegment;
};
Expand Down

0 comments on commit fe8a3e5

Please sign in to comment.