Skip to content

Conversation

@blaskocode
Copy link

Resolves: #18691

Summary

Implements a new stacked display mode for capo chord symbols with comprehensive styling options, allowing guitarists to see capo chords displayed above base chords in a professional lead-sheet format.

Before (Inline only)

Em(Dm)  Am(Gm)  C(Bb)

After (Stacked option)

(Dm)    (Gm)    (Bb)
 Em      Am      C

Changes

  • Add CapoChordDisplayMode enum (INLINE/STACKED)
  • Add 9 style properties for capo chord customization:
    • capoChordDisplayMode, capoChordParenthesized
    • capoChordTextStyle, capoChordStackedSpacing
    • capoLabelVisible, capoLabelFormat, capoLabelTextStyle
  • Implement stacked rendering with configurable spacing and text styling
  • Add "Capo N:" label rendering with configurable format
  • Add UI controls in Format > Style > Chord Symbols > Capo section
  • Add unit tests for style property serialization and defaults

Test plan

  • Create score with chord symbols and set capo position > 0
  • Set "Display capo chords" to "Show chord symbols & transposed symbols"
  • Toggle between Inline and Stacked display modes
  • Verify capo chord appears above base chord in Stacked mode
  • Toggle parentheses, verify display updates
  • Adjust spacing, verify gap changes
  • Toggle label visibility, verify "Capo N:" appears/disappears
  • Save and reload score, verify settings persist
  • Run unit tests: ctest --test-dir build -R chordsymbol

@blaskocode blaskocode force-pushed the 24413-capoed-chord-styling branch from 5b7ef16 to 28dddd6 Compare November 26, 2025 14:47
Resolves: musescore#18691

Add data model foundation for stacked capo chord display:

- Add CapoChordDisplayMode enum (INLINE/STACKED) in types.h
- Add 9 new style properties (Sid) in styledef.h:
  - capoChordDisplayMode, capoChordParenthesized
  - capoChordTextStyle, capoChordStackedSpacing
  - capoLabelVisible, capoLabelFormat, capoLabelTextStyle
- Set default values in styledef.cpp for backward compatibility
Implements the rendering logic for stacked capo chord display:

- Add buildFontFromTextStyle() helper for capo chord font styling
- Add layoutCapoLabel() to render "Capo N:" label left of first chord
- Implement STACKED mode in renderSingleHarmony():
  - Position capo chord above base chord with configurable spacing
  - Center capo chord horizontally over base chord
  - Apply separate text style (HARMONY_B default) to capo chord
  - Handle parentheses with proper centering compensation
- Add calculateCapoTpc() for transposition calculations
- Call layoutCapoLabel() from systemlayout.cpp after harmony layout
Add user interface for configuring capo chord display in
Format > Style > Chord Symbols > Capo section:

- Add Q_PROPERTY declarations and accessors in chordsymbolspagemodel
- Add dropdown option providers for display mode and text style
- Add QML controls in ChordSymbolsPage.qml:
  - Display mode dropdown (Inline/Stacked)
  - Capo chord text style selector
  - Parenthesized checkbox (stacked mode only)
  - Stacked spacing control
  - Label visibility checkbox
  - Label format text field
  - Label text style selector
- Controls enable/disable based on current mode selection
Add Google Test cases for capo chord styling feature:

- capoDisplayModeRoundTrip: Verify capoChordDisplayMode and
  capoChordParenthesized persist through save/load cycle
- capoDisplayModeDefaults: Verify backward compatibility defaults
  (INLINE mode, parentheses enabled)
- capoEnhancedStylesRoundTrip: Verify all enhanced style properties
  (text style, spacing, label settings) persist correctly
- capoEnhancedStylesDefaults: Verify enhanced property defaults
  (HARMONY_B style, 0.8sp spacing, label visible)
@blaskocode blaskocode force-pushed the 24413-capoed-chord-styling branch from 28dddd6 to ae533b6 Compare November 26, 2025 14:51
@miiizen miiizen self-assigned this Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow different styling/formatting of capoed/transposed chord text

2 participants