From 02b58694bbc674c05fd601a3bffc5647617db4ef Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 15 Oct 2011 01:21:10 -0500 Subject: [PATCH] A required hack to LLMediaCtrl due to our LLPanel behaving far too differently right now. (Clicking isn't passed through like it should, and LLMediaCtrl is not currently parsing xml files so postBuild is not called.) --- indra/newview/llmediactrl.cpp | 7 +++++-- indra/newview/llmediactrl.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0dfa20e14..37f263ca8 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -63,7 +63,7 @@ const S32 MAX_TEXTURE_DIMENSION = 2048; static LLRegisterWidget r("web_browser"); LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) : - LLPanel( name, rect, FALSE ), + LLUICtrl( name, rect, FALSE, NULL, NULL), LLInstanceTracker(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), mWebBrowserImage( 0 ), @@ -341,7 +341,7 @@ void LLMediaCtrl::onFocusLost() BOOL LLMediaCtrl::postBuild () { - setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2)); + //setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2)); return true; } @@ -395,6 +395,9 @@ void LLMediaCtrl::handleVisibilityChange ( BOOL new_visibility ) { mMediaSource->setVisible( new_visibility ); } + LLUICtrl::handleVisibilityChange( new_visibility ); + //Hack due to not being derived from LLPanel yet + LLMediaCtrl::onVisibilityChange(LLSD(new_visibility)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index b5254581f..341ea1407 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -46,7 +46,7 @@ class LLUICtrlFactory; //////////////////////////////////////////////////////////////////////////////// // class LLMediaCtrl : - public LLPanel, + public LLUICtrl, public LLViewerMediaObserver, public LLViewerMediaEventEmitter, public LLInstanceTracker