Merge pull request #3250 from IsaacWeiss/breaks-palette-2

Fix #232931 follow-up: change behavior of adding breaks from palette
This commit is contained in:
Nicolas Froment 2017-08-04 15:16:47 +02:00 committed by GitHub
commit 268a711b97
2 changed files with 5 additions and 2 deletions

View file

@ -527,7 +527,6 @@ class Score : public QObject, ScoreElement {
void cmdToggleHideEmpty();
void cmdSetVisible();
void cmdUnsetVisible();
void cmdToggleLayoutBreak(LayoutBreak::Type);
inline virtual Movements* movements();
inline virtual const Movements* movements() const;
@ -574,6 +573,7 @@ class Score : public QObject, ScoreElement {
void cmdHalfDuration() { cmdIncDecDuration( 1, 0); }
void cmdIncDurationDotted() { cmdIncDecDuration(-1, 1); }
void cmdDecDurationDotted() { cmdIncDecDuration( 1, 1); }
void cmdToggleLayoutBreak(LayoutBreak::Type);
void addRemoveBreaks(int interval, bool lock);

View file

@ -509,7 +509,6 @@ void Palette::applyPaletteElement(PaletteCell* cell)
|| element->type() == ElementType::MARKER
|| element->type() == ElementType::JUMP
|| element->type() == ElementType::SPACER
|| element->type() == ElementType::LAYOUT_BREAK
|| element->type() == ElementType::VBOX
|| element->type() == ElementType::HBOX
|| element->type() == ElementType::TBOX
@ -531,6 +530,10 @@ void Palette::applyPaletteElement(PaletteCell* cell)
break;
}
}
else if (element->type() == ElementType::LAYOUT_BREAK) {
LayoutBreak* breakElement = static_cast<LayoutBreak*>(element);
score->cmdToggleLayoutBreak(breakElement->layoutBreakType());
}
else if (element->isClef() || element->isKeySig() || element->isTimeSig()) {
Measure* m1 = sel.startSegment()->measure();
Measure* m2 = sel.endSegment() ? sel.endSegment()->measure() : nullptr;