diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 32af5ca47..fccddcb79 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1201,7 +1201,6 @@ BOOL LLFloater::handleMiddleMouseDown(S32 x, S32 y, MASK mask) return LLPanel::handleMiddleMouseDown( x, y, mask ); } - // virtual BOOL LLFloater::handleDoubleClick(S32 x, S32 y, MASK mask) { @@ -1210,6 +1209,22 @@ BOOL LLFloater::handleDoubleClick(S32 x, S32 y, MASK mask) return was_minimized || LLPanel::handleDoubleClick(x, y, mask); } +// virtual +BOOL LLFloater::handleKeyHere(KEY key, MASK mask) +{ + if (key == 'W' && mask == MASK_CONTROL) + { + if (canClose() && isCloseable()) + { + close(); + } + return TRUE; + } + + return LLPanel::handleKeyHere(key, mask); +} + + void LLFloater::bringToFront( S32 x, S32 y ) { if (getVisible() && pointInView(x, y)) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 939071b0f..40d8c7ecd 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -197,6 +197,7 @@ public: virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); virtual void draw(); virtual void onOpen() {} diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 29ea32816..92823fd33 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -406,22 +406,6 @@ void LLMultiFloater::setVisible(BOOL visible) } } -BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask) -{ - if (key == 'W' && mask == MASK_CONTROL) - { - LLFloater* floater = getActiveFloater(); - // is user closeable and is system closeable - if (floater && floater->canClose() && floater->isCloseable()) - { - floater->close(); - } - return TRUE; - } - - return LLFloater::handleKeyHere(key, mask); -} - LLFloater* LLMultiFloater::getActiveFloater() { return (LLFloater*)mTabContainer->getCurrentPanel(); diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index 29c03b3c4..ccf5f462f 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -51,7 +51,6 @@ public: /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); virtual void setCanResize(BOOL can_resize); virtual void growToFit(S32 content_width, S32 content_height); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 9a4e36244..2f236ac07 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1776,9 +1776,7 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) } } - // May need to call base class LLPanel::handleKeyHere if not handled - // in order to tab between buttons. JNC 1.2.2002 - return handled; + return LLFloater::handleKeyHere(key, mask); } BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,