made focus_on_click a param for LLMediaCtrl

meow-7.2.2
Richard Linden 2010-11-02 16:57:55 -07:00
parent f1830e905c
commit 5085fbfbdd
2 changed files with 5 additions and 11 deletions

View File

@ -70,7 +70,8 @@ LLMediaCtrl::Params::Params()
caret_color("caret_color"),
initial_mime_type("initial_mime_type"),
media_id("media_id"),
trusted_content("trusted_content", false)
trusted_content("trusted_content", false),
focus_on_click("focus_on_click", true)
{
tab_stop(false);
}
@ -86,7 +87,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mIgnoreUIScale( true ),
mAlwaysRefresh( false ),
mMediaSource( 0 ),
mTakeFocusOnClick( true ),
mTakeFocusOnClick( p.focus_on_click ),
mCurrentNavUrl( "" ),
mStretchToFill( true ),
mMaintainAspectRatio ( true ),
@ -206,14 +207,6 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
if (mMediaSource)
{
mMediaSource->mouseUp(x, y, mask);
// *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
// in addition to the onFocusReceived() call below. Undo this. JC
if (!mTakeFocusOnClick)
{
mMediaSource->focus(false);
gViewerWindow->focusClient();
}
}
gFocusMgr.setMouseCapture( NULL );

View File

@ -53,7 +53,8 @@ public:
ignore_ui_scale,
hide_loading,
decouple_texture_size,
trusted_content;
trusted_content,
focus_on_click;
Optional<S32> texture_width,
texture_height;