Transplant alternate chat tab flash color for mentions
parent
9df4d7ba96
commit
f3a2a42a9a
|
|
@ -97,6 +97,7 @@ LLButton::Params::Params()
|
|||
image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f),
|
||||
image_overlay_selected_color("image_overlay_selected_color", LLColor4::white),
|
||||
flash_color("flash_color"),
|
||||
flash_alt_color("flash_alt_color"), // <FS:Ansariel> [FS communication UI]
|
||||
pad_right("pad_right", LLBUTTON_H_PAD),
|
||||
pad_left("pad_left", LLBUTTON_H_PAD),
|
||||
pad_bottom("pad_bottom"),
|
||||
|
|
@ -134,6 +135,7 @@ LLButton::LLButton(const LLButton::Params& p)
|
|||
mMouseDownFrame(0),
|
||||
mMouseHeldDownCount(0),
|
||||
mFlashing( false ),
|
||||
mIsAltFlashColor(false), // <FS:Ansariel> [FS communication UI]
|
||||
mCurGlowStrength(0.f),
|
||||
mNeedsHighlight(false),
|
||||
mUnselectedLabel(p.label()),
|
||||
|
|
@ -156,6 +158,7 @@ LLButton::LLButton(const LLButton::Params& p)
|
|||
mDisabledSelectedLabelColor(p.label_color_disabled_selected()),
|
||||
mImageColor(p.image_color()),
|
||||
mFlashBgColor(p.flash_color()),
|
||||
mFlashAltBgColor(p.flash_alt_color()), // <FS:Ansariel> [FS communication UI]
|
||||
mDisabledImageColor(p.image_color_disabled()),
|
||||
mImageOverlay(p.image_overlay()),
|
||||
mImageOverlayColor(p.image_overlay_color()),
|
||||
|
|
@ -840,7 +843,10 @@ void LLButton::draw()
|
|||
// provide fade-in and fade-out via flash_color
|
||||
if (mFlashingTimer)
|
||||
{
|
||||
LLColor4 flash_color = mFlashBgColor.get();
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//LLColor4 flash_color = mFlashBgColor.get();
|
||||
LLColor4 flash_color = mIsAltFlashColor ? mFlashAltBgColor.get() : mFlashBgColor.get();
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
use_glow_effect = true;
|
||||
glow_type = LLRender::BT_ALPHA; // blend the glow
|
||||
|
||||
|
|
@ -1118,7 +1124,10 @@ void LLButton::setToggleState(bool b)
|
|||
}
|
||||
}
|
||||
|
||||
void LLButton::setFlashing(bool b, bool force_flashing/* = false */)
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//void LLButton::setFlashing(bool b, bool force_flashing/* = false */)
|
||||
void LLButton::setFlashing(bool b, bool force_flashing/* = false */, bool alternate_color/*= false */)
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
{
|
||||
mForceFlashing = force_flashing;
|
||||
if (mFlashingTimer)
|
||||
|
|
@ -1131,6 +1140,9 @@ void LLButton::setFlashing(bool b, bool force_flashing/* = false */)
|
|||
mFlashing = b;
|
||||
mFrameTimer.reset();
|
||||
}
|
||||
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
mIsAltFlashColor = alternate_color;
|
||||
}
|
||||
|
||||
bool LLButton::toggleState()
|
||||
|
|
|
|||
|
|
@ -100,7 +100,9 @@ public:
|
|||
image_overlay_color,
|
||||
image_overlay_selected_color,
|
||||
image_overlay_disabled_color,
|
||||
flash_color;
|
||||
flash_color,
|
||||
flash_alt_color; // <FS:Ansariel> [FS communication UI]
|
||||
|
||||
|
||||
// layout
|
||||
Optional<S32> pad_right;
|
||||
|
|
@ -217,7 +219,10 @@ public:
|
|||
void setToggleState(bool b);
|
||||
|
||||
void setHighlight(bool b);
|
||||
void setFlashing( bool b, bool force_flashing = false );
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//void setFlashing( bool b, bool force_flashing = false );
|
||||
void setFlashing(bool b, bool force_flashing = false, bool alternate_color = false);
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
bool getFlashing() const { return mFlashing; }
|
||||
LLFlashTimer* getFlashTimer() {return mFlashingTimer;}
|
||||
void setFlashColor(const LLUIColor &color) { mFlashBgColor = color; };
|
||||
|
|
@ -361,6 +366,8 @@ protected:
|
|||
LLPointer<LLUIImage> mImageFlash;
|
||||
|
||||
LLUIColor mFlashBgColor;
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
LLUIColor mFlashAltBgColor;
|
||||
|
||||
LLUIColor mImageColor;
|
||||
LLUIColor mDisabledImageColor;
|
||||
|
|
@ -373,6 +380,8 @@ protected:
|
|||
bool mUseEllipses;
|
||||
bool mUseFontColor;
|
||||
bool mFlashing;
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
bool mIsAltFlashColor;
|
||||
|
||||
LLFontGL::HAlign mHAlign;
|
||||
S32 mLeftHPad;
|
||||
|
|
|
|||
|
|
@ -461,10 +461,16 @@ bool LLMultiFloater::isFloaterFlashing(LLFloater* floaterp)
|
|||
|
||||
Requires: floaterp != NULL
|
||||
**/
|
||||
void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing)
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing)
|
||||
void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing, bool alternate_color)
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
{
|
||||
if ( floaterp && floaterp->getHost() == this )
|
||||
mTabContainer->setTabPanelFlashing(floaterp, flashing);
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//mTabContainer->setTabPanelFlashing(floaterp, flashing);
|
||||
mTabContainer->setTabPanelFlashing(floaterp, flashing, alternate_color);
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
}
|
||||
|
||||
void LLMultiFloater::onTabSelected()
|
||||
|
|
|
|||
|
|
@ -68,7 +68,10 @@ public:
|
|||
virtual bool isFloaterFlashing(LLFloater* floaterp);
|
||||
virtual S32 getFloaterCount() const;
|
||||
|
||||
virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing);
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing);
|
||||
virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing, bool alternate_color = false);
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
virtual bool closeAllFloaters(); //Returns false if the floater could not be closed due to pending confirmation dialogs
|
||||
// <FS> Update torn off status and add title bar
|
||||
//void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } // LL Code
|
||||
|
|
|
|||
|
|
@ -1806,12 +1806,18 @@ bool LLTabContainer::getTabPanelFlashing(LLPanel *child)
|
|||
return false;
|
||||
}
|
||||
|
||||
void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state )
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state )
|
||||
void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state, bool alternate_color)
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
{
|
||||
LLTabTuple* tuple = getTabByPanel(child);
|
||||
if( tuple )
|
||||
{
|
||||
tuple->mButton->setFlashing( state );
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//tuple->mButton->setFlashing( state );
|
||||
tuple->mButton->setFlashing(state, false, alternate_color);
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,10 @@ public:
|
|||
void setCurrentPanelIndex(S32 index) { mCurrentTabIdx = index; }
|
||||
|
||||
bool getTabPanelFlashing(LLPanel* child);
|
||||
void setTabPanelFlashing(LLPanel* child, bool state);
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
//void setTabPanelFlashing(LLPanel* child, bool state);
|
||||
void setTabPanelFlashing(LLPanel* child, bool state, bool alternate_color = false);
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "llchicletbar.h"
|
||||
#include "llemojihelper.h"
|
||||
#include "lltoolbarview.h"
|
||||
#include "llurlregistry.h"
|
||||
#include "llvoiceclient.h"
|
||||
|
||||
constexpr F32 VOICE_STATUS_UPDATE_INTERVAL = 1.0f;
|
||||
|
|
@ -316,6 +317,9 @@ void FSFloaterIMContainer::removeFloater(LLFloater* floaterp)
|
|||
gSavedSettings.setBOOL(setting_name, true);
|
||||
floaterp->setCanClose(true);
|
||||
}
|
||||
|
||||
mFlashingTabStates.erase(floaterp);
|
||||
|
||||
LLMultiFloater::removeFloater(floaterp);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
|
@ -345,21 +349,17 @@ void FSFloaterIMContainer::onCloseFloater(LLUUID& id)
|
|||
}
|
||||
}
|
||||
|
||||
void FSFloaterIMContainer::onNewMessageReceived(const LLSD& data)
|
||||
void FSFloaterIMContainer::onNewMessageReceived(const LLSD& msg)
|
||||
{
|
||||
LLUUID session_id = data["session_id"].asUUID();
|
||||
LLUUID session_id = msg["session_id"].asUUID();
|
||||
LLFloater* floaterp = get_ptr_in_map(mSessions, session_id);
|
||||
LLFloater* current_floater = LLMultiFloater::getActiveFloater();
|
||||
|
||||
// KC: Don't flash tab on friend status changes per setting
|
||||
if (floaterp && current_floater && floaterp != current_floater
|
||||
&& (gSavedSettings.getBOOL("FSIMChatFlashOnFriendStatusChange") || !data.has("from_id") || data["from_id"].asUUID().notNull()))
|
||||
&& (gSavedSettings.getBOOL("FSIMChatFlashOnFriendStatusChange") || !msg.has("from_id") || msg["from_id"].asUUID().notNull()))
|
||||
{
|
||||
if (LLMultiFloater::isFloaterFlashing(floaterp))
|
||||
{
|
||||
LLMultiFloater::setFloaterFlashing(floaterp, false);
|
||||
}
|
||||
LLMultiFloater::setFloaterFlashing(floaterp, true);
|
||||
startFlashingTab(floaterp, msg["message"].asString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -559,16 +559,15 @@ void FSFloaterIMContainer::addFlashingSession(const LLUUID& session_id)
|
|||
uuid_vec_t::iterator found = std::find(mFlashingSessions.begin(), mFlashingSessions.end(), session_id);
|
||||
if (found == mFlashingSessions.end())
|
||||
{
|
||||
mFlashingSessions.push_back(session_id);
|
||||
mFlashingSessions.emplace_back(session_id);
|
||||
}
|
||||
|
||||
checkFlashing();
|
||||
}
|
||||
|
||||
void FSFloaterIMContainer::checkFlashing()
|
||||
{
|
||||
if (mFlashingSessions.empty())
|
||||
{
|
||||
gToolBarView->flashCommand(LLCommandId("chat"), false);
|
||||
}
|
||||
gToolBarView->flashCommand(LLCommandId("chat"), !mFlashingSessions.empty(), isMinimized());
|
||||
}
|
||||
|
||||
void FSFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id)
|
||||
|
|
@ -584,5 +583,21 @@ void FSFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const
|
|||
void FSFloaterIMContainer::tabOpen(LLFloater* opened_floater, bool from_click)
|
||||
{
|
||||
LLEmojiHelper::instance().hideHelper(nullptr, true);
|
||||
|
||||
mFlashingTabStates.erase(opened_floater);
|
||||
}
|
||||
|
||||
void FSFloaterIMContainer::startFlashingTab(LLFloater* floater, const std::string& message)
|
||||
{
|
||||
const bool contains_mention = LLUrlRegistry::getInstance()->containsAgentMention(message);
|
||||
|
||||
auto& [session_floater, is_alt_flashing] = *(mFlashingTabStates.try_emplace(floater, false).first);
|
||||
is_alt_flashing = is_alt_flashing || contains_mention;
|
||||
|
||||
if (LLMultiFloater::isFloaterFlashing(floater))
|
||||
{
|
||||
LLMultiFloater::setFloaterFlashing(floater, false);
|
||||
}
|
||||
LLMultiFloater::setFloaterFlashing(floater, true, is_alt_flashing);
|
||||
}
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
virtual void setVisible(bool b);
|
||||
/*virtual*/ void setMinimized(bool b);
|
||||
|
||||
void onNewMessageReceived(const LLSD& data); // public so nearbychat can call it directly. TODO: handle via callback. -AO
|
||||
void onNewMessageReceived(const LLSD& msg); // public so nearbychat can call it directly. TODO: handle via callback. -AO
|
||||
|
||||
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, bool has_offline_msg);
|
||||
virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
|
||||
|
|
@ -78,6 +78,8 @@ public:
|
|||
|
||||
void tabOpen(LLFloater* opened_floater, bool from_click);
|
||||
|
||||
void startFlashingTab(LLFloater* floater, const std::string& message);
|
||||
|
||||
private:
|
||||
enum eVoiceState
|
||||
{
|
||||
|
|
@ -105,6 +107,8 @@ private:
|
|||
|
||||
bool mIsAddingNewSession;
|
||||
|
||||
std::map<LLFloater*, bool> mFlashingTabStates;
|
||||
|
||||
// [SL:KB] - Patch: UI-TabRearrange | Checked: 2012-05-05 (Catznip-3.3.0)
|
||||
protected:
|
||||
void onIMTabRearrange(S32 tab_index, LLPanel* tab_panel);
|
||||
|
|
|
|||
|
|
@ -276,11 +276,11 @@ void FSFloaterNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD
|
|||
// AO: IF tab mode active, flash our tab
|
||||
if (isChatMultiTab())
|
||||
{
|
||||
LLMultiFloater* hostp = getHost();
|
||||
// KC: Don't flash tab on system messages
|
||||
if (!isInVisibleChain() && hostp && (chat.mSourceType == CHAT_SOURCE_AGENT || chat.mSourceType == CHAT_SOURCE_OBJECT))
|
||||
if (FSFloaterIMContainer* container = dynamic_cast<FSFloaterIMContainer*>(getHost());
|
||||
!isInVisibleChain() && container && (chat.mSourceType == CHAT_SOURCE_AGENT || chat.mSourceType == CHAT_SOURCE_OBJECT))
|
||||
{
|
||||
hostp->setFloaterFlashing(this, true);
|
||||
container->startFlashingTab(this, chat.mText);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -468,7 +468,6 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
|
|||
&& gSavedSettings.getBOOL("FSNotifyNearbyChatFlash"))
|
||||
{
|
||||
im_container->addFlashingSession(session_id);
|
||||
gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -492,7 +491,6 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
|
|||
&& gSavedSettings.getBOOL("FSNotifyIMFlash"))
|
||||
{
|
||||
im_container->addFlashingSession(session_id);
|
||||
gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized());
|
||||
}
|
||||
|
||||
// <FS:Ansariel> (Group-)IMs in chat console
|
||||
|
|
|
|||
|
|
@ -1437,4 +1437,7 @@
|
|||
<color
|
||||
name="ChatSelfMentionHighlight"
|
||||
value="1 1 0.383 1" />
|
||||
<color
|
||||
name="MentionFlashBgColor"
|
||||
reference="EmphasisColor" />
|
||||
</colors>
|
||||
|
|
|
|||
|
|
@ -1190,4 +1190,7 @@
|
|||
<color
|
||||
name="NotecardCursorColor"
|
||||
reference="TextCursorColor" />
|
||||
<color
|
||||
name="MentionFlashBgColor"
|
||||
reference="EmphasisColor" />
|
||||
</colors>
|
||||
|
|
|
|||
|
|
@ -1430,4 +1430,7 @@
|
|||
<color
|
||||
name="ChatSelfMentionHighlight"
|
||||
value="1 1 0.734 1" />
|
||||
<color
|
||||
name="MentionFlashBgColor"
|
||||
reference="EmphasisColor" />
|
||||
</colors>
|
||||
|
|
|
|||
|
|
@ -1178,4 +1178,7 @@
|
|||
<color
|
||||
name="NotecardCursorColor"
|
||||
reference="TextCursorColor" />
|
||||
<color
|
||||
name="MentionFlashBgColor"
|
||||
reference="EmphasisColor" />
|
||||
</colors>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
image_color="ButtonImageColor"
|
||||
image_color_disabled="ButtonImageColor"
|
||||
flash_color="ButtonFlashBgColor"
|
||||
flash_alt_color="MentionFlashBgColor"
|
||||
font="SansSerifSmall"
|
||||
hover_glow_amount="0.25"
|
||||
halign="center"
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
image_color="SL-CustomMain"
|
||||
image_color_disabled="ButtonImageColor"
|
||||
flash_color="SL-CustomMain"
|
||||
flash_alt_color="MentionFlashBgColor"
|
||||
font="SansSerifSmall"
|
||||
hover_glow_amount="0.25"
|
||||
halign="center"
|
||||
|
|
|
|||
Loading…
Reference in New Issue