Add: Accessibility Panel - Score Style Preset option
Hi All, This is the PR related to GSoC '24 - Accessibility Profiles project. To check what is goal for this project, kindly refer to: https://musescore.org/en/user/1088561/blog/2024/05/27/gsoc-2024-project-accessibility-profiles-musescore
Current Status of the PR:
UI Changes:
- [x] Add Accessibility Panel
- [x] Add Score style preset dropdown
Backend Changes:
- [x] Add Score style preset dropdown functionality code in the backend
Open Issues: None
Enhancements:
- Update the "Reset" button with the "Three dot menu" option
- [x] I signed the CLA
- [x] The title of the PR describes the problem it addresses
- [x] Each commit's message describes its purpose and effects, and references the issue it resolves
- [x] If changes are extensive, there is a sequence of easily reviewable commits
- [x] The code in the PR follows the coding rules
- [x] There are no unnecessary changes
- [x] The code compiles and runs on my machine, preferably after each commit individually
- [x] I created a unit test or vtest to verify the changes I made (if applicable)
@shoogle Thanks for the review! I have updated this PR. Working on creating the other PR. Cheers!
rebase needed, and I guess, now that #23628 is merged, you can remove those style files from this PR
I have one thought about this project that keeps popping up: should we maybe build the system in such way that it is extensible beyond just these accessibility profiles? From an engraving engine point of view, I find it tempting to generalise the implementation just a little bit further, to a concept of "base style sheets". That might be quite useful. And then the accessibility stylesheet dropdown would be the first application of this functionality, but if we want to expose it in different ways too, that would be easy to achieve.
I'm a bit reluctant to post it, because it is perhaps a bit too late in the project for such insights and I don't want to create too much noise. In the end I'm still going to post it, in case it might be useful, but don't let it disrupt the project. Of course, it may also work to create a non-generalised version now, and generalise it later.
@nasehim7, we came to some more conclusions about saving the style preset in the style file.
-
We always want to save the preset name value in the score file.
-
We never want to revert to "Custom". If the user manually edits some styles via Format > Style, the dropdown text should change to say "Default (edited)", "16mm MSN (edited)", "18mm MSN (edited)", or whatever, rather than "Custom".
-
The "(edited)" item appears as a new option in the dropdown to the non-edited option. So "16mm MSN (edited)" is separate to "16mm MSN".
-
If the user selects any non-edited option, the "(edited)" option disappears from the dropdown.
Finally, an observation: the MSN style files only define values for 174 style tags out of a possible 1532 tags declared in styledef.cpp. This means there are 1358 tags whose values are not defined in the MSN style files.
When determining whether a score is following the MSN style, we only care about the values of the 174 defined tags. We don't care about the values of the 1358 undefined ones.
Let's say the user has selected "16mm MSN" in the score style preset dropdown, and they perform some action (e.g. in Format > Style) that changes the values of some tags. We decided:
-
If the changed tags are only among the 1358 not-defined tags, the dropdown should continue to say "16mm MSN".
-
If the user changes any of the 174 defined tags then the dropdown should change to "16mm MSN (edited)".
-
If the user chooses "Default" from the dropdown, this should only revert the 174 defined tags. The remaining 1358 tags should be entirely unaffected by this dropdown.
To make things simpler for you, I think you should treat any style value changing as "16mm MSN (edited)", and revert all tags when the user chooses "Default" from the dropdown. You can try to restrict it to the 174 later on as an optional extension.
extensible beyond just these accessibility profiles
This is something that has occurred to me as well, and probably @avvvvve too based on his comments about things he would like to do "when we finally do styles properly". But I think it shouldn't happen as part of this project.
@shoogle I see. Few clarifications:
- So for example if the user selected "16mm MSN" then changed some styles through Format > Style, the dropdown should now show - Default, 16mm MSN (edited),..., 25mm MSN, right?
- By this "We always want to save the preset name value in the score file." we mean that for even for default option, we save it in the file like:
<Style preset="Default">
...
</Style>
is it? Okay yeah sure, let me work on it and update here!
@nasehim7 I can answer the first question!
So for example if the user selected "16mm MSN" then changed some styles through Format > Style, the dropdown should now show - Default, 16mm MSN (edited),..., 25mm MSN, right?
The dropdown would show this:
- Default
- 16mm MSN
- 16mm MSN (edited)
- 20mm MSN
- ...
And "16mm MSN (edited)" would be the selected option. As soon as you select a different option in the dropdown, that option would be removed from the list.
Always put the "edited" preset after the original preset in the list. So if your current preset is "20mm MSN (edited)", the list should look like this:
- Default
- 16mm MSN
- 20mm MSN
- 20mm MSN (edited)
- ...
even for default option, we save it in the file
It doesn't matter if you do or you don't.
If the preset value is missing when you read the score, you should assume it is default anyway.
@shoogle Yes Peter! currently I am adding the "edited" capability in the code. Thanks for the information, let me check and update
Need to fix: When an edited option is on the dropdown and the score is saved & restored - the dropdown currently shows the regular preset value and not the edited preset. For example - 18mm MSN (edited) when saved and restored comes to be 18mm MSN
Updated the implementation to handle the edited case in the dropdown (reading and saving). Currently the preset is marked edited for any change done in the style settings