diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-11-24 19:12:02 +0200 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-11-24 19:12:02 +0200 |
commit | e997a09343ad2a1f082b63c3bce83f9cd9566637 (patch) | |
tree | e3a5c05c34a9af5a7a5f97182aa10160ed977755 /indra/llui/llfloater.cpp | |
parent | 082443b88fc719cb84d67039ab5ddc62847ec6b5 (diff) |
STORM-593 FIXED Make transparent texteditor and lineeditor
Reason: If some child of transparent LLFloater has a visible non-transparent background then this part of floater is non-transparent. As a result floater became partially transparent.
Solution: When transparent floater changes focus, iterate through its children and set corresponding (corresponding to whether control in active or in inactive floater see STORM-535) transparency value.
- Added method LLUICtrl::getCurrentTransparency. This method calculates transparency level of a control. Calculated value should be used as an alpha chennel value in case we want this control to be transparent. For now this method is used by LLFloater to adjust transparency of its children.
- Added calculating of transparecny level for: LLLineEditor, LLTextBase, LLinventoryListItem, LLScrollContainer, LLScrollListCtrl, LLAccrodionCtrlTab.
- Added method LLFlaoter::updateChildrenTransparency which updates transparency value of its children
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 34d8e9c500..720ff86aa7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -61,10 +61,6 @@ // 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] = { "llfloater_close_btn", //BUTTON_CLOSE @@ -208,14 +204,14 @@ void LLFloater::initClass() if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency)); - sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); + updateActiveFloaterTransparency(); } ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get(); if (ctrl) { ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency)); - sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); + updateInactiveFloaterTransparency(); } } @@ -225,7 +221,7 @@ static LLWidgetNameRegistry::StaticRegistrar sRegisterFloaterParams(&typeid(LLFl LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) : LLPanel(), // intentionally do not pass params here, see initFromParams - mDragHandle(NULL), + mDragHandle(NULL), mTitle(p.title), mShortTitle(p.short_title), mSingleInstance(p.single_instance), @@ -368,13 +364,13 @@ void LLFloater::layoutDragHandle() // static void LLFloater::updateActiveFloaterTransparency() { - sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); + sActiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); } // static void LLFloater::updateInactiveFloaterTransparency() { - sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); + sInactiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); } void LLFloater::addResizeCtrls() @@ -1193,6 +1189,7 @@ void LLFloater::setFocus( BOOL b ) last_focus->setFocus(TRUE); } } + updateChildrenTransparency(this); } // virtual @@ -1652,7 +1649,7 @@ void LLFloater::onClickCloseBtn() // virtual void LLFloater::draw() { - mCurrentTransparency = hasFocus() ? sActiveFloaterTransparency : sInactiveFloaterTransparency; + mCurrentTransparency = hasFocus() ? sActiveControlTransparency : sInactiveControlTransparency; // draw background if( isBackgroundVisible() ) @@ -1771,6 +1768,24 @@ void LLFloater::drawShadow(LLPanel* panel) llround(shadow_offset)); } +void LLFloater::updateChildrenTransparency(LLView* ctrl) +{ + child_list_t children = *ctrl->getChildList(); + child_list_t::iterator it = children.begin(); + + ETypeTransparency transparency_type = hasFocus() ? TT_ACTIVE : TT_INACTIVE; + + for(; it != children.end(); ++it) + { + LLUICtrl* ui_ctrl = dynamic_cast<LLUICtrl*>(*it); + if (ui_ctrl) + { + ui_ctrl->setTransparencyType(transparency_type); + } + updateChildrenTransparency(*it); + } +} + void LLFloater::setCanMinimize(BOOL can_minimize) { // if removing minimize/restore button programmatically, |