Fixed centering of the window in case of multiple screens.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16296 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2006, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "OpenWindow.h"
|
#include "OpenWindow.h"
|
||||||
@@ -62,9 +62,9 @@ OpenWindow::OpenWindow()
|
|||||||
button->MoveBy(-button->Bounds().Width() - 8, 0);
|
button->MoveBy(-button->Bounds().Width() - 8, 0);
|
||||||
view->AddChild(button);
|
view->AddChild(button);
|
||||||
|
|
||||||
BScreen screen;
|
BScreen screen(this);
|
||||||
MoveTo((screen.Frame().Width() - Frame().Width()) / 2,
|
MoveTo(screen.Frame().left + (screen.Frame().Width() - Frame().Width()) / 2,
|
||||||
(screen.Frame().Height() - Frame().Height()) / 2);
|
screen.Frame().top + (screen.Frame().Height() - Frame().Height()) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user