The shutdown window now uses the same placement method like BAlerts.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17542 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
42c1d42429
commit
4e65a2073d
@ -403,16 +403,12 @@ public:
|
|||||||
rootView->ResizeTo(width - 1, height - 1);
|
rootView->ResizeTo(width - 1, height - 1);
|
||||||
ResizeTo(width - 1, height - 1);
|
ResizeTo(width - 1, height - 1);
|
||||||
|
|
||||||
// center the window on screen
|
// move the window to the same position as BAlerts
|
||||||
BScreen screen;
|
BScreen screen(this);
|
||||||
if (screen.IsValid()) {
|
BRect screenFrame = screen.Frame();
|
||||||
BRect screenFrame = screen.Frame();
|
|
||||||
int screenWidth = screenFrame.IntegerWidth() + 1;
|
MoveTo(screenFrame.left + (screenFrame.Width() - width) / 2.0,
|
||||||
int screenHeight = screenFrame.IntegerHeight() + 1;
|
screenFrame.top + screenFrame.Height() / 4.0 - ceilf(height / 3.0));
|
||||||
MoveTo((screenWidth - width) / 2, (screenHeight - height) / 2);
|
|
||||||
} else {
|
|
||||||
MoveTo(20, 20);
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user