-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
The Apple Human Interface Guidelines give a specific ordering of the symbols used as modifier keys in menu shortcuts. These guidelines are encoded into the native Cocoa or UIKit menu classes, and are intended to ensure that symbols are always aligned into columns of like symbols. This ordering is, from left to right: ⌃, ⎇, ⇧, ⌘.
Currently, MenuItemButton uses a different ordering across all platforms, including Mac and iOS: ⎇, ⌃, ⌘, ⇧. This violates the HIG, particularly since a shortcut like ⌘⇧S (which should be ⇧⌘S) does not align vertically with a shortcut like ⌘S. Native menus also allocate a fixed amount of space for the shortcut trigger so that the shortcuts align perfectly, which MenuItemButton does not.
Expected results
Code like this:
MenuItemButton(
shortcut: SingleActivator(
LogicalKeyboardKey.keyS,
control: true,
meta: true,
shift: true,
alt: true,
),
child: Text('Reticulate Splines'),
),Should result in a menu item with a visual appearance, on Mac or iOS, like this:
Reticulate Splines ⌃⎇⇧⌘S
Which conforms to the Apple HIG.
Actual results
Code like this:
MenuItemButton(
shortcut: SingleActivator(
LogicalKeyboardKey.keyS,
control: true,
meta: true,
shift: true,
alt: true,
),
child: Text('Reticulate Splines'),
),Results in a menu item with a visual appearance, on Mac or iOS, like this:
Reticulate Splines ⎇⌃⌘⇧S
which does not conform to the Apple HIG.
Code sample
Code sample
MaterialApp(
home: Material(
child: MenuBar(
children: <Widget>[
SubmenuButton(
menuChildren: <Widget>[
MenuItemButton(
shortcut: SingleActivator(
LogicalKeyboardKey.keyS,
control: true,
meta: true,
shift: true,
alt: true,
),
child: Text('Reticulate Splines'),
),
],
child: Text('File'),
),
],
),
),
),Screenshots or Video
No response
Logs
No response
Flutter Doctor output
N/A