From 3e1f071c149ae03a65ab8f6240eb67a86c166ce6 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Sun, 4 Oct 2009 19:48:03 +0000 Subject: [PATCH] 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 --- src/apps/powerstatus/ExtendedInfoWindow.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/apps/powerstatus/ExtendedInfoWindow.cpp b/src/apps/powerstatus/ExtendedInfoWindow.cpp index 4fc5e7aa0e..dd04119cac 100644 --- a/src/apps/powerstatus/ExtendedInfoWindow.cpp +++ b/src/apps/powerstatus/ExtendedInfoWindow.cpp @@ -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(); }