addressing @lasconic's concerns
This commit is contained in:
parent
ed1cc8c7c4
commit
a8549b5e09
9 changed files with 32 additions and 32 deletions
|
@ -215,7 +215,7 @@ bool AccidentalState::tieContext(int line) const
|
|||
void AccidentalState::setAccidentalVal(int line, AccidentalVal val, bool tieContext)
|
||||
{
|
||||
Q_ASSERT(line >= 0 && line < 75);
|
||||
// casts needed to work around a bug in Xcode 4.2 on Mac
|
||||
// casts needed to work around a bug in Xcode 4.2 on Mac, see #25910
|
||||
Q_ASSERT(int(val) >= int(AccidentalVal::FLAT2) && int(val) <= int(AccidentalVal::SHARP2));
|
||||
state[line] = (int(val) + 2) | (tieContext ? TIE_CONTEXT : 0);
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ void initStyle(MStyle* s)
|
|||
// never show this style
|
||||
AS("", ff, 10, false, false, false, AlignmentFlags::LEFT | AlignmentFlags::BASELINE, QPointF(), OS, false,
|
||||
false, Spatium(.2), Spatium(.5), 25, QColor(Qt::black), false, false, QColor(Qt::black),
|
||||
QColor(255, 255, 255, 0), Hidden::ALWAYS);
|
||||
QColor(255, 255, 255, 0), TextStyleHidden::ALWAYS);
|
||||
|
||||
AS("Title", ff, 24, false, false, false, AlignmentFlags::HCENTER | AlignmentFlags::TOP, QPointF(), OA);
|
||||
AS("Subtitle", ff, 14, false, false, false, AlignmentFlags::HCENTER | AlignmentFlags::TOP, QPointF(0, MM(10)), OA);
|
||||
|
@ -318,7 +318,7 @@ void initStyle(MStyle* s)
|
|||
AlignmentFlags::LEFT | AlignmentFlags::TOP, QPointF(0, 6), OS, true,
|
||||
false, Spatium(0.0), Spatium(0.0), 25, QColor(Qt::black), false, // default params
|
||||
false, QColor(Qt::black), QColor(255, 255, 255, 0), // default params
|
||||
Hidden::IN_EDITOR); // don't show in Style Editor
|
||||
TextStyleHidden::IN_EDITOR); // don't show in Style Editor
|
||||
|
||||
#undef MM
|
||||
#undef OA
|
||||
|
@ -583,7 +583,7 @@ StyleData::~StyleData()
|
|||
TextStyle::TextStyle()
|
||||
{
|
||||
d = new TextStyleData;
|
||||
_hidden = Hidden::NEVER;
|
||||
_hidden = TextStyleHidden::NEVER;
|
||||
}
|
||||
|
||||
TextStyle::TextStyle(QString _name, QString _family, qreal _size,
|
||||
|
@ -592,7 +592,7 @@ TextStyle::TextStyle(QString _name, QString _family, qreal _size,
|
|||
const QPointF& _off, OffsetType _ot,
|
||||
bool sd,
|
||||
bool hasFrame, Spatium fw, Spatium pw, int fr, QColor co, bool _circle, bool _systemFlag,
|
||||
QColor fg, QColor bg, Hidden hidden)
|
||||
QColor fg, QColor bg, TextStyleHidden hidden)
|
||||
{
|
||||
d = new TextStyleData(_name, _family, _size,
|
||||
_bold, _italic, _underline, _align, _off, _ot,
|
||||
|
|
|
@ -27,14 +27,14 @@ class Element;
|
|||
|
||||
class TextStyleData;
|
||||
|
||||
enum class Hidden : unsigned char {
|
||||
enum class TextStyleHidden : unsigned char {
|
||||
NEVER = 0,
|
||||
IN_EDITOR = 1,
|
||||
IN_LISTS = 2,
|
||||
ALWAYS = 0xFF
|
||||
};
|
||||
|
||||
constexpr bool operator& (Hidden h1, Hidden h2) {
|
||||
constexpr bool operator& (TextStyleHidden h1, TextStyleHidden h2) {
|
||||
return static_cast<unsigned char>(h1) & static_cast<unsigned char>(h2);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ constexpr bool operator& (Hidden h1, Hidden h2) {
|
|||
class TextStyle {
|
||||
private:
|
||||
QSharedDataPointer<TextStyleData> d;
|
||||
Hidden _hidden; // read-only parameter for text style visibility in various program places
|
||||
TextStyleHidden _hidden; // read-only parameter for text style visibility in various program places
|
||||
|
||||
public:
|
||||
TextStyle();
|
||||
|
@ -57,7 +57,7 @@ class TextStyle {
|
|||
bool sd = false,
|
||||
bool hasFrame = false, Spatium fw = Spatium(0.2), Spatium pw = Spatium(0.5), int fr = 25,
|
||||
QColor co = QColor(Qt::black), bool circle = false, bool systemFlag = false,
|
||||
QColor fg = QColor(Qt::black), QColor bg = QColor(255, 255, 255, 0), Hidden hidden = Hidden::NEVER);
|
||||
QColor fg = QColor(Qt::black), QColor bg = QColor(255, 255, 255, 0), TextStyleHidden hidden = TextStyleHidden::NEVER);
|
||||
|
||||
TextStyle(const TextStyle&);
|
||||
~TextStyle();
|
||||
|
@ -109,7 +109,7 @@ class TextStyle {
|
|||
void setSystemFlag(bool v);
|
||||
void setForegroundColor(const QColor& v);
|
||||
void setBackgroundColor(const QColor& v);
|
||||
Hidden hidden() const { return _hidden; }
|
||||
TextStyleHidden hidden() const { return _hidden; }
|
||||
void write(Xml& xml) const;
|
||||
void writeProperties(Xml& xml) const;
|
||||
void writeProperties(Xml& xml, const TextStyle&) const;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Ms {
|
||||
|
||||
enum Col : char { PITCH, NOTE, SHORTCUT, NAME };
|
||||
enum Column : char { PITCH, NOTE, SHORTCUT, NAME };
|
||||
|
||||
//---------------------------------------------------------
|
||||
// noteHeadNames
|
||||
|
@ -94,15 +94,15 @@ void EditDrumset::updateList()
|
|||
pitchList->clear();
|
||||
for (int i = 0; i < 128; ++i) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(pitchList);
|
||||
item->setText(Col::PITCH, QString("%1").arg(i));
|
||||
item->setText(Col::NOTE, pitch2string(i));
|
||||
item->setText(Column::PITCH, QString("%1").arg(i));
|
||||
item->setText(Column::NOTE, pitch2string(i));
|
||||
if (nDrumset.shortcut(i) == 0)
|
||||
item->setText(Col::SHORTCUT, "");
|
||||
item->setText(Column::SHORTCUT, "");
|
||||
else {
|
||||
QString s(QChar(nDrumset.shortcut(i)));
|
||||
item->setText(Col::SHORTCUT, s);
|
||||
item->setText(Column::SHORTCUT, s);
|
||||
}
|
||||
item->setText(Col::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(i))));
|
||||
item->setText(Column::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(i))));
|
||||
item->setData(0, Qt::UserRole, i);
|
||||
}
|
||||
}
|
||||
|
@ -113,12 +113,12 @@ void EditDrumset::updateList2()
|
|||
QTreeWidgetItem* item = pitchList->topLevelItem(i);
|
||||
int pitch = item->data(0, Qt::UserRole).toInt();
|
||||
if (nDrumset.shortcut(pitch) == 0)
|
||||
item->setText(Col::SHORTCUT, "");
|
||||
item->setText(Column::SHORTCUT, "");
|
||||
else {
|
||||
QString s(QChar(nDrumset.shortcut(pitch)));
|
||||
item->setText(Col::SHORTCUT, s);
|
||||
item->setText(Column::SHORTCUT, s);
|
||||
}
|
||||
item->setText(Col::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
|
||||
item->setText(Column::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
|
||||
item->setData(0, Qt::UserRole, pitch);
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void EditDrumset::nameChanged(const QString& name)
|
|||
{
|
||||
QTreeWidgetItem* item = pitchList->currentItem();
|
||||
if (item)
|
||||
item->setText(Col::NAME, name);
|
||||
item->setText(Column::NAME, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -144,7 +144,7 @@ void EditDrumset::shortcutChanged()
|
|||
if (!item)
|
||||
return;
|
||||
|
||||
int pitch = item->data(Col::PITCH, Qt::UserRole).toInt();
|
||||
int pitch = item->data(Column::PITCH, Qt::UserRole).toInt();
|
||||
int sc;
|
||||
if (shortcut->currentIndex() == 7)
|
||||
sc = 0;
|
||||
|
@ -163,9 +163,9 @@ void EditDrumset::shortcutChanged()
|
|||
}
|
||||
nDrumset.drum(pitch).shortcut = sc;
|
||||
if (shortcut->currentIndex() == 7)
|
||||
item->setText(Col::SHORTCUT, "");
|
||||
item->setText(Column::SHORTCUT, "");
|
||||
else
|
||||
item->setText(Col::SHORTCUT, shortcut->currentText());
|
||||
item->setText(Column::SHORTCUT, shortcut->currentText());
|
||||
}
|
||||
updateList2();
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ void EditDrumset::itemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previou
|
|||
else
|
||||
nDrumset.drum(pitch).shortcut = "ABCDEFG"[shortcut->currentIndex()];
|
||||
nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
|
||||
previous->setText(Col::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
|
||||
previous->setText(Column::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
|
||||
}
|
||||
if (current == 0)
|
||||
return;
|
||||
|
@ -265,7 +265,7 @@ void EditDrumset::valueChanged()
|
|||
{
|
||||
if(!pitchList->currentItem())
|
||||
return;
|
||||
int pitch = pitchList->currentItem()->data(Col::PITCH, Qt::UserRole).toInt();
|
||||
int pitch = pitchList->currentItem()->data(Column::PITCH, Qt::UserRole).toInt();
|
||||
nDrumset.drum(pitch).name = name->text();
|
||||
nDrumset.drum(pitch).notehead = NoteHeadGroup(noteHead->currentIndex() - 1);
|
||||
nDrumset.drum(pitch).line = staffLine->value();
|
||||
|
|
|
@ -572,7 +572,7 @@ void InspectorText::setElement()
|
|||
const QList<TextStyle>& ts = score->style()->textStyles();
|
||||
int n = ts.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (!(ts.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if (!(ts.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
t.style->addItem(ts.at(i).name(), i);
|
||||
}
|
||||
t.style->blockSignals(false);
|
||||
|
@ -617,7 +617,7 @@ void InspectorTempoText::setElement()
|
|||
const QList<TextStyle>& ts = score->style()->textStyles();
|
||||
int n = ts.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (!(ts.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if (!(ts.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
t.style->addItem(ts.at(i).name(), i);
|
||||
}
|
||||
t.style->blockSignals(false);
|
||||
|
@ -670,7 +670,7 @@ void InspectorDynamic::setElement()
|
|||
const QList<TextStyle>& ts = score->style()->textStyles();
|
||||
int n = ts.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (!(ts.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if (!(ts.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
t.style->addItem(ts.at(i).name(), i);
|
||||
}
|
||||
t.style->blockSignals(false);
|
||||
|
|
|
@ -56,7 +56,7 @@ void InspectorJump::setElement()
|
|||
const QList<TextStyle>& ts = score->style()->textStyles();
|
||||
int n = ts.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (!(ts.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if (!(ts.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
t.style->addItem(ts.at(i).name(), i);
|
||||
}
|
||||
t.style->blockSignals(false);
|
||||
|
|
|
@ -55,7 +55,7 @@ void InspectorMarker::setElement()
|
|||
const QList<TextStyle>& ts = score->style()->textStyles();
|
||||
int n = ts.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (!(ts.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if (!(ts.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
t.style->addItem(ts.at(i).name(), i);
|
||||
}
|
||||
t.style->blockSignals(false);
|
||||
|
|
|
@ -83,7 +83,7 @@ void TextProp::setScore(bool onlyStyle, Score* score)
|
|||
int n = scoreStyles.size();
|
||||
for (int i = 0; i < n; ++i) {
|
||||
// if style not hidden in this context, add to combo with index in score style list as userData
|
||||
if ( !(scoreStyles.at(i).hidden() & Hidden::IN_LISTS) )
|
||||
if ( !(scoreStyles.at(i).hidden() & TextStyleHidden::IN_LISTS) )
|
||||
styles->addItem(scoreStyles.at(i).name(), i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ TextStyleDialog::TextStyleDialog(QWidget* parent, Score* score)
|
|||
textNames->clear();
|
||||
for (int i = 0; i < styles.size(); ++i) {
|
||||
// const TextStyle& s = styles.at(i);
|
||||
if ( (styles.at(i).hidden()& Hidden::IN_EDITOR) == 0) {
|
||||
if ( (styles.at(i).hidden()& TextStyleHidden::IN_EDITOR) == 0) {
|
||||
int count = textNames->count();
|
||||
textNames->addItem(qApp->translate("MuseScore", styles.at(i).name().toLatin1().data()));
|
||||
textNames->item(count)->setData(Qt::UserRole, i);
|
||||
|
|
Loading…
Reference in a new issue