musescore / musescore/MuseScore
Some text properties do not update in the Properties panel on Undo and Redo
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
Issue type
UI bug (incorrect info or interface appearance)
Description with steps to reproduce
-
Select a text object. Change any of the following text properties in the Properties panel: font name, style, size or subscript/superscript.
-
Click Undo.
Result: The undo is not reflected in the Properties panel (the font name, style, size, etc. stays the same). -
Unselect and select the same text again. The Properties panel updates properly.
-
Click Redo.
Result: The redo is not reflected in the Properties panel (the font name, style, size, etc. stays the same).
#20859 is the same but for the Text style property. The changes made there fixed the Text style property as well as a few others (all text properties had an issue with Undo/Redo):
- text style
- alignment (horizontal and vertical)
- scale with staff size
- frame and all frame properties
- line spacing
- position
QA Note: Can we have these tested as part of this story please?
The rest of the text properties, however, are handled in a different way since they can be applied to individual characters or groups of characters within a text. For example you can have both bold and non-bold characters in the same Text object (but not different alignments, text styles, frames - those are applicable to the entire text object only). These per-character text properties are:
- font name
- font style (bold, italic, etc.)
- font size
- subscript/superscript
and they need to be fixed to update upon Undo/Redo. This story is about them.
The code that handles these differently for Undo/Redo is in TextBase.cpp -> void TextBase::undoChangeProperty around line 3511.
The Properties panel listens for ChangeProperty notifications from the Undo/Redo engine, but in the case of the character-specific text properties, the Undo/Redo engine creates ChangeTextProperties undo/redo commands instead. When editing a text object and moving the cursor in it, TextSettingsModel reacts to textEditingChanged notifications from the notation and updates the text properties properly. However, something is missing for when the text object is selected and manipulated as a whole without editing the text (e.g. making the the entire text object bold) and when doing an undo or redo. As a result the Properties panel does not update the text properties.
Supporting files, videos and screenshots
The steps to reproduce should be sufficient.
What is the latest version of MuseScore Studio where this issue is present?
4.4.3
Regression
No.
Operating system
Windows 10
Additional context
No response
Checklist
- This report follows the guidelines for reporting bugs and issues
- I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
- I have attached all requested files and information to this report
- I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in TextBase.cpp at TextBase::undoChangeProperty around line 3511, then trace ChangeTextProperties notifications and TextSettingsModel handling of textEditingChanged. Reproduce the issue with whole-object changes to font name, style, size, and subscript/superscript, and verify the Properties panel updates after both Undo and Redo. Also check the previously fixed whole-object text properties listed in the issue as QA coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100