Fix keyboard shortcuts like ctrl+w for floaters
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user