summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2010-11-09 19:39:03 -0500
committerOz Linden <oz@lindenlab.com>2010-11-09 19:39:03 -0500
commitd87d73e253e377141c97b907355f116bfb8fac46 (patch)
tree928c889a4315ab65eaa5777abea1c2507fc0d983 /indra/llui
parente11174cfe94e885bcf84190e0f1c0a9022abc6cd (diff)
parent90640ed303184436ccac4d8a8da3588909bf4c3b (diff)
Automated merge with file:///Users/oz/Work/viewer-development
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp42
-rw-r--r--indra/llui/llfloater.h8
2 files changed, 44 insertions, 6 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index b758070419..34d8e9c500 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -61,6 +61,9 @@
// use this to control "jumping" behavior when Ctrl-Tabbing
const S32 TABBED_FLOATER_OFFSET = 0;
+// static
+F32 LLFloater::sActiveFloaterTransparency = 0.0f;
+F32 LLFloater::sInactiveFloaterTransparency = 0.0f;
std::string LLFloater::sButtonNames[BUTTON_COUNT] =
{
@@ -200,6 +203,21 @@ void LLFloater::initClass()
{
sButtonToolTips[i] = LLTrans::getString( sButtonToolTipsIndex[i] );
}
+
+ LLControlVariable* ctrl = LLUI::sSettingGroups["config"]->getControl("ActiveFloaterTransparency").get();
+ if (ctrl)
+ {
+ ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency));
+ sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
+ }
+
+ ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get();
+ if (ctrl)
+ {
+ ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency));
+ sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
+ }
+
}
// defaults for floater param block pulled from widgets/floater.xml
@@ -347,6 +365,18 @@ void LLFloater::layoutDragHandle()
updateTitleButtons();
}
+// static
+void LLFloater::updateActiveFloaterTransparency()
+{
+ sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
+}
+
+// static
+void LLFloater::updateInactiveFloaterTransparency()
+{
+ sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
+}
+
void LLFloater::addResizeCtrls()
{
// Resize bars (sides)
@@ -1622,7 +1652,8 @@ void LLFloater::onClickCloseBtn()
// virtual
void LLFloater::draw()
{
- F32 alpha = getDrawContext().mAlpha;
+ mCurrentTransparency = hasFocus() ? sActiveFloaterTransparency : sInactiveFloaterTransparency;
+
// draw background
if( isBackgroundVisible() )
{
@@ -1653,12 +1684,12 @@ void LLFloater::draw()
if (image)
{
// We're using images for this floater's backgrounds
- image->draw(getLocalRect(), overlay_color % alpha);
+ image->draw(getLocalRect(), overlay_color % mCurrentTransparency);
}
else
{
// We're not using images, use old-school flat colors
- gl_rect_2d( left, top, right, bottom, color % alpha );
+ gl_rect_2d( left, top, right, bottom, color % mCurrentTransparency );
// draw highlight on title bar to indicate focus. RDW
if(hasFocus()
@@ -1670,7 +1701,7 @@ void LLFloater::draw()
const LLFontGL* font = LLFontGL::getFontSansSerif();
LLRect r = getRect();
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1,
- titlebar_focus_color % alpha, 0, TRUE);
+ titlebar_focus_color % mCurrentTransparency, 0, TRUE);
}
}
}
@@ -1720,7 +1751,6 @@ 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;
@@ -1737,7 +1767,7 @@ void LLFloater::drawShadow(LLPanel* panel)
shadow_color.mV[VALPHA] *= 0.5f;
}
gl_drop_shadow(left, top, right, bottom,
- shadow_color % alpha,
+ shadow_color % mCurrentTransparency,
llround(shadow_offset));
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 32d03f9f83..fa806bb632 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -341,6 +341,9 @@ private:
void addDragHandle();
void layoutDragHandle(); // repair layout
+ static void updateActiveFloaterTransparency();
+ static void updateInactiveFloaterTransparency();
+
public:
// Called when floater is opened, passes mKey
// Public so external views or floaters can watch for this floater opening
@@ -408,6 +411,11 @@ private:
bool mDocked;
bool mTornOff;
+ F32 mCurrentTransparency;
+
+ static F32 sActiveFloaterTransparency;
+ static F32 sInactiveFloaterTransparency;
+
static LLMultiFloater* sHostp;
static BOOL sQuitting;
static std::string sButtonNames[BUTTON_COUNT];