Skip to content

CmdPal: Refactoring ContextMenu adding separators, IsCritical styling, and right-click context menus for list items #40189

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

michaeljolley
Copy link
Contributor

@michaeljolley michaeljolley commented Jun 22, 2025

Refactored ContextMenu into it's own control to allow displaying in CommandBar and in response to right click on list items.

  • Adds "critical" styling to context menu items flagged as IsCritical. This will use the theme to style with correct color.
  • Added SeparatorContextItem and modified MoreCommands to allow for both CommandContextItems and SeparatorContextItems.
  • Right clicking a list item with a context menu will open the context menu at the position of the click and position the filter box at the top of the context menu.

image

image

This PR covers:

@michaeljolley michaeljolley changed the title Dev/mjolley/context menu refactor Refactoring ContextMenu adding separators, IsCritical styling, and right-click context menus for list items Jun 22, 2025
@michaeljolley michaeljolley changed the title Refactoring ContextMenu adding separators, IsCritical styling, and right-click context menus for list items CmdPal: Refactoring ContextMenu adding separators, IsCritical styling, and right-click context menus for list items Jun 22, 2025
@michaeljolley michaeljolley added the Product-Command Palette Refers to the Command Palette utility label Jun 23, 2025
@michaeljolley michaeljolley marked this pull request as ready for review June 25, 2025 20:48
@michaeljolley michaeljolley self-assigned this Jun 25, 2025
HorizontalAlignment="Left"
SourceKey="{x:Bind Icon, Mode=OneWay}"
SourceRequested="{x:Bind help:IconCacheProvider.SourceRequested}" />
<TextBlock
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to this PR.. do we need to set the text trimming here (and to default to ...) in case the text is really long? Not sure how a default ContextMenu handles this? I guess we wouldn't want textwrapping and stick to a single line

@michaeljolley michaeljolley added this to the PowerToys 0.93 milestone Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Command Palette Refers to the Command Palette utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants