* Made zooming to full screen center the window when the window cannot be made
full screen (due to size restrictions). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36714 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cac9f196d8
commit
5396d90d16
@ -1681,14 +1681,18 @@ BWindow::Zoom()
|
|||||||
|
|
||||||
BPoint zoomedLeftTop = screen.Frame().LeftTop() + BPoint(borderWidth,
|
BPoint zoomedLeftTop = screen.Frame().LeftTop() + BPoint(borderWidth,
|
||||||
tabHeight + 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
|
// Un-Zoom
|
||||||
|
|
||||||
if (fPreviousFrame.IsValid()
|
if (fPreviousFrame.IsValid()
|
||||||
// NOTE: don't check for fFrame.LeftTop() == zoomedLeftTop
|
// NOTE: don't check for fFrame.LeftTop() == zoomedLeftTop
|
||||||
// -> makes it easier on the user to get a window back into place
|
// -> makes it easier on the user to get a window back into place
|
||||||
&& fFrame.Width() == zoomedWidth
|
&& fFrame.Width() == zoomedWidth && fFrame.Height() == zoomedHeight) {
|
||||||
&& fFrame.Height() == zoomedHeight) {
|
|
||||||
// already zoomed!
|
// already zoomed!
|
||||||
Zoom(fPreviousFrame.LeftTop(), fPreviousFrame.Width(),
|
Zoom(fPreviousFrame.LeftTop(), fPreviousFrame.Width(),
|
||||||
fPreviousFrame.Height());
|
fPreviousFrame.Height());
|
||||||
|
Loading…
Reference in New Issue
Block a user