Merge pull request #151 from FirestormViewer/feature/conversations_opacity_options
[FIRE-35804] Implemented separate Conversations opacity optionsmeow-7.2.2
commit
0e4bd97915
|
|
@ -44,3 +44,11 @@ void LLFilterEditor::handleKeystroke()
|
|||
// Commit on every keystroke.
|
||||
onCommit();
|
||||
}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
void LLFilterEditor::setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb)
|
||||
{
|
||||
// Simply setting it on the LLFilterEditor object doesn't work
|
||||
mSearchEditor->setTransparencyOverrideCallback(cb);
|
||||
}
|
||||
// </FS:TJ>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ public:
|
|||
{};
|
||||
virtual ~LLFilterEditor() {}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
void setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb) override;
|
||||
// </FS:TJ>
|
||||
|
||||
protected:
|
||||
LLFilterEditor(const Params&);
|
||||
friend class LLUICtrlFactory;
|
||||
|
|
|
|||
|
|
@ -1086,6 +1086,13 @@ F32 LLUICtrl::getCurrentTransparency()
|
|||
|
||||
}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
if (mTransparencyOverrideCallback)
|
||||
{
|
||||
return mTransparencyOverrideCallback(mTransparencyType, alpha);
|
||||
}
|
||||
// </FS:TJ>
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -238,6 +238,11 @@ public:
|
|||
void setTransparencyType(ETypeTransparency type);
|
||||
ETypeTransparency getTransparencyType() const {return mTransparencyType;}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
boost::function<F32(ETypeTransparency, F32)> mTransparencyOverrideCallback;
|
||||
virtual void setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb) { mTransparencyOverrideCallback = cb; }
|
||||
// </FS:TJ>
|
||||
|
||||
bool focusNextItem(bool text_entry_only);
|
||||
bool focusPrevItem(bool text_entry_only);
|
||||
|
||||
|
|
|
|||
|
|
@ -26949,5 +26949,27 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSIMOpacity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Opacity of the IM floater</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1.0</real>
|
||||
</map>
|
||||
<key>FSImActiveOpacityOverride</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>When enabled, uses the Active Opacity value when IM window is focused</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ bool FSFloaterContacts::postBuild()
|
|||
mFriendsCountTb->setTextArg("COUNT", llformat("%d", mFriendsList->getItemCount()));
|
||||
mFriendFilter = mFriendsTab->getChild<LLFilterEditor>("friend_filter_input");
|
||||
mFriendFilter->setCommitCallback(boost::bind(&FSFloaterContacts::onFriendFilterEdit, this, _2));
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
mFriendFilter->setTransparencyOverrideCallback(boost::bind(&FSFloaterContacts::onGetFilterOpacityCallback, this, _1, _2));
|
||||
// </FS:TJ>
|
||||
|
||||
mGroupsTab = getChild<LLPanel>(GROUP_TAB_NAME);
|
||||
mGroupList = mGroupsTab->getChild<LLGroupList>("group_list");
|
||||
|
|
@ -163,6 +166,9 @@ bool FSFloaterContacts::postBuild()
|
|||
mGroupssCountTb = mGroupsTab->getChild<LLTextBox>("groupcount");
|
||||
mGroupFilter = mGroupsTab->getChild<LLFilterEditor>("group_filter_input");
|
||||
mGroupFilter->setCommitCallback(boost::bind(&FSFloaterContacts::onGroupFilterEdit, this, _2));
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
mGroupFilter->setTransparencyOverrideCallback(boost::bind(&FSFloaterContacts::onGetFilterOpacityCallback, this, _1, _2));
|
||||
// </FS:TJ>
|
||||
|
||||
mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&FSFloaterContacts::updateRlvRestrictions, this, _1));
|
||||
|
||||
|
|
@ -1345,4 +1351,19 @@ void FSFloaterContacts::onGroupFilterEdit(const std::string& search_string)
|
|||
{
|
||||
mGroupList->setNameFilter(search_string);
|
||||
}
|
||||
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
// This is specifically for making the filter editors such as mFriendFilter and mGroupFilter always active opacity when the IM floater is focused
|
||||
// Otherwise if they aren't active, it will use either the IM opacity, or inactive opacity, whatever is smaller
|
||||
F32 FSFloaterContacts::onGetFilterOpacityCallback(ETypeTransparency type, F32 alpha)
|
||||
{
|
||||
static LLCachedControl<F32> im_opacity(gSavedSettings, "FSIMOpacity", 1.0f);
|
||||
if (type != TT_ACTIVE)
|
||||
{
|
||||
return llmin(im_opacity, alpha);
|
||||
}
|
||||
|
||||
return alpha;
|
||||
}
|
||||
// </FS:TJ>
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ public:
|
|||
void onDisplayNameChanged();
|
||||
void resetFriendFilter();
|
||||
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
F32 onGetFilterOpacityCallback(ETypeTransparency type, F32 alpha);
|
||||
// </FS:TJ>
|
||||
|
||||
private:
|
||||
typedef std::vector<LLScrollListItem*> listitem_vec_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
mInputEditor->setTransparencyOverrideCallback(boost::bind(&FSFloaterIM::onGetChatEditorOpacityCallback, this, _1, _2));
|
||||
// </FS:TJ>
|
||||
|
||||
mEmojiRecentPanelToggleBtn = getChild<LLButton>("emoji_recent_panel_toggle_btn");
|
||||
mEmojiRecentPanelToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiRecentPanelToggleBtnClicked(); });
|
||||
|
|
@ -2650,3 +2653,18 @@ uuid_vec_t FSFloaterIM::getSessionParticipants() const
|
|||
|
||||
return mControlPanel->getParticipants();
|
||||
}
|
||||
|
||||
// <FS:TJ> [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
|
||||
// Otherwise if they aren't active, it will use either the IM opacity, or inactive opacity, whatever is smaller
|
||||
F32 FSFloaterIM::onGetChatEditorOpacityCallback(ETypeTransparency type, F32 alpha)
|
||||
{
|
||||
static LLCachedControl<F32> im_opacity(gSavedSettings, "FSIMOpacity", 1.0f);
|
||||
if (type != TT_ACTIVE)
|
||||
{
|
||||
return llmin(im_opacity, alpha);
|
||||
}
|
||||
|
||||
return alpha;
|
||||
}
|
||||
// </FS:TJ>
|
||||
|
|
|
|||
|
|
@ -164,6 +164,10 @@ public:
|
|||
|
||||
uuid_vec_t getSessionParticipants() const;
|
||||
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
F32 onGetChatEditorOpacityCallback(ETypeTransparency type, F32 alpha);
|
||||
// </FS:TJ>
|
||||
|
||||
protected:
|
||||
/* virtual */
|
||||
void onClickCloseBtn(bool app_quitting = false);
|
||||
|
|
|
|||
|
|
@ -373,6 +373,22 @@ FSFloaterIMContainer* FSFloaterIMContainer::getInstance()
|
|||
return LLFloaterReg::getTypedInstance<FSFloaterIMContainer>("fs_im_container");
|
||||
}
|
||||
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
F32 FSFloaterIMContainer::getCurrentTransparency()
|
||||
{
|
||||
static LLCachedControl<F32> im_opacity(gSavedSettings, "FSIMOpacity", 1.0f);
|
||||
static LLCachedControl<bool> 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);
|
||||
}
|
||||
// </FS:TJ>
|
||||
|
||||
void FSFloaterIMContainer::setVisible(bool b)
|
||||
{
|
||||
LLMultiFloater::setVisible(b);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public:
|
|||
static FSFloaterIMContainer* findInstance();
|
||||
static FSFloaterIMContainer* getInstance();
|
||||
|
||||
F32 getCurrentTransparency() override; // <FS:TJ/> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
|
||||
virtual void setVisible(bool b);
|
||||
/*virtual*/ void setMinimized(bool b);
|
||||
|
||||
|
|
|
|||
|
|
@ -148,6 +148,9 @@ bool FSFloaterNearbyChat::postBuild()
|
|||
mInputEditor->setFont(LLViewerChat::getChatFont());
|
||||
mInputEditor->setLabel(getString("chatbox_label"));
|
||||
mInputEditor->enableSingleLineMode(gSavedSettings.getBOOL("FSUseSingleLineChatEntry"));
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
mInputEditor->setTransparencyOverrideCallback(boost::bind(&FSFloaterNearbyChat::onGetChatBoxOpacityCallback, this, _1, _2));
|
||||
// </FS:TJ>
|
||||
|
||||
mChatLayoutPanel = getChild<LLLayoutPanel>("chat_layout_panel");
|
||||
mInputPanels = getChild<LLLayoutStack>("input_panels");
|
||||
|
|
@ -1107,3 +1110,18 @@ uuid_vec_t FSFloaterNearbyChat::getSessionParticipants() const
|
|||
|
||||
return avatarIds;
|
||||
}
|
||||
|
||||
// <FS:TJ> [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
|
||||
// Otherwise if they aren't active, it will use either the IM opacity, or inactive opacity, whatever is smaller
|
||||
F32 FSFloaterNearbyChat::onGetChatBoxOpacityCallback(ETypeTransparency type, F32 alpha)
|
||||
{
|
||||
static LLCachedControl<F32> im_opacity(gSavedSettings, "FSIMOpacity", 1.0f);
|
||||
if (type != TT_ACTIVE)
|
||||
{
|
||||
return llmin(im_opacity, alpha);
|
||||
}
|
||||
|
||||
return alpha;
|
||||
}
|
||||
// </FS:TJ>
|
||||
|
|
|
|||
|
|
@ -104,6 +104,10 @@ public:
|
|||
|
||||
uuid_vec_t getSessionParticipants() const;
|
||||
|
||||
// <FS:TJ> [FIRE-35804] Allow the IM floater to have separate transparency
|
||||
F32 onGetChatBoxOpacityCallback(ETypeTransparency type, F32 alpha);
|
||||
// </FS:TJ>
|
||||
|
||||
protected:
|
||||
void onChatBoxKeystroke();
|
||||
void onChatBoxFocusLost();
|
||||
|
|
|
|||
|
|
@ -1857,6 +1857,34 @@
|
|||
show_text="true"
|
||||
top_pad="2"
|
||||
width="415" />
|
||||
<slider
|
||||
can_edit_text="false"
|
||||
control_name="FSIMOpacity"
|
||||
decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="1.0"
|
||||
layout="topleft"
|
||||
label_width="115"
|
||||
label="Conversations:"
|
||||
left="50"
|
||||
max_val="1.00"
|
||||
min_val="0.00"
|
||||
name="conversations"
|
||||
show_text="true"
|
||||
top_pad="2"
|
||||
width="415" />
|
||||
<check_box
|
||||
control_name="FSImActiveOpacityOverride"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left="49"
|
||||
height="12"
|
||||
name="override_im_active_opacity_checkbox"
|
||||
top_pad="5"
|
||||
width="450"
|
||||
label="Use Active Opacity value when the Conversations window is focused" />
|
||||
<text
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
|
|
|
|||
Loading…
Reference in New Issue