MAINT-7215 Add "+" button next to filter editor in Avatar rendering settings floater
parent
bc268526b7
commit
3c637e4945
|
|
@ -28,6 +28,7 @@
|
|||
#include "llfloateravatarrendersettings.h"
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llfloateravatarpicker.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llnamelistctrl.h"
|
||||
|
|
@ -71,6 +72,7 @@ LLFloaterAvatarRenderSettings::LLFloaterAvatarRenderSettings(const LLSD& key)
|
|||
{
|
||||
mContextMenu = new LLSettingsContextMenu(this);
|
||||
LLRenderMuteList::getInstance()->addObserver(&sAvatarRenderMuteListObserver);
|
||||
mCommitCallbackRegistrar.add("Settings.AddNewEntry", boost::bind(&LLFloaterAvatarRenderSettings::onClickAdd, this, _2));
|
||||
}
|
||||
|
||||
LLFloaterAvatarRenderSettings::~LLFloaterAvatarRenderSettings()
|
||||
|
|
@ -84,12 +86,20 @@ BOOL LLFloaterAvatarRenderSettings::postBuild()
|
|||
LLFloater::postBuild();
|
||||
mAvatarSettingsList = getChild<LLNameListCtrl>("render_settings_list");
|
||||
mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3));
|
||||
|
||||
this->setVisibleCallback(boost::bind(&LLFloaterAvatarRenderSettings::removePicker, this));
|
||||
getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterAvatarRenderSettings::removePicker()
|
||||
{
|
||||
if(mPicker.get())
|
||||
{
|
||||
mPicker.get()->closeFloater();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterAvatarRenderSettings::draw()
|
||||
{
|
||||
if(mNeedsUpdate)
|
||||
|
|
@ -185,15 +195,15 @@ void LLFloaterAvatarRenderSettings::onCustomAction (const LLSD& userdata, const
|
|||
if ("default" == command_name)
|
||||
{
|
||||
new_setting = S32(LLVOAvatar::AV_RENDER_NORMALLY);
|
||||
}
|
||||
}
|
||||
else if ("never" == command_name)
|
||||
{
|
||||
{
|
||||
new_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER);
|
||||
}
|
||||
else if ("always" == command_name)
|
||||
{
|
||||
{
|
||||
new_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER);
|
||||
}
|
||||
}
|
||||
|
||||
LLVOAvatar *avatarp = find_avatar(av_id);
|
||||
if (avatarp)
|
||||
|
|
@ -233,3 +243,44 @@ void LLFloaterAvatarRenderSettings::setNeedsUpdate()
|
|||
if(!instance) return;
|
||||
instance->mNeedsUpdate = true;
|
||||
}
|
||||
|
||||
void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata)
|
||||
{
|
||||
const std::string command_name = userdata.asString();
|
||||
S32 visual_setting = 0;
|
||||
if ("never" == command_name)
|
||||
{
|
||||
visual_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER);
|
||||
}
|
||||
else if ("always" == command_name)
|
||||
{
|
||||
visual_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER);
|
||||
}
|
||||
|
||||
LLView * button = findChild<LLButton>("plus_btn", TRUE);
|
||||
LLFloater* root_floater = gFloaterView->getParentFloater(this);
|
||||
LLFloaterAvatarPicker * picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterAvatarRenderSettings::callbackAvatarPicked, this, _1, visual_setting),
|
||||
FALSE, TRUE, FALSE, root_floater->getName(), button);
|
||||
|
||||
if (root_floater)
|
||||
{
|
||||
root_floater->addDependentFloater(picker);
|
||||
}
|
||||
|
||||
mPicker = picker->getHandle();
|
||||
}
|
||||
|
||||
void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting)
|
||||
{
|
||||
if (ids.empty()) return;
|
||||
|
||||
LLVOAvatar *avatarp = find_avatar(ids[0]);
|
||||
if (avatarp)
|
||||
{
|
||||
avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(visual_setting));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLRenderMuteList::getInstance()->saveVisualMuteSetting(ids[0], visual_setting);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,15 +50,19 @@ public:
|
|||
void onFilterEdit(const std::string& search_string);
|
||||
void onCustomAction (const LLSD& userdata, const LLUUID& av_id);
|
||||
bool isActionChecked(const LLSD& userdata, const LLUUID& av_id);
|
||||
void onClickAdd(const LLSD& userdata);
|
||||
|
||||
static void setNeedsUpdate();
|
||||
|
||||
private:
|
||||
bool isHiddenRow(const std::string& av_name);
|
||||
void callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting);
|
||||
void removePicker();
|
||||
|
||||
bool mNeedsUpdate;
|
||||
LLListContextMenu* mContextMenu;
|
||||
LLNameListCtrl* mAvatarSettingsList;
|
||||
LLHandle<LLFloater> mPicker;
|
||||
|
||||
std::string mNameFilter;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,22 +23,33 @@
|
|||
height="23"
|
||||
layout="topleft"
|
||||
left="8"
|
||||
right="-8"
|
||||
right="-47"
|
||||
label="Filter People"
|
||||
max_length_chars="300"
|
||||
name="people_filter_input"
|
||||
text_color="Black"
|
||||
text_pad_left="10"
|
||||
top="4" />
|
||||
<menu_button
|
||||
follows="top|right"
|
||||
height="25"
|
||||
image_hover_unselected="Toolbar_Middle_Over"
|
||||
image_overlay="AddItem_Off"
|
||||
image_selected="Toolbar_Middle_Selected"
|
||||
image_unselected="Toolbar_Middle_Off"
|
||||
layout="topleft"
|
||||
left_pad="7"
|
||||
menu_filename="menu_avatar_rendering_settings_add.xml"
|
||||
menu_position="bottomleft"
|
||||
name="plus_btn"
|
||||
tool_tip="Actions on selected person"
|
||||
top="3"
|
||||
width="31" />
|
||||
<name_list
|
||||
allow_select="true"
|
||||
bottom="-8"
|
||||
draw_heading="true"
|
||||
opaque="true"
|
||||
follows="all"
|
||||
left="8"
|
||||
keep_selection_visible_on_reshape="true"
|
||||
item_pad="2"
|
||||
multi_select="false"
|
||||
name="render_settings_list"
|
||||
right="-8"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu
|
||||
name="menu_settings_add.xml"
|
||||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false">
|
||||
<menu_item_call
|
||||
label="Always Render a Resident..."
|
||||
name="add_avatar_always_render">
|
||||
<on_click
|
||||
function="Settings.AddNewEntry" parameter="always"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Never Render a Resident..."
|
||||
name="add_avatar_never_render">
|
||||
<on_click
|
||||
function="Settings.AddNewEntry" parameter="never"/>
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
@ -303,8 +303,6 @@
|
|||
name="AlwaysRenderFriends"
|
||||
top_delta="24"
|
||||
width="256">
|
||||
<check_box.commit_callback
|
||||
function="Pref.RenderFriends" />
|
||||
</check_box>
|
||||
<button
|
||||
height="23"
|
||||
|
|
|
|||
Loading…
Reference in New Issue