-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #21572: Changing color of beamed chords should only change the elements within selection #23895
Fix #21572: Changing color of beamed chords should only change the elements within selection #23895
Conversation
@@ -96,6 +99,8 @@ void AppearanceSettingsModel::requestElements() | |||
} | |||
} | |||
m_elementsForOffsetProperty = elementsForOffsetProperty.values(); | |||
|
|||
m_elementsForColorProperty = QList<EngravingItem*>(selection()->elements().begin(), selection()->elements().end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid it's not safe to just take all the selected elements. This may contain things like InstrumentNames and Brackets, and those are not really safe to work with in the Inspector. See also ElementRepositoryService::exposeRawElements
, where such elements are filtered.
A better solution, albeit slightly more difficult perhaps, would be to revise the fact that ElementRepositoryService::exposeRawElements
(and thus ElementRepositoryService::takeAllElements()
) includes all Chords when a Beam is selected. I don't see why that's desirable, and I do think it's causing trouble here.
So, what I would propose is:
- Check where
takeAllElements
is used, and verify whether it is not harmful to remove those extraChords
from it - Remove those lines from
exposeRawElements
that add those extra chords - Check how this affects other methods inside
ElementsRepositoryService
that usem_exposedElementList
. In cases where this changes the behaviour of those methods, consider whether adjustments need to be made to counter that change, or that the new behaviour is an improvement.
And ideally, report your findings of each step here, because that makes it much easier to provide proper testing and feedback. Thanks!
Thanks a lot for the info. I tried to track down the reasoning behind adding the extra chords connected by the beam (it was added in #6149). These extra chords are probably added so that when a beam is selected, you can also change the settings for the stems attached to it in the inspector, which I think is good. I tried removing those lines, and as far as I can tell, this is probably unwanted behavior for the 3 places that use
So far, it looks like these including these extra chords are not desirable, but simply removing these lines also cause the settings for note stem and beam to gray out when only a beam is selected. I'll continue to look more into this and see how other stuff that uses |
This reverts commit f2d89b7.
73684ce
to
6b09fa4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest version looks very good to me! I have two small suggestions.
@oktophonie It would be good to re-test this, because now it will have slightly more effects; but only positive ones (hopefully)!
For reference, I've removed the extra ChordRests from
I have moved the code that adds the extra chords from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Resolves: #21572
Changing the color of a range selection now only affects the highlighted elements (i.e. those in
selection()
), instead of every note in the beamed chords (i.e.m_elementList
, which the leading space etc settings use). This seems to be the behavior in MS3.Change color of selection ->