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

Fix #19987 Menu Navigation not working with Left/Right arrows #20191

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

NinjaNas
Copy link
Contributor

@NinjaNas NinjaNas commented Nov 25, 2023

Resolves: #19987

Add a force close upon using Right Arrow on a non-submenu item
Use signals when appropriate to invoke openPrevMenu/openNextMenu
Add hasSiblingMenus property to allow context menus using the StyledMenu class to be closed using left/right arrow key

  • 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)

Copy link
Contributor

@Eism Eism left a comment

Choose a reason for hiding this comment

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

Just tested your solution - looks good.
Only need to fix my comments. I also see that navigating left/right from the submenu does not work.

@NinjaNas
Copy link
Contributor Author

NinjaNas commented Nov 27, 2023

I also see that navigating left/right from the submenu does not work.

Unless this is a typo, navigating from the sub menu does work when I tested.

@NinjaNas
Copy link
Contributor Author

Hi, I updated the pull request again. Could I get someone to rereview the pull request for me?


void NavigableAppMenuModel::openNextMenu()
{
restoreMUNavigationSystemState();
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this shouldn't be here
When switching menus, the navigation will blink

@NinjaNas
Copy link
Contributor Author

NinjaNas commented May 7, 2024

@Eism Hmmm... I added that because it seem to fix the NDVA issue but I do see the blinking issue now. It definitely need some more work that I don't really know how to fix right now. I will just remove that line of code and make a different issue since this isn't in the scope of the current one.

Without restoreMUNavigationSystemState(); NDVA acts like this (4.3.0 acts similarly):

2024-05-07.13-55-20.mp4

With restoreMUNavigationSystemState(); NDVA acts like this:

2024-05-07.13-59-50.mp4

@DmitryArefiev
Copy link
Contributor

@NinjaNas Can you rebase please?

@NinjaNas
Copy link
Contributor Author

@DmitryArefiev Rebased

@DmitryArefiev
Copy link
Contributor

DmitryArefiev commented Aug 19, 2024

Tested on Win10.
It works fine when navigating. But when using screen reader (accessibility), it moves to the next submenu without announcing the group name (e.g. File->Edit)

bandicam.2024-08-19.14-25-07-332.mp4

@NinjaNas @Eism @shoogle Can we add ability to read the next group name after moving with right/left arrows?
I have concern that accessibility users already used to have right/left arrow behavior as up/right in Menu panel

@DmitryArefiev
Copy link
Contributor

There is also a change in Context menu navigating behavior with arrows (left arrow doesn't return from submenu, only with Esc):

bandicam.2024-08-19.16-03-46-216.mp4

@shoogle
Copy link
Contributor

shoogle commented Aug 19, 2024

@DmitryArefiev, I agree the menu name should be spoken, but I think that's a separate issue. The menu name is also not spoken if you press Alt+F for example. While not ideal, I think blind users will work out what is going on. @NinjaNas, you are welcome to fix that in this PR or leave it if you prefer, but I think you should definitely re-enable closing submenus with the Left arrow key in this PR.

Copy link
Contributor

@Eism Eism left a comment

Choose a reason for hiding this comment

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

perhaps these changes will help solve the problem with the context menu

@NinjaNas
Copy link
Contributor Author

This was not the cause of the context menu problem, however I made those changes to make the code clearer.

I assume property bool hasSiblingMenus: "" is supposed to be property bool hasSiblingMenus: root.hasSiblingMenus, since a qml bool cannot be an empty string.

The fix was just to move root.close() outside of the if statement for the left arrow button. I think originally, I did not have an if statement so it was opening other menus (other than the AppMenuBar) that it was not supposed to instead of just closing them.

root.close()

if(root.hasSiblingMenus) {
    root.openPrevMenu()
}

@Eism
Copy link
Contributor

Eism commented Aug 19, 2024

@NinjaNas

#20191 (comment) is supposed to be property bool hasSiblingMenus: root.hasSiblingMenus, since a qml bool cannot be an empty string.

Yeah, my bad. I meant property bool hasSiblingMenus: false

Add a force close upon using Right Arrow on a non-submenu item
Use signals when appropriate to invoke openPrevMenu/openNextMenu
Add hasSiblingMenus property to allow context menus using the StyledMenu class to be closed using left/right arrow key
@NinjaNas
Copy link
Contributor Author

@Eism

Yeah, my bad. I meant property bool hasSiblingMenus: false

I see how using false would be better in this case.

@NinjaNas
Copy link
Contributor Author

@shoogle I will leave the screen reader issue to you guys.

@DmitryArefiev
Copy link
Contributor

DmitryArefiev commented Aug 20, 2024

Tested #24102 on Win10, Mac13.6, LinuxUbuntu22.04. FIXED

Closing submenus with the Left arrow key is also FIXED now

I agree the menu name should be spoken, but I think that's a separate issue. The menu name is also not spoken if you press Alt+F for example. While not ideal, I think blind users will work out what is going on.

@shoogle Do you think we can merge it to 4.4 now? or wait until this will be implemented in 4.5?

FYI @bkunda

@Eism Eism merged commit 60213b6 into musescore:master Aug 20, 2024
11 checks passed
RomanPudashkin pushed a commit to RomanPudashkin/MuseScore that referenced this pull request Aug 20, 2024
Fix musescore#19987 Menu Navigation not working with Left/Right arrows
@RomanPudashkin RomanPudashkin mentioned this pull request Aug 20, 2024
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.

Menu Navigation not working with Left/Right arrows (behave like Up/Down arrows)
4 participants