add method propertyDelegate() to Element

This commit is contained in:
ws 2018-07-24 15:48:24 +02:00
parent c3bad12409
commit 10d1ae0529
30 changed files with 521 additions and 757 deletions

View file

@ -1050,9 +1050,9 @@ bool Element::setProperty(Pid propertyId, const QVariant& v)
// propertyDefault
//---------------------------------------------------------
QVariant Element::propertyDefault(Pid id) const
QVariant Element::propertyDefault(Pid pid) const
{
switch(id) {
switch (pid) {
case Pid::GENERATED:
return false;
case Pid::VISIBLE:
@ -1070,7 +1070,7 @@ QVariant Element::propertyDefault(Pid id) const
case Pid::Z:
return int(type()) * 100;
default:
return ScoreElement::propertyDefault(id);
return ScoreElement::propertyDefault(pid);
}
}

View file

@ -407,6 +407,7 @@ class Element : public ScoreElement {
virtual QVariant getProperty(Pid) const override;
virtual bool setProperty(Pid, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual Element* propertyDelegate(Pid) { return 0; } // return Spanner for SpannerSegment for some properties
bool custom(Pid) const;
virtual bool isUserModified() const;

View file

@ -186,9 +186,6 @@ Page* Fermata::page() const
void Fermata::layout()
{
QRectF b(symBbox(_symId));
setbbox(b.translated(-0.5 * b.width(), 0.0));
Segment* s = segment();
if (!s) { // for use in palette
setPos(QPointF());
@ -197,10 +194,10 @@ void Fermata::layout()
qreal x = 0.0;
Element* e = s->element(track());
if (e && !e->isChord())
x = e->x() + e->width() * staff()->mag(0) * .5;
else
if (e && e->isChord())
x = score()->noteHeadWidth() * staff()->mag(0) * .5;
else
x = e->x() + e->width() * staff()->mag(0) * .5;
qreal y = placeAbove() ? styleP(Sid::fermataPosAbove) : styleP(Sid::fermataPosBelow) + staff()->height();
setPos(QPointF(x, y));
@ -209,19 +206,15 @@ void Fermata::layout()
QString name = Sym::id2name(_symId);
if (placeAbove()) {
if (name.endsWith("Below")) {
if (name.endsWith("Below"))
_symId = Sym::name2id(name.left(name.size() - 5) + "Above");
QRectF b(symBbox(_symId));
setbbox(b.translated(-0.5 * b.width(), 0.0));
}
}
else {
if (name.endsWith("Above")) {
if (name.endsWith("Above"))
_symId = Sym::name2id(name.left(name.size() - 5) + "Below");
QRectF b(symBbox(_symId));
setbbox(b.translated(-0.5 * b.width(), 0.0));
}
}
QRectF b(symBbox(_symId));
setbbox(b.translated(-0.5 * b.width(), 0.0));
autoplaceSegmentElement(styleP(Sid::fermataMinDistance));
}

View file

@ -119,13 +119,12 @@ void GlissandoSegment::draw(QPainter* painter) const
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant GlissandoSegment::getProperty(Pid id) const
Element* GlissandoSegment::propertyDelegate(Pid pid)
{
switch (id) {
// route properties of the whole Glissando element to it
switch (pid) {
case Pid::GLISS_TYPE:
case Pid::GLISS_TEXT:
case Pid::GLISS_SHOW_TEXT:
@ -137,119 +136,9 @@ QVariant GlissandoSegment::getProperty(Pid id) const
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
return glissando()->getProperty(id);
return glissando();
default:
return LineSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool GlissandoSegment::setProperty(Pid id, const QVariant& v)
{
switch (id) {
case Pid::GLISS_TYPE:
case Pid::GLISS_TEXT:
case Pid::GLISS_SHOW_TEXT:
case Pid::GLISSANDO_STYLE:
case Pid::PLAY:
case Pid::FONT_FACE:
case Pid::FONT_SIZE:
case Pid::FONT_BOLD:
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
return glissando()->setProperty(id, v);
default:
return LineSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant GlissandoSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::GLISS_TYPE:
case Pid::GLISS_TEXT:
case Pid::GLISS_SHOW_TEXT:
case Pid::GLISSANDO_STYLE:
case Pid::PLAY:
case Pid::FONT_FACE:
case Pid::FONT_SIZE:
case Pid::FONT_BOLD:
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
return glissando()->propertyDefault(id);
default:
return LineSegment::propertyDefault(id);
}
}
//---------------------------------------------------------
// propertyFlags
//---------------------------------------------------------
PropertyFlags GlissandoSegment::propertyFlags(Pid id) const
{
switch (id) {
case Pid::FONT_FACE:
case Pid::FONT_SIZE:
case Pid::FONT_BOLD:
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
return glissando()->propertyFlags(id);
default:
return LineSegment::propertyFlags(id);
}
}
//---------------------------------------------------------
// setPropertyFlags
//---------------------------------------------------------
void GlissandoSegment::setPropertyFlags(Pid id, PropertyFlags f)
{
switch (id) {
case Pid::FONT_FACE:
case Pid::FONT_SIZE:
case Pid::FONT_BOLD:
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
glissando()->setPropertyFlags(id, f);
break;
default:
LineSegment::setPropertyFlags(id, f);
break;
}
}
//---------------------------------------------------------
// getPropertyStyle
//---------------------------------------------------------
Sid GlissandoSegment::getPropertyStyle(Pid id) const
{
switch (id) {
case Pid::FONT_FACE:
case Pid::FONT_SIZE:
case Pid::FONT_BOLD:
case Pid::FONT_ITALIC:
case Pid::FONT_UNDERLINE:
case Pid::LINE_WIDTH:
return glissando()->getPropertyStyle(id);
default:
return LineSegment::getPropertyStyle(id);
return LineSegment::propertyDelegate(pid);
}
}

View file

@ -39,12 +39,7 @@ class GlissandoSegment final : public LineSegment {
virtual void draw(QPainter*) const override;
virtual void layout() override;
virtual QVariant getProperty(Pid id) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid id) const override;
virtual PropertyFlags propertyFlags(Pid) const override;
virtual void setPropertyFlags(Pid id, PropertyFlags f) override;
virtual Sid getPropertyStyle(Pid) const override;
virtual Element* propertyDelegate(Pid) override;
};
//---------------------------------------------------------

View file

@ -374,66 +374,14 @@ void HairpinSegment::draw(QPainter* painter) const
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant HairpinSegment::getProperty(Pid id) const
Element* HairpinSegment::propertyDelegate(Pid pid)
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->getProperty(id);
}
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->getProperty(id);
default:
return TextLineBaseSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool HairpinSegment::setProperty(Pid id, const QVariant& v)
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->setProperty(id, v);
}
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->setProperty(id, v);
default:
return TextLineBaseSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant HairpinSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->propertyDefault(id);
default:
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->propertyDefault(id);
}
return TextLineBaseSegment::propertyDefault(id);
}
if (pid == Pid::HAIRPIN_TYPE || pid == Pid::VELO_CHANGE || pid == Pid::HAIRPIN_CIRCLEDTIP || pid == Pid::DYNAMIC_RANGE)
return spanner();
return TextLineBaseSegment::propertyDelegate(pid);
}
//---------------------------------------------------------

View file

@ -55,9 +55,7 @@ class HairpinSegment final : public TextLineBaseSegment {
Hairpin* hairpin() const { return (Hairpin*)spanner(); }
virtual QVariant getProperty(Pid) const override;
virtual bool setProperty(Pid, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual Element* propertyDelegate(Pid) override;
virtual void layout() override;
virtual Shape shape() const override;

View file

@ -406,60 +406,19 @@ void LineSegment::localSpatiumChanged(qreal ov, qreal nv)
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant LineSegment::getProperty(Pid id) const
Element* LineSegment::propertyDelegate(Pid pid)
{
switch (id) {
case Pid::DIAGONAL:
case Pid::LINE_COLOR:
case Pid::LINE_WIDTH:
case Pid::LINE_STYLE:
case Pid::DASH_LINE_LEN:
case Pid::DASH_GAP_LEN:
return line()->getProperty(id);
default:
return SpannerSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool LineSegment::setProperty(Pid id, const QVariant& val)
{
switch (id) {
case Pid::DIAGONAL:
case Pid::LINE_COLOR:
case Pid::LINE_WIDTH:
case Pid::LINE_STYLE:
case Pid::DASH_LINE_LEN:
case Pid::DASH_GAP_LEN:
return line()->setProperty(id, val);
default:
return SpannerSegment::setProperty(id, val);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant LineSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::DIAGONAL:
case Pid::LINE_COLOR:
case Pid::LINE_WIDTH:
case Pid::LINE_STYLE:
case Pid::DASH_LINE_LEN:
case Pid::DASH_GAP_LEN:
return line()->propertyDefault(id);
default:
return SpannerSegment::propertyDefault(id);
}
if (pid == Pid::DIAGONAL
|| pid == Pid::LINE_COLOR
|| pid == Pid::LINE_WIDTH
|| pid == Pid::LINE_STYLE
|| pid == Pid::DASH_LINE_LEN
|| pid == Pid::DASH_GAP_LEN)
return spanner();
return SpannerSegment::propertyDelegate(pid);
}
//---------------------------------------------------------

View file

@ -52,9 +52,8 @@ class LineSegment : public SpannerSegment {
virtual void read(XmlReader&) override;
bool readProperties(XmlReader&);
virtual QVariant getProperty(Pid id) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid id) const override;
virtual Element* propertyDelegate(Pid) override;
virtual QLineF dragAnchor() const override;
};

View file

@ -19,29 +19,6 @@ namespace Ms {
class Note;
#if 0
//---------------------------------------------------------
// @@ TextLineSegment
//---------------------------------------------------------
class TextLineSegment : public TextLineBaseSegment {
protected:
public:
TextLineSegment(Score* s) : TextLineBaseSegment(s) { }
virtual ElementType type() const override { return ElementType::TEXTLINE_SEGMENT; }
virtual TextLineSegment* clone() const override { return new TextLineSegment(*this); }
TextLine* textLine() const { return (TextLine*)spanner(); }
virtual void layout() override;
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual PropertyStyle propertyStyle(Pid) const override;
virtual void resetProperty(Pid id) override;
virtual void styleChanged() override;
};
#endif
//---------------------------------------------------------
// @@ NoteLine
//---------------------------------------------------------

View file

@ -81,60 +81,14 @@ void OttavaSegment::layout()
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant OttavaSegment::getProperty(Pid id) const
Element* OttavaSegment::propertyDelegate(Pid pid)
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->getProperty(id);
}
switch (id) {
case Pid::OTTAVA_TYPE:
case Pid::NUMBERS_ONLY:
return spanner()->getProperty(id);
default:
return TextLineBaseSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool OttavaSegment::setProperty(Pid id, const QVariant& v)
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->setProperty(id, v);
}
switch (id) {
case Pid::OTTAVA_TYPE:
case Pid::NUMBERS_ONLY:
return spanner()->setProperty(id, v);
default:
return TextLineBaseSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant OttavaSegment::propertyDefault(Pid id) const
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->propertyDefault(id);
}
switch (id) {
case Pid::OTTAVA_TYPE:
case Pid::NUMBERS_ONLY:
return spanner()->propertyDefault(id);
default:
return TextLineBaseSegment::propertyDefault(id);
}
if (pid == Pid::OTTAVA_TYPE || pid == Pid::NUMBERS_ONLY)
return spanner();
return TextLineBaseSegment::propertyDelegate(pid);
}
//---------------------------------------------------------
@ -415,9 +369,9 @@ bool Ottava::setProperty(Pid propertyId, const QVariant& val)
// propertyDefault
//---------------------------------------------------------
QVariant Ottava::propertyDefault(Pid propertyId) const
QVariant Ottava::propertyDefault(Pid pid) const
{
switch (propertyId) {
switch (pid) {
case Pid::OTTAVA_TYPE:
return QVariant();
case Pid::END_HOOK_TYPE:
@ -425,11 +379,10 @@ QVariant Ottava::propertyDefault(Pid propertyId) const
case Pid::LINE_VISIBLE:
return true;
default:
QVariant v = ScoreElement::styledPropertyDefault(propertyId);
QVariant v = ScoreElement::styledPropertyDefault(pid);
if (v.isValid())
return v;
return getProperty(propertyId);
return getProperty(pid);
}
}

View file

@ -56,9 +56,7 @@ class OttavaSegment final : public TextLineBaseSegment {
virtual OttavaSegment* clone() const override { return new OttavaSegment(*this); }
Ottava* ottava() const { return (Ottava*)spanner(); }
virtual void layout() override;
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual Element* propertyDelegate(Pid) override;
};
//---------------------------------------------------------

View file

@ -179,14 +179,14 @@ void ScoreElement::setSubStyleId(SubStyleId ssid)
// propertyDefault
//---------------------------------------------------------
QVariant ScoreElement::propertyDefault(Pid id) const
QVariant ScoreElement::propertyDefault(Pid pid) const
{
if (id == Pid::SUB_STYLE)
if (pid == Pid::SUB_STYLE)
return int(SubStyleId::DEFAULT);
// this is wrong, styled properties should be considered first:
QVariant v = styledPropertyDefault(id);
QVariant v = styledPropertyDefault(pid);
if (!v.isValid()) {
qDebug("<%s>(%d) not found in <%s> style <%s>", propertyName(id), int(id), name(), subStyleName(subStyleId()));
qDebug("<%s>(%d) not found in <%s> style <%s>", propertyName(pid), int(pid), name(), subStyleName(subStyleId()));
}
return v;
}
@ -271,11 +271,6 @@ bool ScoreElement::isStyled(Pid pid) const
static void changeProperty(ScoreElement* e, Pid t, const QVariant& st, PropertyFlags ps)
{
if (e->isSpannerSegment()) {
QVariant v = e->getProperty(t);
if (!v.isValid())
e = toSpannerSegment(e)->spanner();
}
if (e->getProperty(t) != st || e->propertyFlags(t) != ps) {
if (e->isBracketItem()) {
BracketItem* bi = toBracketItem(e);

View file

@ -32,7 +32,7 @@ class SlurSegment final : public SlurTieSegment {
SlurSegment(const SlurSegment& ss) : SlurTieSegment(ss) {}
virtual SlurSegment* clone() const override { return new SlurSegment(*this); }
virtual ElementType type() const override { return ElementType::SLUR_SEGMENT; }
virtual ElementType type() const override { return ElementType::SLUR_SEGMENT; }
virtual int subtype() const override { return static_cast<int>(spanner()->type()); }
virtual QString subtypeName() const override { return name(spanner()->type()); }
virtual void draw(QPainter*) const override;

View file

@ -65,20 +65,30 @@ void SpannerSegment::setSystem(System* s)
}
}
//---------------------------------------------------------
// propertyDelegate
//---------------------------------------------------------
Element* SpannerSegment::propertyDelegate(Pid pid)
{
if (pid == Pid::COLOR || pid == Pid::VISIBLE)
return spanner();
return 0;
}
//---------------------------------------------------------
// getProperty
//---------------------------------------------------------
QVariant SpannerSegment::getProperty(Pid id) const
QVariant SpannerSegment::getProperty(Pid pid) const
{
switch (id) {
case Pid::COLOR:
case Pid::VISIBLE:
return spanner()->getProperty(id);
if (Element* e = const_cast<SpannerSegment*>(this)->propertyDelegate(pid))
return e->getProperty(pid);
switch (pid) {
case Pid::USER_OFF2:
return _userOff2;
default:
return Element::getProperty(id);
return Element::getProperty(pid);
}
}
@ -86,18 +96,17 @@ QVariant SpannerSegment::getProperty(Pid id) const
// setProperty
//---------------------------------------------------------
bool SpannerSegment::setProperty(Pid id, const QVariant& v)
bool SpannerSegment::setProperty(Pid pid, const QVariant& v)
{
switch (id) {
case Pid::COLOR:
case Pid::VISIBLE:
return spanner()->setProperty(id, v);
if (Element* e = propertyDelegate(pid))
return e->setProperty(pid, v);
switch (pid) {
case Pid::USER_OFF2:
_userOff2 = v.toPointF();
score()->setLayoutAll();
break;
default:
return Element::setProperty(id, v);
return Element::setProperty(pid, v);
}
return true;
}
@ -106,16 +115,15 @@ bool SpannerSegment::setProperty(Pid id, const QVariant& v)
// propertyDefault
//---------------------------------------------------------
QVariant SpannerSegment::propertyDefault(Pid id) const
QVariant SpannerSegment::propertyDefault(Pid pid) const
{
switch (id) {
case Pid::COLOR:
case Pid::VISIBLE:
return spanner()->propertyDefault(id);
if (Element* e = const_cast<SpannerSegment*>(this)->propertyDelegate(pid))
return e->propertyDefault(pid);
switch (pid) {
case Pid::USER_OFF2:
return QVariant();
default:
return Element::propertyDefault(id);
return Element::propertyDefault(pid);
}
}
@ -123,31 +131,33 @@ QVariant SpannerSegment::propertyDefault(Pid id) const
// getPropertyStyle
//---------------------------------------------------------
Sid SpannerSegment::getPropertyStyle(Pid id) const
Sid SpannerSegment::getPropertyStyle(Pid pid) const
{
return spanner()->getPropertyStyle(id);
if (Element* e = const_cast<SpannerSegment*>(this)->propertyDelegate(pid))
return e->getPropertyStyle(pid);
return Element::getPropertyStyle(pid);
}
//---------------------------------------------------------
// propertyFlags
//---------------------------------------------------------
PropertyFlags SpannerSegment::propertyFlags(Pid id) const
PropertyFlags SpannerSegment::propertyFlags(Pid pid) const
{
return spanner()->propertyFlags(id);
if (Element* e = const_cast<SpannerSegment*>(this)->propertyDelegate(pid))
return e->propertyFlags(pid);
return Element::propertyFlags(pid);
}
//---------------------------------------------------------
// resetProperty
//---------------------------------------------------------
void SpannerSegment::resetProperty(Pid id)
void SpannerSegment::resetProperty(Pid pid)
{
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->resetProperty(id);
}
return Element::resetProperty(id);
if (Element* e = propertyDelegate(pid))
return e->resetProperty(pid);
return Element::resetProperty(pid);
}
//---------------------------------------------------------

View file

@ -92,6 +92,8 @@ class SpannerSegment : public Element {
virtual QVariant getProperty(Pid id) const override;
virtual bool setProperty(Pid id, const QVariant& v) override;
virtual QVariant propertyDefault(Pid id) const override;
virtual Element* propertyDelegate(Pid) override;
virtual Sid getPropertyStyle(Pid id) const override;
virtual PropertyFlags propertyFlags(Pid id) const override;
virtual void resetProperty(Pid id) override;

View file

@ -1282,8 +1282,10 @@ QVariant Staff::getProperty(Pid id) const
return barLineTo();
case Pid::STAFF_USERDIST:
return userDist();
case Pid::GENERATED:
return false;
default:
qDebug("unhandled id %s", propertyName(id));
qDebug("unhandled id <%s>", propertyName(id));
return QVariant();
}
}
@ -1332,7 +1334,7 @@ bool Staff::setProperty(Pid id, const QVariant& v)
setUserDist(v.toReal());
break;
default:
qDebug("unhandled id %s", propertyName(id));
qDebug("unhandled id <%s>", propertyName(id));
break;
}
score()->setLayoutAll();
@ -1365,7 +1367,7 @@ QVariant Staff::propertyDefault(Pid id) const
case Pid::STAFF_USERDIST:
return qreal(0.0);
default:
qDebug("unhandled id %s", propertyName(id));
qDebug("unhandled id <%s>", propertyName(id));
return QVariant();
}
}

View file

@ -322,10 +322,6 @@ void TextLineBaseSegment::spatiumChanged(qreal ov, qreal nv)
_endText->spatiumChanged(ov, nv);
}
//---------------------------------------------------------
// pids
//---------------------------------------------------------
static constexpr std::array<Pid, 34> pids = { {
Pid::LINE_WIDTH,
Pid::LINE_VISIBLE,
@ -364,42 +360,16 @@ static constexpr std::array<Pid, 34> pids = { {
} };
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant TextLineBaseSegment::getProperty(Pid id) const
Element* TextLineBaseSegment::propertyDelegate(Pid pid)
{
for (Pid pid : pids) {
for (Pid id : pids) {
if (pid == id)
return textLineBase()->getProperty(id);
return spanner();
}
return LineSegment::getProperty(id);
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool TextLineBaseSegment::setProperty(Pid id, const QVariant& v)
{
for (Pid pid : pids) {
if (pid == id)
return textLineBase()->setProperty(id, v);
}
return LineSegment::setProperty(id, v);
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant TextLineBaseSegment::propertyDefault(Pid id) const
{
for (Pid pid : pids) {
if (pid == id)
return textLineBase()->propertyDefault(id);
}
return LineSegment::propertyDefault(id);
return LineSegment::propertyDelegate(pid);
}
//---------------------------------------------------------
@ -671,11 +641,11 @@ bool TextLineBase::setProperty(Pid id, const QVariant& v)
// propertyDefault
//---------------------------------------------------------
QVariant TextLineBase::propertyDefault(Pid id) const
QVariant TextLineBase::propertyDefault(Pid pid) const
{
QVariant v = styledPropertyDefault(id);
QVariant v = styledPropertyDefault(pid);
if (!v.isValid())
v = SLine::propertyDefault(id);
v = SLine::propertyDefault(pid);
return v;
}

View file

@ -49,9 +49,8 @@ class TextLineBaseSegment : public LineSegment {
virtual void spatiumChanged(qreal /*oldValue*/, qreal /*newValue*/) override;
virtual QVariant getProperty(Pid id) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid id) const override;
virtual Element* propertyDelegate(Pid) override;
virtual Shape shape() const override;
};

View file

@ -218,54 +218,14 @@ Element* TrillSegment::drop(EditData& data)
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant TrillSegment::getProperty(Pid id) const
Element* TrillSegment::propertyDelegate(Pid pid)
{
switch (id) {
case Pid::TRILL_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return trill()->getProperty(id);
default:
return LineSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool TrillSegment::setProperty(Pid id, const QVariant& v)
{
switch (id) {
case Pid::TRILL_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return trill()->setProperty(id, v);
default:
return LineSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant TrillSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::TRILL_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return trill()->propertyDefault(id);
default:
return LineSegment::propertyDefault(id);
}
if (pid == Pid::TRILL_TYPE || pid == Pid::ORNAMENT_STYLE || pid == Pid::PLACEMENT || pid == Pid::PLAY)
return spanner();
return LineSegment::propertyDelegate(pid);
}
//---------------------------------------------------------

View file

@ -40,9 +40,9 @@ class TrillSegment final : public LineSegment {
virtual bool acceptDrop(EditData&) const override;
virtual Element* drop(EditData&) override;
virtual void layout() override;
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual Element* propertyDelegate(Pid) override;
virtual void add(Element*) override;
virtual void remove(Element*) override;
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all) override;

View file

@ -151,54 +151,14 @@ Shape VibratoSegment::shape() const
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant VibratoSegment::getProperty(Pid id) const
Element* VibratoSegment::propertyDelegate(Pid pid)
{
switch (id) {
case Pid::VIBRATO_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return vibrato()->getProperty(id);
default:
return LineSegment::getProperty(id);
}
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool VibratoSegment::setProperty(Pid id, const QVariant& v)
{
switch (id) {
case Pid::VIBRATO_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return vibrato()->setProperty(id, v);
default:
return LineSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant VibratoSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::VIBRATO_TYPE:
case Pid::ORNAMENT_STYLE:
case Pid::PLACEMENT:
case Pid::PLAY:
return vibrato()->propertyDefault(id);
default:
return LineSegment::propertyDefault(id);
}
if (pid == Pid::VIBRATO_TYPE || pid == Pid::ORNAMENT_STYLE || pid == Pid::PLACEMENT || pid == Pid::PLAY)
return spanner();
return LineSegment::propertyDelegate(pid);
}
//---------------------------------------------------------

View file

@ -38,11 +38,10 @@ class VibratoSegment final : public LineSegment {
virtual VibratoSegment* clone() const override { return new VibratoSegment(*this); }
virtual void draw(QPainter*) const override;
virtual void layout() override;
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
Shape shape() const override;
virtual Element* propertyDelegate(Pid) override;
Shape shape() const override;
std::vector<SymId> symbols() const { return _symbols; }
void setSymbols(const std::vector<SymId>& s) { _symbols = s; }
};

View file

@ -41,66 +41,14 @@ void VoltaSegment::layout()
}
//---------------------------------------------------------
// getProperty
// propertyDelegate
//---------------------------------------------------------
QVariant VoltaSegment::getProperty(Pid id) const
Element* VoltaSegment::propertyDelegate(Pid pid)
{
switch (id) {
case Pid::BEGIN_HOOK_TYPE:
case Pid::END_HOOK_TYPE:
case Pid::VOLTA_ENDING:
return spanner()->getProperty(id);
default:
break;
}
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->getProperty(id);
}
return TextLineBaseSegment::getProperty(id);
}
//---------------------------------------------------------
// setProperty
//---------------------------------------------------------
bool VoltaSegment::setProperty(Pid id, const QVariant& v)
{
switch (id) {
case Pid::BEGIN_HOOK_TYPE:
case Pid::END_HOOK_TYPE:
case Pid::VOLTA_ENDING:
return spanner()->setProperty(id, v);
default:
break;
}
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->setProperty(id, v);
}
return TextLineBaseSegment::setProperty(id, v);
}
//---------------------------------------------------------
// propertyDefault
//---------------------------------------------------------
QVariant VoltaSegment::propertyDefault(Pid id) const
{
switch (id) {
case Pid::BEGIN_HOOK_TYPE:
case Pid::END_HOOK_TYPE:
case Pid::VOLTA_ENDING:
return volta()->propertyDefault(id);
default:
break;
}
for (const StyledProperty* spp = spanner()->styledProperties(); spp->sid != Sid::NOSTYLE; ++spp) {
if (spp->pid == id)
return spanner()->propertyDefault(id);
}
return TextLineBaseSegment::propertyDefault(id);
if (pid == Pid::BEGIN_HOOK_TYPE || pid == Pid::END_HOOK_TYPE || pid == Pid::VOLTA_ENDING)
return spanner();
return TextLineBaseSegment::propertyDelegate(pid);
}
//---------------------------------------------------------

View file

@ -37,9 +37,7 @@ class VoltaSegment final : public TextLineBaseSegment {
Volta* volta() const { return (Volta*)spanner(); }
virtual void layout() override;
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
virtual Element* propertyDelegate(Pid) override;
};
//---------------------------------------------------------

View file

@ -136,12 +136,12 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::minMeasureWidth, false, minMeasureWidth_2, resetMinMeasureWidth },
{ Sid::measureSpacing, false, measureSpacing, resetMeasureSpacing },
{ Sid::barWidth, false, barWidth, 0 },
{ Sid::endBarWidth, false, endBarWidth, 0 },
{ Sid::endBarDistance, false, endBarDistance, 0 },
{ Sid::doubleBarWidth, false, doubleBarWidth, 0 },
{ Sid::doubleBarDistance, false, doubleBarDistance, 0 },
{ Sid::repeatBarlineDotSeparation, false, repeatBarlineDotSeparation, 0 },
{ Sid::barWidth, false, barWidth, resetBarWidth },
{ Sid::endBarWidth, false, endBarWidth, resetEndBarWidth },
{ Sid::endBarDistance, false, endBarDistance, resetEndBarDistance },
{ Sid::doubleBarWidth, false, doubleBarWidth, resetDoubleBarWidth },
{ Sid::doubleBarDistance, false, doubleBarDistance, resetDoubleBarDistance },
{ Sid::repeatBarlineDotSeparation, false, repeatBarlineDotSeparation, resetRepeatBarlineDotSeparation },
{ Sid::barGraceDistance, false, barGraceDistance, resetBarGraceDistance },
{ Sid::useStandardNoteNames, false, useStandardNoteNames, 0 },
@ -264,16 +264,16 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::tupletNumberType, false, tupletNumberType, resetTupletNumberType },
{ Sid::tupletBracketType, false, tupletBracketType, resetTupletBracketType },
{ Sid::tupletMaxSlope, false, tupletMaxSlope, resetTupletMaxSlope },
{ Sid::tupletOufOfStaff, false, tupletOutOfStaff, 0 },
{ Sid::tupletOufOfStaff, false, tupletOutOfStaff, 0 },
{ Sid::tupletFontFace, false, tupletFontFace, resetTupletFontFace },
{ Sid::tupletFontSize, false, tupletFontSize, resetTupletFontSize },
{ Sid::tupletFontBold, false, tupletFontBold, resetTupletFontBold },
{ Sid::tupletFontItalic, false, tupletFontItalic, resetTupletFontItalic },
{ Sid::tupletFontUnderline, false, tupletFontUnderline, resetTupletFontUnderline },
{ Sid::repeatBarTips, false, showRepeatBarTips, 0 },
{ Sid::startBarlineSingle, false, showStartBarlineSingle, 0 },
{ Sid::startBarlineMultiple, false, showStartBarlineMultiple, 0 },
{ Sid::repeatBarTips, false, showRepeatBarTips, resetShowRepeatBarTips },
{ Sid::startBarlineSingle, false, showStartBarlineSingle, resetShowStartBarlineSingle },
{ Sid::startBarlineMultiple, false, showStartBarlineMultiple, resetShowStartBarlineMultiple },
{ Sid::dividerLeftSym, false, dividerLeftSym, 0 },
{ Sid::dividerRightSym, false, dividerRightSym, 0 },
@ -356,7 +356,7 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::fretY, false, fretY, 0 },
{ Sid::barreLineWidth, false, barreLineWidth, 0 },
{ Sid::fretMag, false, fretMag, 0 },
{ Sid::scaleBarlines, false, scaleBarlines, 0 },
{ Sid::scaleBarlines, false, scaleBarlines, resetScaleBarlines},
{ Sid::crossMeasureValues, false, crossMeasureValues, 0 },
{ Sid::MusicalSymbolFont, false, musicalSymbolFont, 0 },

View file

@ -13,8 +13,8 @@
<property name="windowTitle">
<string>Edit General Style</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_43">
<item>
<layout class="QGridLayout" name="gridLayout_39">
<item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -23,6 +23,9 @@
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="spacing">
<number>2</number>
</property>
<item>
<property name="text">
<string>Score</string>
@ -191,7 +194,7 @@
</widget>
<widget class="QStackedWidget" name="pageStack">
<property name="currentIndex">
<number>31</number>
<number>6</number>
</property>
<widget class="QWidget" name="PageScore">
<layout class="QVBoxLayout" name="verticalLayout_20">
@ -4265,39 +4268,122 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_26">
<item>
<layout class="QVBoxLayout" name="verticalLayout_25">
<item>
<widget class="QCheckBox" name="showRepeatBarTips">
<property name="text">
<string>Show repeat barline tips (&quot;winged&quot; repeats)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showStartBarlineSingle">
<property name="text">
<string>Barline at start of single staff</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showStartBarlineMultiple">
<property name="text">
<string>Barline at start of multiple staves</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="scaleBarlines">
<property name="text">
<string>Scale barlines to staff size</string>
</property>
</widget>
</item>
</layout>
<widget class="QGroupBox" name="groupBox">
<layout class="QGridLayout" name="gridLayout_40">
<item row="2" column="0">
<widget class="QCheckBox" name="showStartBarlineMultiple">
<property name="text">
<string>Barline at start of multiple staves</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="scaleBarlines">
<property name="text">
<string>Scale barlines to staff size</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="showRepeatBarTips">
<property name="text">
<string>Show repeat barline tips (&quot;winged&quot; repeats)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="resetShowRepeatBarTips">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="showStartBarlineSingle">
<property name="text">
<string>Barline at start of single staff</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_48">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="resetShowStartBarlineSingle">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QToolButton" name="resetShowStartBarlineMultiple">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QToolButton" name="resetScaleBarlines">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
@ -4319,131 +4405,227 @@
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_82">
<property name="text">
<string>Thin barline thickness:</string>
</property>
<property name="buddy">
<cstring>barWidth</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="barWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_83">
<property name="text">
<string>Thick barline thickness:</string>
</property>
<property name="buddy">
<cstring>endBarWidth</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="endBarWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_84">
<property name="text">
<string>Thick barline distance:</string>
</property>
<property name="buddy">
<cstring>endBarDistance</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="endBarDistance">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_85">
<property name="text">
<string>Double barline thickness:</string>
</property>
<property name="buddy">
<cstring>doubleBarWidth</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleBarWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_86">
<property name="text">
<string>Double barline distance:</string>
</property>
<property name="buddy">
<cstring>doubleBarDistance</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleBarDistance">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="repeatBarlineDotSeparationLbl">
<property name="text">
<string>Repeat barline dots distance:</string>
</property>
<property name="buddy">
<cstring>repeatBarlineDotSeparation</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="repeatBarlineDotSeparation">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
</layout>
<widget class="QGroupBox" name="groupBox">
<layout class="QGridLayout" name="gridLayout_37">
<item row="2" column="0">
<widget class="QLabel" name="label_84">
<property name="text">
<string>Thick barline distance:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_85">
<property name="text">
<string>Double barline thickness:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="endBarWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_83">
<property name="text">
<string>Thick barline thickness:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_82">
<property name="text">
<string>Thin barline thickness:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="endBarDistance">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleBarDistance">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="resetBarWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="barWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="repeatBarlineDotSeparation">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="repeatBarlineDotSeparationLbl">
<property name="text">
<string>Repeat barline dots distance:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleBarWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_86">
<property name="text">
<string>Double barline distance:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_47">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="resetEndBarWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="resetEndBarDistance">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QToolButton" name="resetDoubleBarWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="resetDoubleBarDistance">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QToolButton" name="resetRepeatBarlineDotSeparation">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Always force dash' setting</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_12">
@ -11838,7 +12020,7 @@
</widget>
</widget>
</item>
<item>
<item row="1" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>

View file

@ -353,6 +353,9 @@ void InspectorBase::valueChanged(int idx, bool reset)
for (int i = 0; i < ii.parent; ++i)
e = e->parent();
if (Element* ee = e->propertyDelegate(id))
e = ee;
// reset sets property style UNSTYLED to STYLED
PropertyFlags ps = e->propertyFlags(id);

View file

@ -16,6 +16,7 @@
#include "musescore.h"
#include "libmscore/ottava.h"
#include "libmscore/score.h"
#include "icons.h"
namespace Ms {
@ -32,13 +33,13 @@ InspectorOttava::InspectorOttava(QWidget* parent)
o.setupUi(addWidget());
const std::vector<InspectorItem> il = {
{ Pid::DIAGONAL, 0, l.diagonal, l.resetDiagonal },
{ Pid::LINE_VISIBLE, 0, l.lineVisible, l.resetLineVisible },
{ Pid::LINE_COLOR, 0, l.lineColor, l.resetLineColor },
{ Pid::LINE_WIDTH, 0, l.lineWidth, l.resetLineWidth },
{ Pid::LINE_STYLE, 0, l.lineStyle, l.resetLineStyle },
{ Pid::DASH_LINE_LEN, 0, l.dashLineLength, l.resetDashLineLength },
{ Pid::DASH_GAP_LEN, 0, l.dashGapLength, l.resetDashGapLength },
{ Pid::DIAGONAL, 0, l.diagonal, l.resetDiagonal },
{ Pid::LINE_VISIBLE, 0, l.lineVisible, l.resetLineVisible },
{ Pid::LINE_COLOR, 0, l.lineColor, l.resetLineColor },
{ Pid::LINE_WIDTH, 0, l.lineWidth, l.resetLineWidth },
{ Pid::LINE_STYLE, 0, l.lineStyle, l.resetLineStyle },
{ Pid::DASH_LINE_LEN, 0, l.dashLineLength, l.resetDashLineLength },
{ Pid::DASH_GAP_LEN, 0, l.dashGapLength, l.resetDashGapLength },
{ Pid::BEGIN_TEXT, 0, tl.beginText, tl.resetBeginText },
{ Pid::BEGIN_TEXT_PLACE, 0, tl.beginTextPlacement, tl.resetBeginTextPlacement },
@ -71,9 +72,9 @@ InspectorOttava::InspectorOttava(QWidget* parent)
{ Pid::END_HOOK_TYPE, 0, tl.endHookType, tl.resetEndHookType },
{ Pid::END_HOOK_HEIGHT, 0, tl.endHookHeight, tl.resetEndHookHeight },
{ Pid::OTTAVA_TYPE, 0, o.ottavaType, 0 },
{ Pid::PLACEMENT, 0, o.placement, o.resetPlacement },
{ Pid::NUMBERS_ONLY, 0, o.numbersOnly, o.resetNumbersOnly }
{ Pid::OTTAVA_TYPE, 0, o.ottavaType, 0 },
{ Pid::PLACEMENT, 0, o.placement, o.resetPlacement },
{ Pid::NUMBERS_ONLY, 0, o.numbersOnly, o.resetNumbersOnly }
};
const std::vector<InspectorPanel> ppList = {
{ l.title, l.panel },
@ -81,6 +82,18 @@ InspectorOttava::InspectorOttava(QWidget* parent)
{ o.title, o.panel }
};
tl.beginFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.beginFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.beginFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
tl.continueFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.continueFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.continueFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
tl.endFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.endFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.endFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
populateHookType(tl.beginHookType);
populateHookType(tl.endHookType);
populateTextPlace(tl.beginTextPlacement);

View file

@ -16,6 +16,7 @@
#include "musescore.h"
#include "libmscore/volta.h"
#include "libmscore/score.h"
#include "icons.h"
namespace Ms {
@ -78,6 +79,18 @@ InspectorVolta::InspectorVolta(QWidget* parent)
{ tl.title, tl.panel },
{ v.title, v.panel }
};
tl.beginFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.beginFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.beginFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
tl.continueFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.continueFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.continueFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
tl.endFontBold->setIcon(*icons[int(Icons::textBold_ICON)]);
tl.endFontUnderline->setIcon(*icons[int(Icons::textUnderline_ICON)]);
tl.endFontItalic->setIcon(*icons[int(Icons::textItalic_ICON)]);
populateHookType(tl.beginHookType);
populateHookType(tl.endHookType);
populateTextPlace(tl.beginTextPlacement);