Author: axeld Date: 2010-05-07 13:29:41 +0200 (Fri, 07 May 2010) New Revision: 36714 Changeset: http://dev.haiku-os.org/changeset/36714/haiku Modified: haiku/trunk/src/kits/interface/Window.cpp Log: * Made zooming to full screen center the window when the window cannot be made full screen (due to size restrictions). Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2010-05-07 11:24:25 UTC (rev 36713) +++ haiku/trunk/src/kits/interface/Window.cpp 2010-05-07 11:29:41 UTC (rev 36714) @@ -1681,14 +1681,18 @@ BPoint zoomedLeftTop = screen.Frame().LeftTop() + BPoint(borderWidth, tabHeight + borderWidth); + // Center if window cannot be made full screen + if (screenWidth > zoomedWidth) + zoomedLeftTop.x += (screenWidth - zoomedWidth) / 2; + if (screenHeight > zoomedHeight) + zoomedLeftTop.y += (screenHeight - zoomedHeight) / 2; // Un-Zoom if (fPreviousFrame.IsValid() // NOTE: don't check for fFrame.LeftTop() == zoomedLeftTop // -> makes it easier on the user to get a window back into place - && fFrame.Width() == zoomedWidth - && fFrame.Height() == zoomedHeight) { + && fFrame.Width() == zoomedWidth && fFrame.Height() == zoomedHeight) { // already zoomed! Zoom(fPreviousFrame.LeftTop(), fPreviousFrame.Width(), fPreviousFrame.Height());