Skip to content

fix(menubar): cycle through flyouts when different menu items are hovered - #13918

Closed
ramezgerges wants to merge 3 commits into
unoplatform:masterfrom
ramezgerges:menubar_hover_flyout
Closed

ramezgerges wants to merge 3 commits into
unoplatform:masterfrom
ramezgerges:menubar_hover_flyout

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Oct 6, 2023 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #13826

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

What is the new behavior?

Copilot Summary

🤖 Generated by Copilot at 14de648

This pull request improves the mouse interaction with the MenuBar and MenuBarItem controls by adding and handling pointer moved events. This allows the user to navigate the menu bar items using the mouse pointer as if they were using the keyboard. This also fixes a bug where the menu bar items do not open or close properly when the mouse pointer moves over them.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):


internal bool IsFlyoutOpen { get; set; }

internal void OnMenuBarItemFlyoutPresenterPointerMoved(PointerRoutedEventArgs e)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a comment that this is a workaround for lack of support of OverlayInputPassThroughElement? So that once OverlayInputPassThroughElement is properly implemented, we can properly implement this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ramezgerges If it is, does the PR for #12681 remove need for this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I suppose it would. We would still need to add the logic for opening and closing the flyouts, but it will be in the PointerEntered and PointerExited of each menu item instead of PointerMoved of the flyout.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ramezgerges The logic for that is already in place

private void OnMenuBarItemPointerEntered(object sender, PointerRoutedEventArgs args)
{
if (m_menuBar != null)
{
if (m_menuBar.IsFlyoutOpen)
{
ShowMenuFlyout();
}
}
}

Comment on lines +368 to +372
var menuBar = m_menuBar;
var presenter = m_flyout.m_presenter;
PointerEventHandler pointerMovedHandler = (_, e) => menuBar.OnMenuBarItemFlyoutPresenterPointerMoved(e);
m_flyout._popup.PopupPanel.PointerMoved += pointerMovedHandler;
_menuBarPointerMovedDisposable.Disposable = new DisposableAction(() => presenter.PointerMoved -= pointerMovedHandler);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This block of code should be marked Uno specific too, with a comment indicating that this is a workaround for the lack of OverlayInputPassThroughElement

@ramezgerges

ramezgerges commented Dec 25, 2023 •

Copy link
Copy Markdown
Contributor Author

Currently blocked (as in, waiting to see if we need this hack or not) by #13968

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jan 30, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions Bot closed this Feb 10, 2025
@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Apr 20, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Menubar] Hovering cursor from one menu Item to another Menu item is not opening it

4 participants