fix: keep shifted character in menu accelerator (#29202)

* fix: correctly handle shifted char in accelerator

* test: use actual accelerator of NSMenuItem

* chore: simplify KeyboardCodeFromStr

* chore: GetAcceleratorTextAt is testing only
This commit is contained in:
Cheng Zhao 2021-06-02 16:32:48 +09:00 committed by GitHub
parent 31190d4c6d
commit 3cfe5c6a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 168 additions and 83 deletions

View file

@ -34,11 +34,14 @@ class MenuMac : public Menu {
int positioning_item,
base::OnceClosure callback);
void ClosePopupAt(int32_t window_id) override;
void ClosePopupOnUI(int32_t window_id);
#ifdef DCHECK_IS_ON
std::u16string GetAcceleratorTextAtForTesting(int index) const override;
#endif
private:
friend class Menu;
void ClosePopupOnUI(int32_t window_id);
void OnClosed(int32_t window_id, base::OnceClosure callback);
scoped_nsobject<ElectronMenuController> menu_controller_;