Merge pull request #9213 from electron/fix-autohide-menubar-layout

Actually hide menubar area when menu is autohidden
This commit is contained in:
Birunthan Mohanathas 2017-04-17 12:34:23 +03:00 committed by GitHub
commit 226c1c99a6

View file

@ -1267,7 +1267,8 @@ void NativeWindowViews::HandleKeyboardEvent(
void NativeWindowViews::Layout() { void NativeWindowViews::Layout() {
const auto size = GetContentsBounds().size(); const auto size = GetContentsBounds().size();
const auto menu_bar_bounds = const auto menu_bar_bounds =
menu_bar_ ? gfx::Rect(0, 0, size.width(), kMenuBarHeight) : gfx::Rect(); menu_bar_visible_ ? gfx::Rect(0, 0, size.width(), kMenuBarHeight)
: gfx::Rect();
if (menu_bar_) { if (menu_bar_) {
menu_bar_->SetBoundsRect(menu_bar_bounds); menu_bar_->SetBoundsRect(menu_bar_bounds);
} }