From 37848383ca20e6c25caadbf27049483bb431ce54 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 14 May 2013 17:38:17 -0400 Subject: [PATCH] Terminal: Center Find window in term window frame ... instead of positioning it under the mouse pointer as suggested by Axel. --- src/apps/terminal/TermWindow.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index 073a697279..440bbfada0 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -735,27 +735,7 @@ TermWindow::MessageReceived(BMessage *message) fFindPanel = new FindWindow(this, fFindString, fFindSelection, fMatchWord, fMatchCase, fForwardSearch); - // position the window under the mouse pointer - BPoint where; - uint32 buttons; - ChildAt(0)->GetMouse(&where, &buttons); - fFindPanel->MoveTo(ConvertToScreen(where)); - - // move window if outside of screen frame - BRect screenFrame = (BScreen(this)).Frame(); - BRect frame = fFindPanel->Frame(); - float extra = 30.0f; - if (frame.bottom + extra * 2 > screenFrame.bottom) { - fFindPanel->MoveBy(0, - screenFrame.bottom - frame.bottom - extra * 2); - } else if (frame.top - extra < screenFrame.top) - fFindPanel->MoveBy(0, screenFrame.top - frame.top + extra); - - if (frame.right + extra > screenFrame.right) { - fFindPanel->MoveBy(screenFrame.right - frame.right - - extra, 0); - } - + fFindPanel->CenterIn(Frame()); fFindPanel->Show(); } else fFindPanel->Activate();