From 33eed03081e39a0d013631c9e5f4c03b321ea4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Thu, 1 Oct 2009 23:03:48 +0000 Subject: [PATCH] Simplified use of CenterOnScreen(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33406 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/installer/InstallerWindow.cpp | 18 +----------------- src/apps/installer/InstallerWindow.h | 2 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp index 7c20e58ae6..a1378e46f2 100644 --- a/src/apps/installer/InstallerWindow.cpp +++ b/src/apps/installer/InstallerWindow.cpp @@ -145,7 +145,6 @@ layout_item_for(BView* view) InstallerWindow::InstallerWindow() : BWindow(BRect(-2000, -2000, -1800, -1800), "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS), - fNeedsToCenterOnScreen(true), fEncouragedToSetupPartitions(false), fDriveSetupLaunched(false), fInstallStatus(kReadyForInstall), @@ -269,6 +268,7 @@ InstallerWindow::InstallerWindow() if (!be_roster->IsRunning(kDeskbarSignature)) SetFlags(Flags() | B_NOT_MINIMIZABLE); + CenterOnScreen(); Show(); fDriveSetupLaunched = be_roster->IsRunning(DRIVESETUP_SIG); @@ -291,22 +291,6 @@ InstallerWindow::~InstallerWindow() } -void -InstallerWindow::FrameResized(float width, float height) -{ - BWindow::FrameResized(width, height); - - if (fNeedsToCenterOnScreen) { - // We have created ourselves off-screen, since the size adoption - // because of the layout management may happen after Show(). We - // assume that the first frame event is because of this adoption and - // move ourselves to the screen center... - fNeedsToCenterOnScreen = false; - CenterOnScreen(); - } -} - - void InstallerWindow::MessageReceived(BMessage *msg) { diff --git a/src/apps/installer/InstallerWindow.h b/src/apps/installer/InstallerWindow.h index 4c650619a8..1dbcaaecb6 100644 --- a/src/apps/installer/InstallerWindow.h +++ b/src/apps/installer/InstallerWindow.h @@ -45,7 +45,6 @@ public: InstallerWindow(); virtual ~InstallerWindow(); - virtual void FrameResized(float width, float height); virtual void MessageReceived(BMessage* message); virtual bool QuitRequested(); @@ -88,7 +87,6 @@ private: BButton* fSetupButton; BButton* fMakeBootableButton; - bool fNeedsToCenterOnScreen; bool fEncouragedToSetupPartitions; bool fDriveSetupLaunched;