[haiku-commits] haiku: hrev45684 - src/apps/terminal

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 May 2013 23:44:54 +0200 (CEST)

hrev45684 adds 1 changeset to branch 'master'
old head: 90f195890fc38d6c86659b3e59233b53fc580d87
new head: 37848383ca20e6c25caadbf27049483bb431ce54
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=3784838+%5E90f1958

----------------------------------------------------------------------------

3784838: Terminal: Center Find window in term window frame
  
  ... instead of positioning it under the mouse pointer as suggested
  by Axel.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45684
Commit:      37848383ca20e6c25caadbf27049483bb431ce54
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3784838
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Tue May 14 21:38:17 2013 UTC

----------------------------------------------------------------------------

1 file changed, 1 insertion(+), 21 deletions(-)
src/apps/terminal/TermWindow.cpp | 22 +---------------------

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
index 073a697..440bbfa 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();


Other related posts: