From e997a09343ad2a1f082b63c3bce83f9cd9566637 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Wed, 24 Nov 2010 19:12:02 +0200 Subject: 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 --- indra/llui/llfloater.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'indra/llui/llfloater.cpp') 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(*it); + if (ui_ctrl) + { + ui_ctrl->setTransparencyType(transparency_type); + } + updateChildrenTransparency(*it); + } +} + void LLFloater::setCanMinimize(BOOL can_minimize) { // if removing minimize/restore button programmatically, -- cgit v1.2.3 From 2f0919b175444221783942ce6f49e2e04a725227 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 29 Nov 2010 16:48:58 +0200 Subject: STORM-688 FIXED Sidebar becomes semitransparent if dock semitransparent side panel back to the Sidebar - Before docking the tab back to the sidetray, set floater's children to non-transparent state - After detaching tab from the sidetray there is no need to set manually floater's children transparency. It happens automatically when floater gets focus. --- indra/llui/llfloater.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 720ff86aa7..da5dad6b82 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1189,7 +1189,7 @@ void LLFloater::setFocus( BOOL b ) last_focus->setFocus(TRUE); } } - updateChildrenTransparency(this); + updateChildrenTransparency(this, b ? TT_ACTIVE : TT_INACTIVE); } // virtual @@ -1768,13 +1768,11 @@ void LLFloater::drawShadow(LLPanel* panel) llround(shadow_offset)); } -void LLFloater::updateChildrenTransparency(LLView* ctrl) +void LLFloater::updateChildrenTransparency(LLView* ctrl, ETypeTransparency transparency_type) { 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(*it); @@ -1782,10 +1780,15 @@ void LLFloater::updateChildrenTransparency(LLView* ctrl) { ui_ctrl->setTransparencyType(transparency_type); } - updateChildrenTransparency(*it); + updateChildrenTransparency(*it, transparency_type); } } +void LLFloater::updateChildrenTransparency(ETypeTransparency transparency_type) +{ + updateChildrenTransparency(this, transparency_type); +} + void LLFloater::setCanMinimize(BOOL can_minimize) { // if removing minimize/restore button programmatically, -- cgit v1.2.3 From 3c4cf5a309612d2a999453b282cad0aab7764083 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 1 Dec 2010 15:46:57 +0200 Subject: STORM-677 ADDITIONAL_FIX Force textures inside texture picker to be 100% opaque while the control is in a focused floater. Besides, made LLFloater handle opacity more like other controls do. --- indra/llui/llfloater.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index da5dad6b82..7727e154da 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1189,7 +1189,7 @@ void LLFloater::setFocus( BOOL b ) last_focus->setFocus(TRUE); } } - updateChildrenTransparency(this, b ? TT_ACTIVE : TT_INACTIVE); + updateTransparency(this, b ? TT_ACTIVE : TT_INACTIVE); } // virtual @@ -1649,7 +1649,7 @@ void LLFloater::onClickCloseBtn() // virtual void LLFloater::draw() { - mCurrentTransparency = hasFocus() ? sActiveControlTransparency : sInactiveControlTransparency; + const F32 alpha = getCurrentTransparency(); // draw background if( isBackgroundVisible() ) @@ -1681,12 +1681,12 @@ void LLFloater::draw() if (image) { // We're using images for this floater's backgrounds - image->draw(getLocalRect(), overlay_color % mCurrentTransparency); + image->draw(getLocalRect(), overlay_color % alpha); } else { // We're not using images, use old-school flat colors - gl_rect_2d( left, top, right, bottom, color % mCurrentTransparency ); + gl_rect_2d( left, top, right, bottom, color % alpha ); // draw highlight on title bar to indicate focus. RDW if(hasFocus() @@ -1698,7 +1698,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 % mCurrentTransparency, 0, TRUE); + titlebar_focus_color % alpha, 0, TRUE); } } } @@ -1764,29 +1764,30 @@ void LLFloater::drawShadow(LLPanel* panel) shadow_color.mV[VALPHA] *= 0.5f; } gl_drop_shadow(left, top, right, bottom, - shadow_color % mCurrentTransparency, + shadow_color % getCurrentTransparency(), llround(shadow_offset)); } -void LLFloater::updateChildrenTransparency(LLView* ctrl, ETypeTransparency transparency_type) +void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type) { - child_list_t children = *ctrl->getChildList(); + child_list_t children = *view->getChildList(); child_list_t::iterator it = children.begin(); + LLUICtrl* ctrl = dynamic_cast(view); + if (ctrl) + { + ctrl->setTransparencyType(transparency_type); + } + for(; it != children.end(); ++it) { - LLUICtrl* ui_ctrl = dynamic_cast(*it); - if (ui_ctrl) - { - ui_ctrl->setTransparencyType(transparency_type); - } - updateChildrenTransparency(*it, transparency_type); + updateTransparency(*it, transparency_type); } } -void LLFloater::updateChildrenTransparency(ETypeTransparency transparency_type) +void LLFloater::updateTransparency(ETypeTransparency transparency_type) { - updateChildrenTransparency(this, transparency_type); + updateTransparency(this, transparency_type); } void LLFloater::setCanMinimize(BOOL can_minimize) -- cgit v1.2.3