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/llaccordionctrltab.cpp | 3 ++- indra/llui/llfloater.cpp | 35 +++++++++++++++++++++++++---------- indra/llui/llfloater.h | 4 +--- indra/llui/lllineeditor.cpp | 3 ++- indra/llui/llpanel.cpp | 2 ++ indra/llui/llscrollcontainer.cpp | 5 +++-- indra/llui/llscrolllistctrl.cpp | 3 ++- indra/llui/lltextbase.cpp | 3 ++- indra/llui/lluictrl.cpp | 33 ++++++++++++++++++++++++++++++++- indra/llui/lluictrl.h | 17 +++++++++++++++++ 10 files changed, 88 insertions(+), 20 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 9d49c1a831..9e4849c58b 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -203,7 +203,8 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); - gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get(),true); + F32 alpha = getCurrentTransparency(); + gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get() % alpha,true); LLAccordionCtrlTab* parent = dynamic_cast(getParent()); bool collapsible = (parent && parent->getCollapsible()); 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, diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index fa806bb632..9eeac9fbfb 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -343,6 +343,7 @@ private: static void updateActiveFloaterTransparency(); static void updateInactiveFloaterTransparency(); + void updateChildrenTransparency(LLView* ctrl); public: // Called when floater is opened, passes mKey @@ -413,9 +414,6 @@ private: F32 mCurrentTransparency; - static F32 sActiveFloaterTransparency; - static F32 sInactiveFloaterTransparency; - static LLMultiFloater* sHostp; static BOOL sQuitting; static std::string sButtonNames[BUTTON_COUNT]; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 3eb58e1aec..ba73b74052 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1530,7 +1530,8 @@ void LLLineEditor::drawBackground() image = mBgImage; } - F32 alpha = getDrawContext().mAlpha; + F32 alpha = getCurrentTransparency(); + // optionally draw programmatic border if (has_focus) { diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 900e2c789e..ff377ba3a1 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -194,6 +194,8 @@ void LLPanel::draw() // draw background if( mBgVisible ) { + alpha = getCurrentTransparency(); + LLRect local_rect = getLocalRect(); if (mBgOpaque ) { diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 3146418a7d..380c477eb2 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -422,9 +422,10 @@ void LLScrollContainer::draw() // Draw background if( mIsOpaque ) { + F32 alpha = getCurrentTransparency(); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( mBackgroundColor.get().mV ); - gl_rect_2d( mInnerRect ); + gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha); } // Draw mScrolledViews and update scroll bars. diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7df7c13dc0..8854f0a02e 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1482,8 +1482,9 @@ void LLScrollListCtrl::draw() // Draw background if (mBackgroundVisible) { + F32 alpha = getCurrentTransparency(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gl_rect_2d(background, getEnabled() ? mBgWriteableColor.get() : mBgReadOnlyColor.get() ); + gl_rect_2d(background, getEnabled() ? mBgWriteableColor.get() % alpha : mBgReadOnlyColor.get() % alpha ); } if (mColumnsDirty) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3f213ed13e..49537ef78f 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1005,6 +1005,7 @@ void LLTextBase::draw() if (mBGVisible) { + F32 alpha = getCurrentTransparency(); // clip background rect against extents, if we support scrolling LLRect bg_rect = mVisibleTextRect; if (mScroller) @@ -1016,7 +1017,7 @@ void LLTextBase::draw() : hasFocus() ? mFocusBgColor.get() : mWriteableBgColor.get(); - gl_rect_2d(doc_rect, bg_color, TRUE); + gl_rect_2d(doc_rect, bg_color % alpha, TRUE); } // draw document view diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 3ac3bf8c41..0065d164d7 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -36,6 +36,9 @@ static LLDefaultChildRegistry::Register r("ui_ctrl"); +F32 LLUICtrl::sActiveControlTransparency = 1.0f; +F32 LLUICtrl::sInactiveControlTransparency = 1.0f; + // Compiler optimization, generate extern template template class LLUICtrl* LLView::getChild( const std::string& name, BOOL recurse) const; @@ -110,7 +113,8 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) mMouseUpSignal(NULL), mRightMouseDownSignal(NULL), mRightMouseUpSignal(NULL), - mDoubleClickSignal(NULL) + mDoubleClickSignal(NULL), + mTransparencyType(TT_DEFAULT) { mUICtrlHandle.bind(this); } @@ -923,6 +927,33 @@ BOOL LLUICtrl::getTentative() const void LLUICtrl::setColor(const LLColor4& color) { } +F32 LLUICtrl::getCurrentTransparency() +{ + F32 alpha; + + switch(mTransparencyType) + { + case TT_DEFAULT: + alpha = getDrawContext().mAlpha; + break; + + case TT_ACTIVE: + alpha = sActiveControlTransparency; + break; + + case TT_INACTIVE: + alpha = sInactiveControlTransparency; + break; + } + + return alpha; +} + +void LLUICtrl::setTransparencyType(ETypeTransparency type) +{ + mTransparencyType = type; +} + boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) { if (!mCommitSignal) mCommitSignal = new commit_signal_t(); diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 76dfdf754c..a78f98ac76 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -120,6 +120,12 @@ public: Params(); }; + enum ETypeTransparency + { + TT_DEFAULT, + TT_ACTIVE, + TT_INACTIVE + }; /*virtual*/ ~LLUICtrl(); void initFromParams(const Params& p); @@ -202,6 +208,11 @@ public: virtual void setColor(const LLColor4& color); + F32 getCurrentTransparency(); + + void setTransparencyType(ETypeTransparency type); + ETypeTransparency getTransparencyType() const {return mTransparencyType;} + BOOL focusNextItem(BOOL text_entry_only); BOOL focusPrevItem(BOOL text_entry_only); BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); @@ -283,6 +294,10 @@ protected: boost::signals2::connection mMakeVisibleControlConnection; LLControlVariable* mMakeInvisibleControlVariable; boost::signals2::connection mMakeInvisibleControlConnection; + + static F32 sActiveControlTransparency; + static F32 sInactiveControlTransparency; + private: BOOL mTabStop; @@ -290,6 +305,8 @@ private: BOOL mTentative; LLRootHandle mUICtrlHandle; + ETypeTransparency mTransparencyType; + class DefaultTabGroupFirstSorter; }; -- cgit v1.2.3 From 6a3efddaf6e1254c25c2640d9abc055ca661f24d Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 25 Nov 2010 20:20:11 +0200 Subject: STORM-676 FIXED Made color swatch control transparent if the floater it resides in is transparent. --- indra/llui/llui.cpp | 6 +++--- indra/llui/llui.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 19c42bf61a..1e2fe09cd9 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -950,7 +950,7 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor } // Draw gray and white checkerboard with black border -void gl_rect_2d_checkerboard(const LLRect& rect) +void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) { // Initialize the first time this is called. const S32 PIXELS = 32; @@ -971,11 +971,11 @@ void gl_rect_2d_checkerboard(const LLRect& rect) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // ...white squares - gGL.color3f( 1.f, 1.f, 1.f ); + gGL.color4f( 1.f, 1.f, 1.f, alpha ); gl_rect_2d(rect); // ...gray squares - gGL.color3f( .7f, .7f, .7f ); + gGL.color4f( .7f, .7f, .7f, alpha ); gGL.flush(); glPolygonStipple( checkerboard ); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index fc545c85d5..62d10df8b2 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -79,7 +79,7 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, const LL void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixel_offset = 0, BOOL filled = TRUE ); void gl_rect_2d(const LLRect& rect, BOOL filled = TRUE ); void gl_rect_2d(const LLRect& rect, const LLColor4& color, BOOL filled = TRUE ); -void gl_rect_2d_checkerboard(const LLRect& rect); +void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha = 1.0f); void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines); -- cgit v1.2.3 From d1549c18b0d126ae3fcc28449901a90214111676 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 25 Nov 2010 23:19:12 +0200 Subject: STORM-676 ADDITIONAL FIX Added transparency support to the color picker floater. --- indra/llui/llfloater.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 9eeac9fbfb..e312702257 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -361,6 +361,7 @@ protected: std::string mVisibilityControl; std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg + F32 mCurrentTransparency; LLDragHandle* mDragHandle; LLResizeBar* mResizeBar[4]; @@ -412,8 +413,6 @@ private: bool mDocked; bool mTornOff; - F32 mCurrentTransparency; - static LLMultiFloater* sHostp; static BOOL sQuitting; static std::string sButtonNames[BUTTON_COUNT]; -- cgit v1.2.3 From d4d292bba9fe6b1b85c427518aff1b9005b436e4 Mon Sep 17 00:00:00 2001 From: Andrew Productengine Date: Fri, 26 Nov 2010 14:31:11 +0200 Subject: Fixed Windows build. --- indra/llui/lluictrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0065d164d7..7e4cb78d80 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -929,7 +929,7 @@ void LLUICtrl::setColor(const LLColor4& color) F32 LLUICtrl::getCurrentTransparency() { - F32 alpha; + F32 alpha = 0; switch(mTransparencyType) { -- cgit v1.2.3 From 7a674fc9b3634454b1c542b029c57f08df88425c Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 29 Nov 2010 16:18:03 +0200 Subject: STORM-698 FIXED Icon control can now respect floater transparency (if its "use_draw_context_alpha" param set to false). --- indra/llui/lliconctrl.cpp | 5 ++++- indra/llui/lliconctrl.h | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 627957061d..47f2cfaf89 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -41,6 +41,7 @@ static LLDefaultChildRegistry::Register r("icon"); LLIconCtrl::Params::Params() : image("image_name"), color("color"), + use_draw_context_alpha("use_draw_context_alpha", true), scale_image("scale_image") { tab_stop = false; @@ -51,6 +52,7 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) : LLUICtrl(p), mColor(p.color()), mImagep(p.image), + mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), mDrawWidth(0), mDrawHeight(0) @@ -71,7 +73,8 @@ void LLIconCtrl::draw() { if( mImagep.notNull() ) { - mImagep->draw(getLocalRect(), mColor.get() % getDrawContext().mAlpha ); + const F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); + mImagep->draw(getLocalRect(), mColor.get() % alpha ); } LLUICtrl::draw(); diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 79a8b0fb28..e9bdab2d47 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -48,6 +48,7 @@ public: { Optional image; Optional color; + Optional use_draw_context_alpha; Ignored scale_image; Params(); }; @@ -79,6 +80,10 @@ protected: S32 mDrawWidth ; S32 mDrawHeight ; + // If set to true (default), use the draw context transparency. + // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. + bool mUseDrawContextAlpha; + private: LLUIColor mColor; LLPointer mImagep; -- 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 ++++++++----- indra/llui/llfloater.h | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/llui') 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, diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index e312702257..2ec233f454 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -284,6 +284,8 @@ public: static void setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; } static LLMultiFloater* getFloaterHost() {return sHostp; } + + void updateChildrenTransparency(ETypeTransparency transparency_type); protected: @@ -343,7 +345,7 @@ private: static void updateActiveFloaterTransparency(); static void updateInactiveFloaterTransparency(); - void updateChildrenTransparency(LLView* ctrl); + void updateChildrenTransparency(LLView* ctrl, ETypeTransparency transparency_type); public: // Called when floater is opened, passes mKey -- cgit v1.2.3 From 85c75c9ce3b68a82d5f891ef21ea10ddf012ecc4 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 29 Nov 2010 20:04:26 +0200 Subject: STORM-689 FIXED "Back" but is opaque in all of the undocked side panels - Added parameter to the button that defines which transparency value should be used: value of drawing context or transparency value of a its parent (in our case this parent is floater) --- indra/llui/llbutton.cpp | 8 +++++--- indra/llui/llbutton.h | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 65ef3e5f8f..45ceaff696 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -98,7 +98,8 @@ LLButton::Params::Params() is_toggle("is_toggle", false), scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), - commit_on_return("commit_on_return", true) + commit_on_return("commit_on_return", true), + use_draw_context_alpha("use_draw_context_alpha", true) { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -158,7 +159,8 @@ LLButton::LLButton(const LLButton::Params& p) mLastDrawCharsCount(0), mMouseDownSignal(NULL), mMouseUpSignal(NULL), - mHeldDownSignal(NULL) + mHeldDownSignal(NULL), + mUseDrawContextAlpha(p.use_draw_context_alpha) { static LLUICachedControl llbutton_orig_h_pad ("UIButtonOrigHPad", 0); @@ -539,7 +541,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) // virtual void LLButton::draw() { - F32 alpha = getDrawContext().mAlpha; + F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); bool flash = FALSE; static LLUICachedControl button_flash_rate("ButtonFlashRate", 0); static LLUICachedControl button_flash_count("ButtonFlashCount", 0); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 2d5fefa78c..16aa49b653 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -124,6 +124,8 @@ public: Optional hover_glow_amount; Optional held_down_delay; + Optional use_draw_context_alpha; + Params(); }; @@ -338,6 +340,8 @@ private: S32 mImageOverlayTopPad; S32 mImageOverlayBottomPad; + bool mUseDrawContextAlpha; + /* * Space between image_overlay and label */ -- 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 +++++++++++++++++---------------- indra/llui/llfloater.h | 5 ++--- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'indra/llui') 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) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 2ec233f454..bb96272d02 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -285,7 +285,7 @@ public: static void setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; } static LLMultiFloater* getFloaterHost() {return sHostp; } - void updateChildrenTransparency(ETypeTransparency transparency_type); + void updateTransparency(ETypeTransparency transparency_type); protected: @@ -345,7 +345,7 @@ private: static void updateActiveFloaterTransparency(); static void updateInactiveFloaterTransparency(); - void updateChildrenTransparency(LLView* ctrl, ETypeTransparency transparency_type); + void updateTransparency(LLView* view, ETypeTransparency transparency_type); public: // Called when floater is opened, passes mKey @@ -363,7 +363,6 @@ protected: std::string mVisibilityControl; std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg - F32 mCurrentTransparency; LLDragHandle* mDragHandle; LLResizeBar* mResizeBar[4]; -- cgit v1.2.3 From 7ed0938226d377e4945e9eea65ef4e4856716fbd Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 3 Dec 2010 20:45:53 +0200 Subject: STORM-579 FIXED SLURLs color for residents and objects names in plain text chat match the user setting for "URLs" in the Color tab in Prefs. Avatar names SLURLs now use the user color setting for "URLs" everywhere across the viewer. --- indra/llui/llurlentry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 6cc72bad82..f25be55665 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -456,8 +456,8 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa LLStyle::Params LLUrlEntryAgent::getStyle() const { LLStyle::Params style_params = LLUrlEntryBase::getStyle(); - style_params.color = LLUIColorTable::instance().getColor("AgentLinkColor"); - style_params.readonly_color = LLUIColorTable::instance().getColor("AgentLinkColor"); + style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); return style_params; } -- cgit v1.2.3 From b9fa0e9bbe0db5ecdfb5fbdd88474e0d3bb8eed2 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 4 Dec 2010 13:07:51 +0200 Subject: STORM-717 FIXED Made nearby chat toasts respect transparency settings: * Normally toasts are as opaque as specified by "inactive floater opacity" setting. * When mouse is hovering a toast, the toast uses "active floater opacity" setting. * Fading toasts have 1/2 of "inactive floater opacity". --- indra/llui/lluictrl.cpp | 4 ++++ indra/llui/lluictrl.h | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 7e4cb78d80..afd60cbb3e 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -944,6 +944,10 @@ F32 LLUICtrl::getCurrentTransparency() case TT_INACTIVE: alpha = sInactiveControlTransparency; break; + + case TT_FADING: + alpha = sInactiveControlTransparency / 2; + break; } return alpha; diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index a78f98ac76..b37e9f6b1b 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -123,8 +123,9 @@ public: enum ETypeTransparency { TT_DEFAULT, - TT_ACTIVE, - TT_INACTIVE + TT_ACTIVE, // focused floater + TT_INACTIVE, // other floaters + TT_FADING, // fading toast }; /*virtual*/ ~LLUICtrl(); -- cgit v1.2.3