diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index e23acd85b9..3dfbc508df 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -1086,6 +1086,14 @@ F32 LLUICtrl::getCurrentTransparency() } + // [FIRE-35804] Allow the IM floater to have separate transparency + // This is specifically for making the text editors such as chat_editor always active opacity when the IM floater is focused + if (mGetIMOpacityCallback && mTransparencyType != TT_ACTIVE) + { + return llmin(mGetIMOpacityCallback(), alpha); + } + // + return alpha; } diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 4be0a23261..eeb9296305 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -238,6 +238,11 @@ public: void setTransparencyType(ETypeTransparency type); ETypeTransparency getTransparencyType() const {return mTransparencyType;} + // [FIRE-35804] Allow the IM floater to have separate transparency + boost::function mGetIMOpacityCallback; + void setGetIMOpacityCallback (boost::function cb) { mGetIMOpacityCallback = cb; } + // + bool focusNextItem(bool text_entry_only); bool focusPrevItem(bool text_entry_only); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7531ea03c2..1316cf7853 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -26773,5 +26773,27 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSIMOpacity + + Comment + Opacity of the IM floater + Persist + 1 + Type + F32 + Value + 1.0 + + FSImActiveOpacityOverride + + Comment + When enabled, uses the Active Opacity value when IM window is focused + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index ef83dd0f4f..cf3e58edea 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -1010,6 +1010,9 @@ bool FSFloaterIM::postBuild() mInputEditor->setFont(LLViewerChat::getChatFont()); mInputEditor->enableSingleLineMode(gSavedSettings.getBOOL("FSUseSingleLineChatEntry")); mInputEditor->setCommitCallback(boost::bind(&FSFloaterIM::sendMsgFromInputEditor, this, CHAT_TYPE_NORMAL)); + // [FIRE-35804] Allow the IM floater to have separate transparency + mInputEditor->setGetIMOpacityCallback(boost::bind(&FSFloaterIM::onGetIMOpacityCallback)); + // mEmojiRecentPanelToggleBtn = getChild("emoji_recent_panel_toggle_btn"); mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(); }); @@ -2650,3 +2653,12 @@ uuid_vec_t FSFloaterIM::getSessionParticipants() const return mControlPanel->getParticipants(); } + +// [FIRE-35804] Allow the IM floater to have separate transparency +// static +F32 FSFloaterIM::onGetIMOpacityCallback() +{ + static LLCachedControl im_opacity(gSavedSettings, "FSIMOpacity", 1.0f); + return im_opacity; +} +// diff --git a/indra/newview/fsfloaterim.h b/indra/newview/fsfloaterim.h index 0b5d65bf7e..3ed36de1db 100644 --- a/indra/newview/fsfloaterim.h +++ b/indra/newview/fsfloaterim.h @@ -164,6 +164,8 @@ public: uuid_vec_t getSessionParticipants() const; + static F32 onGetIMOpacityCallback(); // [FIRE-35804] Allow the IM floater to have separate transparency + protected: /* virtual */ void onClickCloseBtn(bool app_quitting = false); diff --git a/indra/newview/fsfloaterimcontainer.cpp b/indra/newview/fsfloaterimcontainer.cpp index a4db0dc21a..19c4bd8f8a 100644 --- a/indra/newview/fsfloaterimcontainer.cpp +++ b/indra/newview/fsfloaterimcontainer.cpp @@ -373,6 +373,22 @@ FSFloaterIMContainer* FSFloaterIMContainer::getInstance() return LLFloaterReg::getTypedInstance("fs_im_container"); } +// [FIRE-35804] Allow the IM floater to have separate transparency +F32 FSFloaterIMContainer::getCurrentTransparency() +{ + static LLCachedControl im_opacity(gSavedSettings, "FSIMOpacity", 1.0f); + static LLCachedControl im_active_opacity_override(gSavedSettings, "FSImActiveOpacityOverride", false); + + F32 floater_opacity = LLUICtrl::getCurrentTransparency(); + if (im_active_opacity_override && getTransparencyType() == TT_ACTIVE) + { + return floater_opacity; + } + + return llmin(im_opacity(), floater_opacity); +} +// + void FSFloaterIMContainer::setVisible(bool b) { LLMultiFloater::setVisible(b); diff --git a/indra/newview/fsfloaterimcontainer.h b/indra/newview/fsfloaterimcontainer.h index 50b9b36d1f..198b32be6d 100644 --- a/indra/newview/fsfloaterimcontainer.h +++ b/indra/newview/fsfloaterimcontainer.h @@ -60,6 +60,8 @@ public: static FSFloaterIMContainer* findInstance(); static FSFloaterIMContainer* getInstance(); + F32 getCurrentTransparency() override; // [FIRE-35804] Allow the IM floater to have separate transparency + virtual void setVisible(bool b); /*virtual*/ void setMinimized(bool b); diff --git a/indra/newview/fsfloaternearbychat.cpp b/indra/newview/fsfloaternearbychat.cpp index 80e58347e8..ddea2b28ac 100644 --- a/indra/newview/fsfloaternearbychat.cpp +++ b/indra/newview/fsfloaternearbychat.cpp @@ -148,6 +148,9 @@ bool FSFloaterNearbyChat::postBuild() mInputEditor->setFont(LLViewerChat::getChatFont()); mInputEditor->setLabel(getString("chatbox_label")); mInputEditor->enableSingleLineMode(gSavedSettings.getBOOL("FSUseSingleLineChatEntry")); + // [FIRE-35804] Allow the IM floater to have separate transparency + mInputEditor->setGetIMOpacityCallback(boost::bind(&FSFloaterIM::onGetIMOpacityCallback)); + // mChatLayoutPanel = getChild("chat_layout_panel"); mInputPanels = getChild("input_panels"); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml index 8df8102615..5cfae471f2 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml @@ -1857,6 +1857,34 @@ show_text="true" top_pad="2" width="415" /> + +