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:
parent
14235a805c
commit
3e1f071c14
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user