diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-17 18:02:35 +0000 | 
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-17 18:02:35 +0000 | 
| commit | 2490f50ce1bc7ffe1e53a99e4081bee13253f09a (patch) | |
| tree | 1f2de35440c436795e68c118634a5ab0b2321c72 /indra/llui | |
| parent | 29dd5afaa8a85f0b57ddb3e9e281e1e6f5b43e29 (diff) | |
| parent | f52e7036940a015a405ae94aa016612c4160df9e (diff) | |
PE merge.
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llfloater.cpp | 39 | ||||
| -rw-r--r-- | indra/llui/llfloater.h | 1 | 
2 files changed, 26 insertions, 14 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a55915af35..0199fe3f57 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1565,25 +1565,13 @@ void LLFloater::draw()  	// draw background  	if( isBackgroundVisible() )  	{ +		drawShadow(this); +  		S32 left = LLPANEL_BORDER_WIDTH;  		S32 top = getRect().getHeight() - LLPANEL_BORDER_WIDTH;  		S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH;  		S32 bottom = LLPANEL_BORDER_WIDTH; -		static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0); -		static LLUIColor shadow_color_cached = LLUIColorTable::instance().getColor("ColorDropShadow"); -		LLColor4 shadow_color = shadow_color_cached; -		F32 shadow_offset = (F32)shadow_offset_S32; - -		if (!isBackgroundOpaque()) -		{ -			shadow_offset *= 0.2f; -			shadow_color.mV[VALPHA] *= 0.5f; -		} -		gl_drop_shadow(left, top, right, bottom,  -			shadow_color % alpha,  -			llround(shadow_offset)); -  		LLUIImage* image = NULL;  		LLColor4 color;  		if (isBackgroundOpaque()) @@ -1666,6 +1654,29 @@ void LLFloater::draw()  	}  } +void	LLFloater::drawShadow(LLPanel* panel) +{ +	F32 alpha = panel->getDrawContext().mAlpha; +	S32 left = LLPANEL_BORDER_WIDTH; +	S32 top = panel->getRect().getHeight() - LLPANEL_BORDER_WIDTH; +	S32 right = panel->getRect().getWidth() - LLPANEL_BORDER_WIDTH; +	S32 bottom = LLPANEL_BORDER_WIDTH; + +	static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0); +	static LLUIColor shadow_color_cached = LLUIColorTable::instance().getColor("ColorDropShadow"); +	LLColor4 shadow_color = shadow_color_cached; +	F32 shadow_offset = (F32)shadow_offset_S32; + +	if (!panel->isBackgroundOpaque()) +	{ +		shadow_offset *= 0.2f; +		shadow_color.mV[VALPHA] *= 0.5f; +	} +	gl_drop_shadow(left, top, right, bottom,  +		shadow_color % alpha,  +		llround(shadow_offset)); +} +  void	LLFloater::setCanMinimize(BOOL can_minimize)  {  	// if removing minimize/restore button programmatically, diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 2166d8db8a..19e8288807 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -222,6 +222,7 @@ public:  	virtual BOOL	handleScrollWheel(S32 x, S32 y, S32 mask);  	virtual void	draw(); +	virtual void	drawShadow(LLPanel* panel);  	virtual void	onOpen(const LLSD& key) {}  	virtual void	onClose(bool app_quitting) {}  | 
