MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Show element on select/insert/append at start/end of score

Open MarcSabatella opened this issue 2 years ago • 6 comments

Resolves: https://github.com/musescore/MuseScore/issues/14579

The commands to select firs/last element of score, as well as inserting measures/frames/text, do not automatically show the selected element. This change adds the necessary showItem() calls.

  • [x] I signed CLA
  • [x] I made sure the code in the PR follows the coding rules
  • [x] I made sure the code compiles on my machine
  • [x] I made sure there are no unnecessary changes in the code
  • [x] I made sure the title of the PR reflects the core meaning of the issue you are solving
  • [x] I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • [x] I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • [ ] I created the test (mtest, vtest, script test) to verify the changes I made

MarcSabatella avatar Nov 18 '22 18:11 MarcSabatella

I suspect there are other commands that still don't position the score view, but this fixes the ones I've seen reported or that I've noticed myself:

  • Ctrl+Home / Ctrl+End - these select the first or last element, but don't current position the score as they did in MU3
  • Insert measures - inserting at start or end of score did not position view there as it did in MU3
  • Add / Text / Title etc - this adds a frame at the start of the score if necessary and allows to start typing, but again, the view wasn't being positioned there. This also affects ordinary text like staff text or lyrics, which could also sometimes be entered off-screen if the note/measure you had selected was near the edge.

MarcSabatella avatar Nov 18 '22 18:11 MarcSabatella

I'd like to add Shift+Left/Right/Up/Down, also Shift+Ctrl+Left/Right (see https://github.com/musescore/MuseScore/issues/14691), or I could do that in a separate PR. Should just be another call to showItem in addToSelection() in this same file.

MarcSabatella avatar Nov 23 '22 13:11 MarcSabatella

I added it in a second commit - it's just the one line.

MarcSabatella avatar Nov 24 '22 01:11 MarcSabatella

The vtest failure is not due to this PR but to my recently-merged chord symbol formatting change. Not sure how that's supposed to be working. Anyhow, the PR build is working as expected for me.

MarcSabatella avatar Nov 24 '22 04:11 MarcSabatella

This just came up again on Discord. Would be nice to have this merged. As noted, the test failure is not real.

MarcSabatella avatar Dec 16 '22 21:12 MarcSabatella

@MarcSabatella please rebase it

RomanPudashkin avatar Dec 20 '22 11:12 RomanPudashkin

Closed in favor of https://github.com/musescore/MuseScore/pull/15451 - same code but rebased into one commit

MarcSabatella avatar Dec 20 '22 18:12 MarcSabatella