Skip to content

Commit

Permalink
Fix GH#22020: Add "reset to default" buttons in style
Browse files Browse the repository at this point in the history
Backport of musescore#24092
  • Loading branch information
axiomizer authored and Jojo-Schmitz committed Aug 28, 2024
1 parent 7a67807 commit 0e43867
Show file tree
Hide file tree
Showing 2 changed files with 1,000 additions and 403 deletions.
98 changes: 49 additions & 49 deletions mscore/editstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ EditStyle::EditStyle(Score* s, QWidget* parent)

styleWidgets = {
// idx --- showPercent --- widget --- resetButton
{ Sid::figuredBassAlignment, false, fbAlign, 0 },
{ Sid::figuredBassStyle, false, fbStyle, 0 },
{ Sid::figuredBassFontSize, false, doubleSpinFBSize, 0 },
{ Sid::figuredBassYOffset, false, doubleSpinFBVertPos, 0 },
{ Sid::figuredBassLineHeight, true, spinFBLineHeight, 0 },
{ Sid::tabClef, false, ctg, 0 },
{ Sid::keySigNaturals, false, ksng, 0 },
{ Sid::voltaLineStyle, false, voltaLineStyle, resetVoltaLineStyle },
{ Sid::ottavaLineStyle, false, ottavaLineStyle, resetOttavaLineStyle },
{ Sid::pedalLineStyle, false, pedalLineStyle, resetPedalLineStyle },
{ Sid::figuredBassAlignment, false, fbAlign, 0 },
{ Sid::figuredBassStyle, false, fbStyle, 0 },
{ Sid::figuredBassFontSize, false, doubleSpinFBSize, resetDoubleSpinFBSize },
{ Sid::figuredBassYOffset, false, doubleSpinFBVertPos, resetDoubleSpinFBVertPos },
{ Sid::figuredBassLineHeight, true, spinFBLineHeight, resetSpinFBLineHeight },
{ Sid::tabClef, false, ctg, 0 },
{ Sid::keySigNaturals, false, ksng, 0 },
{ Sid::voltaLineStyle, false, voltaLineStyle, resetVoltaLineStyle },
{ Sid::ottavaLineStyle, false, ottavaLineStyle, resetOttavaLineStyle },
{ Sid::pedalLineStyle, false, pedalLineStyle, resetPedalLineStyle },

{ Sid::staffUpperBorder, false, staffUpperBorder, resetStaffUpperBorder },
{ Sid::staffLowerBorder, false, staffLowerBorder, resetStaffLowerBorder },
Expand Down Expand Up @@ -178,8 +178,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::firstSystemIndentationValue, false, indentationValue, resetFirstSystemIndentation },
{ Sid::alwaysShowBracketsWhenEmptyStavesAreHidden, false, alwaysShowBrackets, 0 },
{ Sid::hideInstrumentNameIfOneInstrument, false, hideInstrumentNameIfOneInstrument, 0 },
{ Sid::accidentalNoteDistance, false, accidentalNoteDistance, 0 },
{ Sid::accidentalDistance, false, accidentalDistance, 0 },
{ Sid::accidentalNoteDistance, false, accidentalNoteDistance, resetAccidentalNoteDistance },
{ Sid::accidentalDistance, false, accidentalDistance, resetAccidentalDistance },
{ Sid::bracketedAccidentalPadding, false, accidentalsBracketsBadding, resetAccidentalsBracketPadding },
{ Sid::alignAccidentalsLeft, false, accidentalsOctaveColumnsAlignLeft, resetAccidentalsOctaveColumnsAlignLeft },

Expand All @@ -202,8 +202,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::clefBarlineDistance, false, clefBarlineDistance, resetClefBarlineDistance },
{ Sid::timesigBarlineDistance, false, timesigBarlineDistance, resetTimesigBarlineDistance },
{ Sid::staffLineWidth, false, staffLineWidth, resetStaffLineWidth },
{ Sid::beamWidth, false, beamWidth, 0 },
{ Sid::beamMinLen, false, beamMinLen, 0 },
{ Sid::beamWidth, false, beamWidth, resetBeamWidth },
{ Sid::beamMinLen, false, beamMinLen, resetBeamMinLen },

{ Sid::hairpinPlacement, false, hairpinPlacement, resetHairpinPlacement },
{ Sid::hairpinPosAbove, false, hairpinPosAbove, resetHairpinPosAbove },
Expand All @@ -212,16 +212,16 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::hairpinHeight, false, hairpinHeight, resetHairpinHeight },
{ Sid::hairpinContHeight, false, hairpinContinueHeight, resetHairpinContinueHeight },

{ Sid::dotNoteDistance, false, noteDotDistance, 0 },
{ Sid::dotDotDistance, false, dotDotDistance, 0 },
{ Sid::stemWidth, false, stemWidth, 0 },
{ Sid::ledgerLineWidth, false, ledgerLineWidth, 0 },
{ Sid::ledgerLineLength, false, ledgerLineLength, 0 },
{ Sid::shortStemProgression, false, shortStemProgression, 0 },
{ Sid::shortestStem, false, shortestStem, 0 },
{ Sid::arpeggioNoteDistance, false, arpeggioNoteDistance, 0 },
{ Sid::arpeggioLineWidth, false, arpeggioLineWidth, 0 },
{ Sid::arpeggioHookLen, false, arpeggioHookLen, 0 },
{ Sid::dotNoteDistance, false, noteDotDistance, resetNoteDotDistance },
{ Sid::dotDotDistance, false, dotDotDistance, resetDotDotDistance },
{ Sid::stemWidth, false, stemWidth, resetStemWidth },
{ Sid::ledgerLineWidth, false, ledgerLineWidth, resetLedgerLineWidth },
{ Sid::ledgerLineLength, false, ledgerLineLength, resetLedgerLineLength },
{ Sid::shortStemProgression, false, shortStemProgression, resetShortStemProgression },
{ Sid::shortestStem, false, shortestStem, resetShortestStem },
{ Sid::arpeggioNoteDistance, false, arpeggioNoteDistance, resetArpeggioNoteDistance },
{ Sid::arpeggioLineWidth, false, arpeggioLineWidth, resetArpeggioLineWidth },
{ Sid::arpeggioHookLen, false, arpeggioHookLen, resetArpeggioHookLen },
{ Sid::arpeggioHiddenInStdIfTab,false, arpeggioHiddenInStdIfTab,0 },
{ Sid::slurEndWidth, false, slurEndLineWidth, resetSlurEndLineWidth },
{ Sid::slurMidWidth, false, slurMidLineWidth, resetSlurMidLineWidth },
Expand All @@ -232,10 +232,10 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::tieDottedWidth, false, tieDottedLineWidth, resetTieDottedLineWidth },
{ Sid::tieMinDistance, false, tieMinDistance, resetTieMinDistance },
{ Sid::minTieLength, false, minTieLength, resetMinTieLength },
{ Sid::bracketWidth, false, bracketWidth, 0 },
{ Sid::bracketDistance, false, bracketDistance, 0 },
{ Sid::akkoladeWidth, false, akkoladeWidth, 0 },
{ Sid::akkoladeBarDistance, false, akkoladeBarDistance, 0 },
{ Sid::bracketWidth, false, bracketWidth, resetBracketWidth },
{ Sid::bracketDistance, false, bracketDistance, resetBracketDistance },
{ Sid::akkoladeWidth, false, akkoladeWidth, resetAkkoladeWidth },
{ Sid::akkoladeBarDistance, false, akkoladeBarDistance, resetAkkoladeBarDistance },
{ Sid::dividerLeft, false, dividerLeft, 0 },
{ Sid::dividerLeftX, false, dividerLeftX, 0 },
{ Sid::dividerLeftY, false, dividerLeftY, 0 },
Expand Down Expand Up @@ -264,16 +264,16 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::trillPosAbove, false, trillLinePosAbove, resetTrillLinePosAbove },
{ Sid::trillPosBelow, false, trillLinePosBelow, resetTrillLinePosBelow },

{ Sid::vibratoPlacement, false, vibratoLinePlacement, resetVibratoLinePlacement },
{ Sid::vibratoPosAbove, false, vibratoLinePosAbove, resetVibratoLinePosAbove },
{ Sid::vibratoPosBelow, false, vibratoLinePosBelow, resetVibratoLinePosBelow },
{ Sid::vibratoPlacement, false, vibratoLinePlacement, resetVibratoLinePlacement },
{ Sid::vibratoPosAbove, false, vibratoLinePosAbove, resetVibratoLinePosAbove },
{ Sid::vibratoPosBelow, false, vibratoLinePosBelow, resetVibratoLinePosBelow },

{ Sid::harmonyFretDist, false, harmonyFretDist, 0 },
{ Sid::minHarmonyDistance, false, minHarmonyDistance, 0 },
{ Sid::maxHarmonyBarDistance, false, maxHarmonyBarDistance, 0 },
{ Sid::maxChordShiftAbove, false, maxChordShiftAbove, resetMaxChordShiftAbove },
{ Sid::maxChordShiftBelow, false, maxChordShiftBelow, resetMaxChordShiftBelow },
{ Sid::harmonyPlay, false, harmonyPlay, 0 },
{ Sid::harmonyFretDist, false, harmonyFretDist, resetHarmonyFretDist },
{ Sid::minHarmonyDistance, false, minHarmonyDistance, resetMinHarmonyDistance },
{ Sid::maxHarmonyBarDistance, false, maxHarmonyBarDistance, resetMaxHarmonyBarDistance },
{ Sid::maxChordShiftAbove, false, maxChordShiftAbove, resetMaxChordShiftAbove },
{ Sid::maxChordShiftBelow, false, maxChordShiftBelow, resetMaxChordShiftBelow },
{ Sid::harmonyPlay, false, harmonyPlay, 0 },
{ Sid::harmonyVoiceLiteral, false, voicingSelectWidget->interpretBox, 0 },
{ Sid::harmonyVoicing, false, voicingSelectWidget->voicingBox, 0 },
{ Sid::harmonyDuration, false, voicingSelectWidget->durationBox, 0 },
Expand Down Expand Up @@ -315,8 +315,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::mmRestRangePosAbove, false, mmRestRangePosAbove, resetMMRestRangePosAbove },
{ Sid::mmRestRangePosBelow, false, mmRestRangePosBelow, resetMMRestRangePosBelow },

{ Sid::beamDistance, true, beamDistance, 0 },
{ Sid::beamNoSlope, false, beamNoSlope, 0 },
{ Sid::beamDistance, true, beamDistance, resetBeamDistance },
{ Sid::beamNoSlope, false, beamNoSlope, resetBeamNoSlope },
{ Sid::graceNoteMag, true, graceNoteSize, resetGraceNoteSize },
{ Sid::smallStaffMag, true, smallStaffSize, resetSmallStaffSize },
{ Sid::smallNoteMag, true, smallNoteSize, resetSmallNoteSize },
Expand All @@ -329,7 +329,7 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::genCourtesyClef, false, genCourtesyClef, 0 },
{ Sid::swingRatio, false, swingBox, 0 },
{ Sid::chordsXmlFile, false, chordsXmlFile, 0 },
{ Sid::dotMag, true, dotMag, 0 },
{ Sid::dotMag, true, dotMag, resetDotMag },
{ Sid::articulationMag, true, articulationMag, resetArticulationMag },
{ Sid::shortenStem, false, shortenStem, 0 },
{ Sid::showHeader, false, showHeader, 0 },
Expand All @@ -353,15 +353,15 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
{ Sid::oddFooterR, false, oddFooterR, 0 },

{ Sid::ottavaNumbersOnly, false, ottavaNumbersOnly, resetOttavaNumbersOnly },
{ Sid::capoPosition, false, capoPosition, 0 },
{ Sid::fretNumMag, true, fretNumMag, 0 },
{ Sid::fretNumPos, false, fretNumGroup, 0 },
{ Sid::fretY, false, fretY, 0 },
{ Sid::barreLineWidth, false, barreLineWidth, 0 },
{ Sid::fretMag, false, fretMag, 0 },
{ Sid::fretDotSize, false, fretDotSize, 0 },
{ Sid::fretStringSpacing, false, fretStringSpacing, 0 },
{ Sid::fretFretSpacing, false, fretFretSpacing, 0 },
{ Sid::capoPosition, false, capoPosition, resetCapoPosition },
{ Sid::fretNumMag, true, fretNumMag, resetFretNumMag },
{ Sid::fretNumPos, false, fretNumGroup, resetFretNumPos },
{ Sid::fretY, false, fretY, resetFretY },
{ Sid::barreLineWidth, false, barreLineWidth, resetBarreLineWidth },
{ Sid::fretMag, false, fretMag, resetFretMag },
{ Sid::fretDotSize, false, fretDotSize, resetFretDotSize },
{ Sid::fretStringSpacing, false, fretStringSpacing, resetFretStringSpacing },
{ Sid::fretFretSpacing, false, fretFretSpacing, resetFretFretSpacing },
{ Sid::maxFretShiftAbove, false, maxFretShiftAbove, resetMaxFretShiftAbove },
{ Sid::maxFretShiftBelow, false, maxFretShiftBelow, resetMaxFretShiftBelow },
{ Sid::scaleBarlines, false, scaleBarlines, resetScaleBarlines},
Expand Down
Loading

0 comments on commit 0e43867

Please sign in to comment.