Terminal: Center Find window in term window frame
... instead of positioning it under the mouse pointer as suggested by Axel.
This commit is contained in:
parent
90f195890f
commit
37848383ca
@ -735,27 +735,7 @@ TermWindow::MessageReceived(BMessage *message)
|
|||||||
fFindPanel = new FindWindow(this, fFindString, fFindSelection,
|
fFindPanel = new FindWindow(this, fFindString, fFindSelection,
|
||||||
fMatchWord, fMatchCase, fForwardSearch);
|
fMatchWord, fMatchCase, fForwardSearch);
|
||||||
|
|
||||||
// position the window under the mouse pointer
|
fFindPanel->CenterIn(Frame());
|
||||||
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->Show();
|
fFindPanel->Show();
|
||||||
} else
|
} else
|
||||||
fFindPanel->Activate();
|
fFindPanel->Activate();
|
||||||
|
Loading…
Reference in New Issue
Block a user