SL-307 Implemented ability to specify color and changed flashing color

master
Andrey Kleshchev 2020-03-27 19:05:23 +02:00
parent 9ec2aac56c
commit eaa9b152bf
6 changed files with 25 additions and 3 deletions

View File

@ -734,6 +734,11 @@ void LLButton::draw()
{
glow_color = highlighting_color;
}
else
{
// will fade from highlight color
glow_color = flash_color;
}
}
}

View File

@ -205,6 +205,7 @@ public:
void setFlashing( bool b, bool force_flashing = false );
BOOL getFlashing() const { return mFlashing; }
LLFlashTimer* getFlashTimer() {return mFlashingTimer;}
void setFlashColor(const LLUIColor &color) { mFlashBgColor = color; };
void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
LLFontGL::HAlign getHAlign() const { return mHAlign; }

View File

@ -260,6 +260,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mCustomIconCtrlUsed(p.use_custom_icon_ctrl),
mOpenTabsOnDragAndDrop(p.open_tabs_on_drag_and_drop),
mTabIconCtrlPad(p.tab_icon_ctrl_pad),
mEnableTabsFlashing(p.enable_tabs_flashing),
mUseTabEllipses(p.use_ellipses)
{
static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0);
@ -1641,6 +1642,16 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state )
}
}
void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color)
{
LLTabTuple* tuple = getTabByPanel(child);
if (tuple)
{
tuple->mButton->setFlashColor(color);
tuple->mButton->setFlashing(state);
}
}
void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color)
{
LLTabTuple* tuple = getTabByPanel(child);

View File

@ -111,7 +111,7 @@ public:
Optional<bool> open_tabs_on_drag_and_drop;
/**
* Open tabs on hover in drag and drop situations
* Enable tab flashing
*/
Optional<bool> enable_tabs_flashing;
@ -203,6 +203,7 @@ public:
BOOL getTabPanelFlashing(LLPanel* child);
void setTabPanelFlashing(LLPanel* child, BOOL state);
void setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color);
void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white);
void setTabImage(LLPanel* child, const LLUUID& img_id, const LLColor4& color = LLColor4::white);
void setTabImage(LLPanel* child, LLIconCtrl* icon);

View File

@ -1583,7 +1583,10 @@ void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash
if (flash && mTabContainer->getCurrentPanel() != panel)
{
mTabContainer->setTabPanelFlashing(panel, true);
// This will makes colors pale due to "glow_type = LLRender::BT_ALPHA"
// So instead of using "MenuItemFlashBgColor" added stronger color
static LLUIColor sFlashBgColor(LLColor4U(255, 99, 0));
mTabContainer->setTabPanelFlashing(panel, true, sFlashBgColor);
}
}

View File

@ -17,5 +17,6 @@
name="Preview Tabs"
tab_position="bottom"
top="16"
width="448" />
width="448"
enable_tabs_flashing="true"/>
</multi_floater>