Merge pull request #2494 from sraduvictor/tieInspector

Show Slur or Tie instead of Slur/Tie in inspector.
This commit is contained in:
Nicolas Froment 2016-05-25 19:36:13 +02:00
commit 6b8651e560
2 changed files with 31 additions and 1 deletions

View file

@ -54,6 +54,7 @@
#include "libmscore/tuplet.h"
#include "libmscore/bend.h"
#include "libmscore/tremolobar.h"
#include "libmscore/slur.h"
namespace Ms {
@ -899,6 +900,35 @@ InspectorSlur::InspectorSlur(QWidget* parent)
e.setupUi(addWidget());
s.setupUi(addWidget());
Inspector* inspector = static_cast<Inspector*>(parent);
if (inspector != nullptr) {
Element* e = inspector->element();
bool sameType = true;
int subtype = static_cast<int>(Element::Type::INVALID);
if (e->type() == Element::Type::SLUR_SEGMENT)
subtype = static_cast<int>(static_cast<SlurSegment*>(e)->spanner()->type());
for (const auto& ee : inspector->el()) {
if (ee->type() != Element::Type::SLUR_SEGMENT) {
sameType = false;
break;
}
if (static_cast<int>(static_cast<SlurSegment*>(ee)->spanner()->type()) != subtype) {
sameType = false;
break;
}
}
if (!sameType)
s.elementName->setText("Slur/Tie");
else if (subtype == static_cast<int>(Element::Type::SLUR))
s.elementName->setText(tr("Slur"));
else if (subtype == static_cast<int>(Element::Type::TIE))
s.elementName->setText(tr("Tie"));
}
iList = {
{ P_ID::COLOR, 0, 0, e.color, e.resetColor },
{ P_ID::VISIBLE, 0, 0, e.visible, e.resetVisible },

View file

@ -41,7 +41,7 @@
</font>
</property>
<property name="text">
<string>Slur/Tie</string>
<string notr="true">Slur/Tie</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>