Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

fix: don't append Shift modifier text twice to accelerators #698

Merged
merged 2 commits into from Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions patches/common/chromium/accelerator.patch
@@ -1,5 +1,5 @@
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 0694f7433df5..7df31b1919e6 100644
index 0694f7433df5..a22ef96a7307 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -9,6 +9,7 @@
Expand Down Expand Up @@ -35,7 +35,7 @@ index 0694f7433df5..7df31b1919e6 100644
#if defined(OS_WIN)
// Our fallback is to try translate the key code to a regular character
// unless it is one of digits (VK_0 to VK_9). Some keyboard
@@ -219,20 +225,18 @@ base::string16 Accelerator::GetShortcutText() const {
@@ -219,18 +225,14 @@ base::string16 Accelerator::GetShortcutText() const {
// accent' for '0'). For display in the menu (e.g. Ctrl-0 for the
// default zoom level), we leave VK_[0-9] alone without translation.
wchar_t key;
Expand All @@ -59,12 +59,8 @@ index 0694f7433df5..7df31b1919e6 100644
+ base::StringPrintf("F%d", key_code_ - VKEY_F1 + 1));
} else {
shortcut = l10n_util::GetStringUTF16(string_id);
+ if (IsShiftDown())
+ shortcut = l10n_util::GetStringFUTF16(IDS_APP_SHIFT_MODIFIER, shortcut);
}

// Checking whether the character used for the accelerator is alphanumeric.
@@ -255,7 +259,8 @@ base::string16 Accelerator::GetShortcutText() const {
@@ -255,7 +257,8 @@ base::string16 Accelerator::GetShortcutText() const {
// more information.
if (IsCtrlDown())
shortcut = l10n_util::GetStringFUTF16(IDS_APP_CONTROL_MODIFIER, shortcut);
Expand Down