Skip to content

Commit

Permalink
[FilesTrash] Reorder the shortcut for delete
Browse files Browse the repository at this point in the history
The shortcut for Delete is Alt + Backspace and Delete prior to Trash
however when Trash is enabled both commands can be enabled at the same
time. Shortcuts can't be conditionally used, so instead reorder the
shortcuts such that Alt+Backspace and Delete are still used when Trash
is not enabled, however, show to the user Alt+Shift+Backspace to ensure
the visible shortcut works when Trash is enabled.

Fixed: b:261352462
Change-Id: I0151a01213c7347591cf50b930a92d8698079592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4113804
Reviewed-by: Wenbo Jie <wenbojie@chromium.org>
Commit-Queue: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084833}
  • Loading branch information
ben-reich authored and Chromium LUCI CQ committed Dec 19, 2022
1 parent eaa5260 commit cb546ec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ui/file_manager/file_manager/main.html
Expand Up @@ -45,12 +45,7 @@
shortcut="Enter|Ctrl">
<command id="move-to-trash" shortcut="Backspace|Alt Delete" label="$i18n{MOVE_TO_TRASH_BUTTON_LABEL}">
<command id="restore-from-trash" shortcut="Backspace|Alt Delete" label="$i18n{RESTORE_FROM_TRASH_BUTTON_LABEL}">
<!-- TODO(crbug.com/953310): Remove 'Backspace|Alt' and 'Delete' from
'delete' once trash is permanently enabled. For now, these shortcuts
are left for backward-compatibility for when trash is not enabled,
but 'restore-from-trash' intentionally shadows these shortcuts when
trash is enabled -->
<command id="delete" shortcut="Backspace|Alt Delete Backspace|Alt|Shift Delete|Shift">
<command id="delete" shortcut="Backspace|Alt|Shift Delete|Shift Backspace|Alt Delete ">
<command id="empty-trash" shortcut="Backspace|Alt|Ctrl|Shift Delete|Ctrl|Shift" shortcut="" label="$i18n{EMPTY_TRASH_BUTTON_LABEL}">
<command id="refresh" label="$i18n{REFRESH_BUTTON_LABEL}"
shortcut="b|Ctrl" hidden>
Expand Down

0 comments on commit cb546ec

Please sign in to comment.