Skip to content
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

26583: Percussion Pads context menu refinements #26605

Conversation

krasko78
Copy link
Contributor

Resolves: #26583

Key Points:

  1. Replaced StyledMenuLoader with ContextMenuLoader.
  2. The coordinates of the click are now passed to the loader in the show() method.
  3. Moved the loader outside of the footer and into the entire pad. Technically this was not needed for things to work but I figured it made sense.
  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@avvvvve
Copy link

avvvvve commented Feb 19, 2025

@krasko78 lovely, thanks!
@mathesoncalum please code review

Copy link
Contributor

@mathesoncalum mathesoncalum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much @krasko78 - looks good!

My only question is about opening the context menu via the keyboard. If you look at padContent in PercussionPanelPad.qml, a connection is made between onTriggered and openFooterContextMenu.

I'm guessing this doesn't work with these new changes as we don't pass it a pos argument? (or maybe it does, but we'll probably get some warnings).

@avvvvve
Copy link

avvvvve commented Feb 19, 2025

@krasko78 Actually, one more request while we're in here. In the context menu, could we change 'Delete' to 'Delete pad' as Marc suggested here?

@avvvvve
Copy link

avvvvve commented Feb 19, 2025

Ah, you're right @mathesoncalum, I can't "press" the footer button now when it's focused using space/enter like I can in the Nightly build.

(In the video where it says "4.4" I meant to write "Nightly", whoops)

Screen.Recording.2025-02-19.at.5.46.15.PM.mov

@krasko78
Copy link
Contributor Author

@mathesoncalum I've missed that, thanks! I'll fix it.
@avvvvve Speaking of further tweaks, I was wondering if "Define keyboard shortcut" should have an ellipsis at the end since it opens a new dialog?

@krasko78 krasko78 force-pushed the 26583-PercussionPads-ContextMenuRefinements branch from 8e2b207 to 9bbf3cc Compare February 20, 2025 12:26
@krasko78
Copy link
Contributor Author

@mathesoncalum @avvvvve I've pushed a fix for the broken context menu activation with the keyboard and changed "Delete" to "Delete pad". Also removed 'footer' from names related to the context menu as the context menu is not footer-specific any more.

I also noticed that the pad could not be activated with the keyboard. This was not related to my changes but I decided to fix it too. In PercussionPanelPad.qml on line 100 when triggerPad() on the model was called, it was missing the keyboard modifiers as a parameter. I added ui.keyboardModifiers() and it worked. However, I noticed that pressing Space/Enter with a modifier key does not trigger the active control. This means that it is not possible to Shift+Ctrl/Meta + Space/Enter on a pad to accomplish the same as Shift+Ctrl/Meta+click works. This is probably a separate topic.

If there is nothing else, I believe the only thing left here is for Ben to tell me about the ellipsis.

Copy link
Contributor

@mathesoncalum mathesoncalum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @krasko78.

On your point about triggerPad - I opened PR #26616 earlier to address this. I prefer the method used over there because the onTriggered signal in padNavCtrl simply isn't called if a modifier is held, so the ui.keyboardModifiers() bit ends up being redundant.

Indeed this is something we might look to address if we want to support "add to chord" and "insert" functionality using a modifier + space, but let's keep it simple for now.

@krasko78 krasko78 force-pushed the 26583-PercussionPads-ContextMenuRefinements branch from 9bbf3cc to ebbd62a Compare February 20, 2025 13:24
@krasko78
Copy link
Contributor Author

@mathesoncalum Sounds good. I've removed my change around the modifiers. :)

Copy link
Contributor

@mathesoncalum mathesoncalum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff - thanks for the quick turnaround! ⚡️

@avvvvve
Copy link

avvvvve commented Feb 20, 2025

@krasko78 looks great! you are right that it should be "Define keyboard shortcut..." with the ellipse. mind swapping that in?

otherwise @zacjansheski mind giving this a test too?

@avvvvve avvvvve requested a review from zacjansheski February 20, 2025 14:30
@krasko78 krasko78 force-pushed the 26583-PercussionPads-ContextMenuRefinements branch 2 times, most recently from a4ce1f8 to 784a3fd Compare February 20, 2025 14:38
@krasko78
Copy link
Contributor Author

There we go! Ellipsis added.

@krasko78
Copy link
Contributor Author

@zacjansheski Hold on please, the ellipsis is rendered weirdly in Windows. I am looking...

@krasko78 krasko78 force-pushed the 26583-PercussionPads-ContextMenuRefinements branch from 784a3fd to 1890189 Compare February 20, 2025 15:25
@krasko78
Copy link
Contributor Author

Something with the encoding of one particular source file was not quite right. Should be OK now.

@zacjansheski
Copy link
Contributor

Tested on MacOS 15, Windows 11, Ubuntu 22.04.3. Approved
#26583 FIXED

@mathesoncalum mathesoncalum merged commit b6d9702 into musescore:master Feb 20, 2025
11 checks passed
@krasko78 krasko78 deleted the 26583-PercussionPads-ContextMenuRefinements branch February 20, 2025 22:22
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.

Percussion pads: context menu refinements
4 participants