diff options
author | Richard Linden <none@none> | 2010-03-03 19:37:41 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2010-03-03 19:37:41 -0800 |
commit | 69f9c0bcf9764a1b682bfdd5baa3f340922dcbaa (patch) | |
tree | 0add9cfef233a0b93bb2f0d85b57cc41d8f1deb4 /indra/newview/llpopupview.cpp | |
parent | c3c04adaa56c895018e1d2dd32b94469aaf44347 (diff) |
WIP - replace top ctrl with LLPopupView
Diffstat (limited to 'indra/newview/llpopupview.cpp')
-rw-r--r-- | indra/newview/llpopupview.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 964ca4d361..eb750a87e2 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -100,7 +100,7 @@ BOOL LLPopupView::handleMouseEvent(boost::function<BOOL(LLView*, S32, S32)> func S32 popup_x, popup_y; if (localPointToOtherView(x, y, &popup_x, &popup_y, popup) - && popup->getRect().pointInRect(popup_x, popup_y)) + && popup->pointInView(popup_x, popup_y)) { if (func(popup, popup_x, popup_y)) { @@ -180,9 +180,9 @@ BOOL LLPopupView::handleToolTip(S32 x, S32 y, MASK mask) void LLPopupView::addPopup(LLView* popup) { - removePopup(popup); if (popup) { + mPopups.erase(std::find(mPopups.begin(), mPopups.end(), popup->getHandle())); mPopups.push_back(popup->getHandle()); } } @@ -191,12 +191,26 @@ void LLPopupView::removePopup(LLView* popup) { if (popup) { + if (gFocusMgr.childHasKeyboardFocus(popup)) + { + gFocusMgr.setKeyboardFocus(NULL); + } + popup->onTopLost(); mPopups.erase(std::find(mPopups.begin(), mPopups.end(), popup->getHandle())); } } void LLPopupView::clearPopups() { + for (popup_list_t::iterator popup_it = mPopups.begin(); + popup_it != mPopups.end();) + { + LLView* popup = popup_it->get(); + ++popup_it; + + if (popup) popup->onTopLost(); + } + mPopups.clear(); } |