BWindow: default Zoom() maximizes window when shift held down

In hrev51623 the default BWindow::Zoom() method was changed to respect
Deskbar, that is to say that the Window will zoom to screen area minus
the area taken up by Deskbar.

Some have complained that they miss the old maximize to full screen
frame behavior. This commit updates the default BWindow::Zoom() method
so that pressing Shift+zoom will maximize the window ignoring Deskbar,
the window will resize itself to take up the entire screen frame.

Note that if you override Zoom() in your app window then shift+zoom
will no longer work, this trick only works for apps which use the
default BWindow::Zoom() method.

Change-Id: Ic9f8fcb54f58663663db737103f6a7b42171ef46
This commit is contained in:
John Scipione 2018-07-23 17:22:45 -07:00 committed by waddlesplash
parent 0fe68ab92c
commit fb7812fab0
1 changed files with 3 additions and 2 deletions

View File

@ -1705,8 +1705,9 @@ BWindow::Zoom()
BDeskbar deskbar;
BRect deskbarFrame = deskbar.Frame();
if (!deskbar.IsAutoHide()) {
// remove area taken up by Deskbar (if not auto-hidden)
bool isShiftDown = (modifiers() & B_SHIFT_KEY) != 0;
if (!isShiftDown && !deskbar.IsAutoHide()) {
// remove area taken up by Deskbar unless hidden or shift is held down
switch (deskbar.Location()) {
case B_DESKBAR_TOP:
zoomArea.top = deskbarFrame.bottom + 2;