Use the new CenterOnScreen function to center the window.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33425 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2009-10-04 19:48:03 +00:00
parent 14235a805c
commit 3e1f071c14

View File

@ -84,13 +84,7 @@ BatteryInfoView::GetPreferredSize(float* width, float* height)
void
BatteryInfoView::AttachedToWindow()
{
BRect rect = BScreen().Frame();
BRect windowFrame = Window()->Frame();
BPoint position;
// center window on screen
position.x = (rect.Width() - windowFrame.Width()) / 2;
position.y = (rect.Height() - windowFrame.Height()) / 2;
Window()->MoveTo(position);
Window()->CenterOnScreen();
}