A little cleanup.
This commit is contained in:
parent
6ccec45c61
commit
29abba824d
2 changed files with 18 additions and 16 deletions
4
atom.gyp
4
atom.gyp
|
@ -150,12 +150,12 @@
|
||||||
'atom/browser/ui/views/global_menu_bar_x11.h',
|
'atom/browser/ui/views/global_menu_bar_x11.h',
|
||||||
'atom/browser/ui/views/menu_bar.cc',
|
'atom/browser/ui/views/menu_bar.cc',
|
||||||
'atom/browser/ui/views/menu_bar.h',
|
'atom/browser/ui/views/menu_bar.h',
|
||||||
'atom/browser/ui/views/submenu_button.cc',
|
|
||||||
'atom/browser/ui/views/submenu_button.h',
|
|
||||||
'atom/browser/ui/views/menu_delegate.cc',
|
'atom/browser/ui/views/menu_delegate.cc',
|
||||||
'atom/browser/ui/views/menu_delegate.h',
|
'atom/browser/ui/views/menu_delegate.h',
|
||||||
'atom/browser/ui/views/menu_layout.cc',
|
'atom/browser/ui/views/menu_layout.cc',
|
||||||
'atom/browser/ui/views/menu_layout.h',
|
'atom/browser/ui/views/menu_layout.h',
|
||||||
|
'atom/browser/ui/views/submenu_button.cc',
|
||||||
|
'atom/browser/ui/views/submenu_button.h',
|
||||||
'atom/browser/ui/views/win_frame_view.cc',
|
'atom/browser/ui/views/win_frame_view.cc',
|
||||||
'atom/browser/ui/views/win_frame_view.h',
|
'atom/browser/ui/views/win_frame_view.h',
|
||||||
'atom/browser/ui/win/notify_icon_host.cc',
|
'atom/browser/ui/win/notify_icon_host.cc',
|
||||||
|
|
|
@ -572,22 +572,24 @@ void NativeWindowViews::HandleKeyboardEvent(
|
||||||
const content::NativeWebKeyboardEvent& event) {
|
const content::NativeWebKeyboardEvent& event) {
|
||||||
keyboard_event_handler_->HandleKeyboardEvent(event, GetFocusManager());
|
keyboard_event_handler_->HandleKeyboardEvent(event, GetFocusManager());
|
||||||
|
|
||||||
if (menu_bar_) {
|
if (!menu_bar_)
|
||||||
// Toggle accelerator when "Alt" is pressed.
|
return;
|
||||||
if (menu_bar_visible_ && IsAltKey(event))
|
|
||||||
menu_bar_->SetAcceleratorVisibility(
|
|
||||||
event.type == blink::WebInputEvent::RawKeyDown);
|
|
||||||
|
|
||||||
// Show the submenu when "Alt+Key" is pressed.
|
// Show accelerator when "Alt" is pressed.
|
||||||
if (event.type == blink::WebInputEvent::RawKeyDown && !IsAltKey(event) &&
|
if (menu_bar_visible_ && IsAltKey(event))
|
||||||
IsAltModifier(event)) {
|
menu_bar_->SetAcceleratorVisibility(
|
||||||
if (!menu_bar_visible_ &&
|
event.type == blink::WebInputEvent::RawKeyDown);
|
||||||
(menu_bar_->GetAcceleratorIndex(event.windowsKeyCode) != -1)) {
|
|
||||||
SetMenuBarVisibility(true);
|
// Show the submenu when "Alt+Key" is pressed.
|
||||||
Layout();
|
if (event.type == blink::WebInputEvent::RawKeyDown && !IsAltKey(event) &&
|
||||||
}
|
IsAltModifier(event)) {
|
||||||
menu_bar_->ActivateAccelerator(event.windowsKeyCode);
|
if (!menu_bar_visible_ &&
|
||||||
|
(menu_bar_->GetAcceleratorIndex(event.windowsKeyCode) != -1)) {
|
||||||
|
SetMenuBarVisibility(true);
|
||||||
|
Layout();
|
||||||
}
|
}
|
||||||
|
menu_bar_->ActivateAccelerator(event.windowsKeyCode);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!menu_bar_autohide_)
|
if (!menu_bar_autohide_)
|
||||||
|
|
Loading…
Reference in a new issue