Skip to content

Commit

Permalink
Merge pull request #26839 from miiizen/port-4.5-3
Browse files Browse the repository at this point in the history
Port more commits to 4.5
  • Loading branch information
RomanPudashkin authored Feb 28, 2025
2 parents 01f6338 + 5a12294 commit f0f43f8
Show file tree
Hide file tree
Showing 51 changed files with 94 additions and 110 deletions.
13 changes: 10 additions & 3 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,10 @@ Tie* Score::cmdToggleTie()
Note* note2 = tieNoteList[i];
if (note2) {
Note* note = noteList[i];
tie = createAndAddTie(note, note2);

Note* startNote = note->tick() <= note2->tick() ? note : note2;
Note* endNote = startNote == note2 ? note : note2;
tie = createAndAddTie(startNote, endNote);
}
}
} else {
Expand All @@ -2084,8 +2087,12 @@ Tie* Score::cmdToggleTie()
}

if (shouldTieListSelection) {
Note* startNote = noteList.at(0);
Note* endNote = noteList.at(1);
Note* note = noteList.at(0);
Note* note2 = noteList.at(1);

Note* startNote = note->tick() <= note2->tick() ? note : note2;
Note* endNote = startNote == note2 ? note : note2;

if (startNote->part() == endNote->part() && startNote->pitch() == endNote->pitch()
&& startNote->unisonIndex() == endNote->unisonIndex() && startNote->tick() != endNote->tick()) {
tie = createAndAddTie(startNote, endNote);
Expand Down
7 changes: 6 additions & 1 deletion src/engraving/rendering/score/horizontalspacing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,12 @@ void HorizontalSpacing::setPositionsAndWidths(const std::vector<SegmentPosition>
Measure* curSegMeasure = curSeg->measure();
Measure* nextSegMeasure = nextSeg->measure();

double segWidth = curSegMeasure == nextSegMeasure || nextSeg->isStartRepeatBarLineType() ? nextX - curX : curSeg->minRight();
bool leadingNonCRException = ((nextSeg->isKeySigType() || nextSeg->isTimeSigType()
|| nextSeg->isClefType()) && !curSeg->isType(SegmentType::BarLineType));
bool computeWidthByDifferenceFromNext = curSegMeasure == nextSegMeasure || nextSeg->isStartRepeatBarLineType()
|| leadingNonCRException;

double segWidth = computeWidthByDifferenceFromNext ? nextX - curX : curSeg->minRight();

curSeg->setWidth(segWidth);

Expand Down
10 changes: 10 additions & 0 deletions src/engraving/rendering/score/modifydom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ void ModifyDom::sortMeasureSegments(Measure* measure, LayoutContext& ctx)
}

std::vector<Segment*> segsToMoveToThisMeasure;
std::vector<Segment*> segsToRemove;
for (Segment& seg : nextMeasure->segments()) {
if (seg.tick() != nextMeasure->tick() || seg.isChordRestType()) {
continue;
Expand Down Expand Up @@ -361,10 +362,19 @@ void ModifyDom::sortMeasureSegments(Measure* measure, LayoutContext& ctx)
// Move key sigs and time sigs at the start of the next measure to the end of this measure
if ((seg.isTimeSigType() || seg.isKeySigType()) && !seg.header() && !seg.trailer()
&& sigsShouldBeInThisMeasure && changeAppliesToRepeatAndContinuation(seg)) {
if (measure->findSegmentR(seg.segmentType(), measure->ticks())) {
segsToRemove.push_back(&seg);
continue;
}
segsToMoveToThisMeasure.push_back(&seg);
}
}

for (Segment* seg : segsToRemove) {
// Don't add duplicate segs to the end of a measure
ctx.mutDom().doUndoRemoveElement(seg);
}

for (Segment* seg : segsToMoveToNextMeasure) {
seg->setRtick(Fraction(0, 1));
seg->setEndOfMeasureChange(false);
Expand Down
Binary file modified src/framework/ui/data/MusescoreIcon.ttf
Binary file not shown.
48 changes: 24 additions & 24 deletions src/notation/notationscene.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,34 @@
<file>qml/MuseScore/NotationScene/internal/EditStyle/IconAndTextButtonSelector.qml</file>
<file>qml/MuseScore/NotationScene/PercussionPanelPadSwapDialog.qml</file>
<file>qml/MuseScore/NotationScene/internal/PartialTiePopup.qml</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-above_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-across_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-hang.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-right_align.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-on_all_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-create_space.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/StyledImage.qml</file>
<file>qml/MuseScore/NotationScene/internal/PartialTieMenuRowItem.qml</file>
<file>qml/MuseScore/NotationScene/EditPercussionShortcutDialog.qml</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-cancel-3.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-cancel-2.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-cancel-1.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-cancel-3.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-cancel-2.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-cancel-1.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/end-start-repeats-4.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/end-start-repeats-3.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/end-start-repeats-2.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/end-start-repeats-1.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clef-before-true.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clef-before-false.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-3.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-2.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeat-1.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-3.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-2.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other-jump-1.png</file>
<file>qml/MuseScore/NotationScene/internal/ShadowNotePopup.qml</file>
<file>qml/MuseScore/NotationScene/internal/PercussionNotePopupContent.qml</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-above_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-across_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-hang.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-inset.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-courtesy-right_align.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/timeSigImages/timesig-on_all_staves.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_other-off.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_other-on-parens.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_other-on.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_repeat-off.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_repeat-on-parens.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/cancel_repeat-on.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-after_repeat-allow_changes.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-after_repeat-disallow_changes.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-after_repeat.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-before_repeat-allow_changes.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-before_repeat-disallow_changes.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/clefs-before_repeat.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other_jumps-off.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other_jumps-on-parens.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/other_jumps-on.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeats-off.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeats-on-parens.png</file>
<file>qml/MuseScore/NotationScene/internal/EditStyle/courtesyImages/repeats-on.png</file>
</qresource>
</RCC>
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ StyledFlickable {
}

StyledImage {
forceHeight: 120
forceHeight: 144
horizontalPadding: 0
verticalPadding: 0
source: pageModel.timeSigPlacement.value === 0 ? "timeSigImages/timesig-on_all_staves.png"
: pageModel.timeSigPlacement.value === 1 ? "timeSigImages/timesig-above_staves.png"
: "timeSigImages/timesig-across_staves.png"
Expand Down Expand Up @@ -433,10 +435,12 @@ StyledFlickable {
}

StyledImage {
forceWidth: 120
forceHeight: 94
horizontalPadding: 0
verticalPadding: 0
source: root.timeSigVsMargin.value === 0 ? "timeSigImages/timesig-courtesy-hang.png"
: root.timeSigVsMargin.value === 1 ? "timeSigImages/timesig-courtesy-right_align.png"
: "timeSigImages/timesig-courtesy-create_space.png"
: "timeSigImages/timesig-courtesy-inset.png"
}
}
}
Expand Down Expand Up @@ -532,31 +536,19 @@ StyledFlickable {
enabled: toggleButton.checked
}

Rectangle {
StyledImage {
id: image

Layout.row: 0
Layout.column: 1
Layout.rowSpan: 3
Layout.alignment: Qt.AlignRight

id: display
width: image.width + 25
height: image.height + 20

color: "#ffffff"
border.color: ui.theme.strokeColor
radius: ui.theme.borderWidth

Image {
id: image
forceHeight: 96
horizontalPadding: 0
verticalPadding: 0

width: 370
height: 98
anchors.centerIn: parent
mipmap: true

fillMode: Image.PreserveAspectFit
source: toggleButton.checked ? (parensCheckbox.checked ? imageParens : imageON) : imageOFF
}
source: toggleButton.checked ? (parensCheckbox.checked ? imageParens : imageON) : imageOFF
}
}

Expand Down Expand Up @@ -607,31 +599,17 @@ StyledFlickable {
onToggled: pageModel.placeClefsBeforeRepeats.value = false
}

Rectangle {
StyledImage {
id: clefBeforeImage
Layout.row: 0
Layout.column: 1
Layout.rowSpan: 2
Layout.alignment: Qt.AlignRight

id: clefBeforeDisplay
width: clefBeforeImage.width + 25
height: clefBeforeImage.height + 20

color: "#ffffff"
border.color: ui.theme.strokeColor
radius: ui.theme.borderWidth

Image {
id: clefBeforeImage

width: 136
height: 68
anchors.centerIn: parent
mipmap: true

fillMode: Image.PreserveAspectFit
source: clefBeforeRepeatsButton.checked ? "courtesyImages/clef-before-true.png" : "courtesyImages/clef-before-false.png"
}
forceHeight: 64
horizontalPadding: 0
verticalPadding: 0
source: clefBeforeRepeatsButton.checked ? "courtesyImages/clefs-before_repeat.png" : "courtesyImages/clefs-after_repeat.png"
}

CheckBox {
Expand All @@ -643,36 +621,22 @@ StyledFlickable {
onClicked: pageModel.changesBetweenEndStartRepeat.value = !pageModel.changesBetweenEndStartRepeat.value
}

Rectangle {
StyledImage {
id: endStartRepeatImage
Layout.row: 2
Layout.column: 1
Layout.rowSpan: 2
Layout.alignment: Qt.AlignRight

id: endStartRepeatDisplay
width: endStartRepeatImage.width + 25
height: endStartRepeatImage.height + 20

color: "#ffffff"
border.color: ui.theme.strokeColor
radius: ui.theme.borderWidth
forceHeight: 64
horizontalPadding: 0
verticalPadding: 0

Image {
id: endStartRepeatImage

width: 136
height: 68
anchors.centerIn: parent
mipmap: true

fillMode: Image.PreserveAspectFit
source: clefBeforeRepeatsButton.checked ? (betweenRepeatsCheckbox.checked ? "courtesyImages/end-start-repeats-4"
: "courtesyImages/end-start-repeats-3")
: (betweenRepeatsCheckbox.checked ? "courtesyImages/end-start-repeats-1"
: "courtesyImages/end-start-repeats-2")
}
source: clefBeforeRepeatsButton.checked ? (betweenRepeatsCheckbox.checked ? "courtesyImages/clefs-before_repeat-allow_changes"
: "courtesyImages/clefs-before_repeat-disallow_changes")
: (betweenRepeatsCheckbox.checked ? "courtesyImages/clefs-after_repeat-allow_changes"
: "courtesyImages/clefs-after_repeat-disallow_changes")
}

}
}

Expand All @@ -689,9 +653,9 @@ StyledFlickable {
showStyleItem: pageModel.showCourtesiesRepeats
parensStyleItem: pageModel.useParensRepeatCourtesies

imageON: "courtesyImages/repeat-2"
imageOFF: "courtesyImages/repeat-1"
imageParens: "courtesyImages/repeat-3"
imageON: "courtesyImages/repeats-on"
imageOFF: "courtesyImages/repeats-off"
imageParens: "courtesyImages/repeats-on-parens"

text: qsTrc("notation/editstyle/timesignatures", "Show at repeats")
}
Expand All @@ -700,9 +664,9 @@ StyledFlickable {
showStyleItem: pageModel.showCourtesiesOtherJumps
parensStyleItem: pageModel.useParensOtherJumpCourtesies

imageON: "courtesyImages/other-jump-2"
imageOFF: "courtesyImages/other-jump-1"
imageParens: "courtesyImages/other-jump-3"
imageON: "courtesyImages/other_jumps-on"
imageOFF: "courtesyImages/other_jumps-off"
imageParens: "courtesyImages/other_jumps-on-parens"

text: qsTrc("notation/editstyle/timesignatures", "Show at all other jumps")
}
Expand All @@ -711,9 +675,9 @@ StyledFlickable {
showStyleItem: pageModel.showCourtesiesAfterCancellingRepeats
parensStyleItem: pageModel.useParensRepeatCourtesiesAfterCancelling

imageON: "courtesyImages/repeat-cancel-2"
imageOFF: "courtesyImages/repeat-cancel-1"
imageParens: "courtesyImages/repeat-cancel-3"
imageON: "courtesyImages/cancel_repeat-on"
imageOFF: "courtesyImages/cancel_repeat-off"
imageParens: "courtesyImages/cancel_repeat-on-parens"

text: qsTrc("notation/editstyle/timesignatures", "Show when cancelling a change before repeats")
}
Expand All @@ -722,9 +686,9 @@ StyledFlickable {
showStyleItem: pageModel.showCourtesiesAfterCancellingOtherJumps
parensStyleItem: pageModel.useParensOtherJumpCourtesiesAfterCancelling

imageON: "courtesyImages/other-jump-cancel-2"
imageOFF: "courtesyImages/other-jump-cancel-1"
imageParens: "courtesyImages/other-jump-cancel-3"
imageON: "courtesyImages/cancel_other-on"
imageOFF: "courtesyImages/cancel_other-off"
imageParens: "courtesyImages/cancel_other-on-parens"

text: qsTrc("notation/editstyle/timesignatures", "Show when cancelling a change before all other jumps")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Rectangle {
property double forceHeight: 0
property alias source: image.source

width: image.width + 2 * horizontalPadding
height: image.height + 2 * verticalPadding
width: image.width + 2 * horizontalPadding + border.width * 2
height: image.height + 2 * verticalPadding + border.width * 2

color: "#ffffff"
border.color: ui.theme.strokeColor
radius: 3
border.width: 1

Image {
id: image
Expand All @@ -53,5 +53,3 @@ Rectangle {
opacity: enabled ? 1.0 : 0.2
}
}


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file added vtest/scores/leadingNonChordSeg.mscz
Binary file not shown.

0 comments on commit f0f43f8

Please sign in to comment.