Adjust y position if menu bar is visible

This commit is contained in:
Kevin Sawicki 2016-08-04 13:17:04 -07:00
parent 2a20630f2f
commit dbddf5028a

View file

@ -1164,8 +1164,10 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds)); window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds));
#endif #endif
if (menu_bar_ && menu_bar_visible_) if (menu_bar_ && menu_bar_visible_) {
window_bounds.set_y(window_bounds.y() - kMenuBarHeight);
window_bounds.set_height(window_bounds.height() + kMenuBarHeight); window_bounds.set_height(window_bounds.height() + kMenuBarHeight);
}
return window_bounds; return window_bounds;
} }
@ -1190,8 +1192,10 @@ gfx::Rect NativeWindowViews::WindowBoundsToContentBounds(
display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size())); display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size()));
#endif #endif
if (menu_bar_ && menu_bar_visible_) if (menu_bar_ && menu_bar_visible_) {
content_bounds.set_y(content_bounds.y() + kMenuBarHeight);
content_bounds.set_height(content_bounds.height() - kMenuBarHeight); content_bounds.set_height(content_bounds.height() - kMenuBarHeight);
}
return content_bounds; return content_bounds;
} }