The alert window position code now also takes an eventual screen offset into account.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17537 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
517dfdf48b
commit
dc052c4305
@ -428,15 +428,15 @@ BAlert::AlertPosition(float width, float height)
|
|||||||
dynamic_cast<BWindow*>(BLooper::LooperForThread(find_thread(NULL)));
|
dynamic_cast<BWindow*>(BLooper::LooperForThread(find_thread(NULL)));
|
||||||
|
|
||||||
BScreen screen(window);
|
BScreen screen(window);
|
||||||
BRect screenRect(0, 0, 640, 480);
|
BRect screenFrame(0, 0, 640, 480);
|
||||||
if (screen.IsValid())
|
if (screen.IsValid())
|
||||||
screenRect = screen.Frame();
|
screenFrame = screen.Frame();
|
||||||
|
|
||||||
// Horizontally, we're smack in the middle
|
// Horizontally, we're smack in the middle
|
||||||
result.x = (screenRect.Width() / 2.0) - (width / 2.0);
|
result.x = screenFrame.left + (screenFrame.Width() / 2.0) - (width / 2.0);
|
||||||
|
|
||||||
// This is probably sooo wrong, but it looks right on 1024 x 768
|
// This is probably sooo wrong, but it looks right on 1024 x 768
|
||||||
result.y = (screenRect.Height() / 4.0) - ceil(height / 3.0);
|
result.y = screenFrame.top + (screenFrame.Height() / 4.0) - ceil(height / 3.0);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user