Undo some terrible cruft regarding mini icons in chat history headers

meow-7.2.2
Ansariel 2020-07-30 13:03:42 +02:00
parent a22009d0cc
commit 700af52476
5 changed files with 107 additions and 72 deletions

View File

@ -362,94 +362,94 @@ public:
void onAvatarIconContextMenuItemClicked(const LLSD& userdata)
{
std::string level = userdata.asString();
std::string param = userdata.asString();
if (level == "profile")
if (param == "profile")
{
LLAvatarActions::showProfile(getAvatarId());
}
else if (level == "im")
else if (param == "im")
{
LLAvatarActions::startIM(getAvatarId());
}
else if (level == "teleport_to")
else if (param == "teleport_to")
{
LLAvatarActions::teleportTo(getAvatarId());
}
else if (level == "teleport")
else if (param == "teleport")
{
LLAvatarActions::offerTeleport(getAvatarId());
}
else if (level == "request_teleport")
else if (param == "request_teleport")
{
LLAvatarActions::teleportRequest(getAvatarId());
}
else if (level == "voice_call")
else if (param == "voice_call")
{
LLAvatarActions::startCall(getAvatarId());
}
else if (level == "chat_history")
else if (param == "chat_history")
{
LLAvatarActions::viewChatHistory(getAvatarId());
}
else if (level == "add")
else if (param == "add")
{
LLAvatarActions::requestFriendshipDialog(getAvatarId(), mFrom);
}
else if (level == "add_set")
else if (param == "add_set")
{
LLAvatarActions::addToContactSet(getAvatarId());
}
else if (level == "remove")
else if (param == "remove")
{
LLAvatarActions::removeFriendDialog(getAvatarId());
}
else if (level == "invite_to_group")
else if (param == "invite_to_group")
{
LLAvatarActions::inviteToGroup(getAvatarId());
}
else if (level == "zoom_in")
else if (param == "zoom_in")
{
handle_zoom_to_object(getAvatarId());
}
else if (level == "map")
else if (param == "map")
{
LLAvatarActions::showOnMap(getAvatarId());
}
else if (level == "track")
else if (param == "track")
{
LLAvatarActions::track(getAvatarId());
}
else if (level == "share")
else if (param == "share")
{
LLAvatarActions::share(getAvatarId());
}
else if (level == "pay")
else if (param == "pay")
{
LLAvatarActions::pay(getAvatarId());
}
else if (level == "copy_name")
else if (param == "copy_name")
{
LLUrlAction::copyLabelToClipboard(LLSLURL("agent", getAvatarId(), "inspect").getSLURLString());
}
else if (level == "copy_url")
else if (param == "copy_url")
{
LLUrlAction::copyURLToClipboard(LLSLURL("agent", getAvatarId(), "about").getSLURLString());
}
else if(level == "block_unblock")
else if (param == "block_unblock")
{
LLAvatarActions::toggleMute(getAvatarId(), LLMute::flagVoiceChat);
}
else if(level == "mute_unmute")
else if (param == "mute_unmute")
{
LLAvatarActions::toggleMute(getAvatarId(), LLMute::flagTextChat);
}
else if(level == "toggle_allow_text_chat")
else if (param == "toggle_allow_text_chat")
{
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
speaker_mgr->toggleAllowTextChat(getAvatarId());
}
else if(level == "group_mute")
else if (param == "group_mute")
{
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
if (speaker_mgr)
@ -457,7 +457,7 @@ public:
speaker_mgr->moderateVoiceParticipant(getAvatarId(), false);
}
}
else if(level == "group_unmute")
else if (param == "group_unmute")
{
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
if (speaker_mgr)
@ -465,7 +465,7 @@ public:
speaker_mgr->moderateVoiceParticipant(getAvatarId(), true);
}
}
else if(level == "ban_member")
else if (param == "ban_member")
{
banGroupMember(getAvatarId());
}
@ -473,17 +473,17 @@ public:
bool onAvatarIconContextMenuItemChecked(const LLSD& userdata)
{
std::string level = userdata.asString();
std::string param = userdata.asString();
if (level == "is_blocked")
if (param == "is_blocked")
{
return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagVoiceChat);
}
if (level == "is_muted")
if (param == "is_muted")
{
return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagTextChat);
}
else if (level == "is_allowed_text_chat")
else if (param == "is_allowed_text_chat")
{
if (gAgent.isInGroup(mSessionID))
{
@ -502,13 +502,13 @@ public:
bool onAvatarIconContextMenuItemEnabled(const LLSD& userdata)
{
std::string level = userdata.asString();
std::string param = userdata.asString();
if (level == "can_allow_text_chat" || level == "can_mute" || level == "can_unmute")
if (param == "can_allow_text_chat" || param == "can_mute" || param == "can_unmute")
{
return canModerate(userdata);
}
else if (level == "can_ban_member")
else if (param == "can_ban_member")
{
return canBanGroupMember(getAvatarId());
}
@ -517,9 +517,9 @@ public:
bool onAvatarIconContextMenuItemVisible(const LLSD& userdata)
{
std::string level = userdata.asString();
std::string param = userdata.asString();
if (level == "show_mute")
if (param == "show_mute")
{
LLSpeakerMgr * speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
if (speaker_mgr)
@ -532,7 +532,7 @@ public:
}
return false;
}
else if (level == "show_unmute")
else if (param == "show_unmute")
{
LLSpeakerMgr * speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
if (speaker_mgr)
@ -782,12 +782,6 @@ public:
// Set up the icon.
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
// Hacky preference to hide avatar icons for people who don't like them by overdrawing them. Will change to disable soon. -AO
if (!gSavedSettings.getBOOL("ShowChatMiniIcons"))
{
icon->setColor(LLUIColorTable::instance().getColor("Transparent"));
}
if(mSourceType != CHAT_SOURCE_AGENT || mAvatarID.isNull())
icon->setDrawTooltip(false);

View File

@ -137,6 +137,10 @@ bool FSChatOptionsMenu::onMenuItemVisible(const LLSD& userdata, LLUICtrl* source
{
return (dynamic_cast<FSFloaterIM*>(source) != NULL);
}
else if (option == "show_mini_icons")
{
return !gSavedSettings.getBOOL("PlainTextChatHistory");
}
return false;
}

View File

@ -4,6 +4,7 @@
<menu_item_check label="Stimmen in der Nähe anzeigen..." name="nearby_voice"/>
<menu_item_check label="Blockierliste anzeigen..." name="block_list"/>
<menu_item_check label="V1-Stil für Chatverlauf verwenden" name="plain_text_chat_history"/>
<menu_item_check label="Profilbild in Chatüberschrift anzeigen" name="chat_header_icons"/>
<context_menu label="Schriftgröße..." name="font_size">
<menu_item_check label="Klein" name="font_size_small"/>
<menu_item_check label="Mittel" name="font_size_medium"/>

View File

@ -41,6 +41,19 @@
function="ToggleControl"
parameter="PlainTextChatHistory"/>
</menu_item_check>
<menu_item_check
label="Show profile icons in chat headers"
name="chat_header_icons">
<menu_item_check.on_check
function="CheckControl"
parameter="ShowChatMiniIcons"/>
<menu_item_check.on_click
function="ToggleControl"
parameter="ShowChatMiniIcons"/>
<menu_item_check.on_visible
function="ChatOptions.Visible"
parameter="show_mini_icons"/>
</menu_item_check>
<context_menu
label="Font size..."
name="font_size">

View File

@ -1,44 +1,67 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
background_visible="true"
background_visible="true"
bevel_style="in"
bg_opaque_color="ChatHeaderOpaqueBackground"
bg_alpha_color="ChatHeaderAlphaBackground"
follows="top|left|right"
height="24"
label="im_header"
layout="topleft"
layout="topleft"
name="im_header"
width="310">
<avatar_icon
follows="left"
height="18"
image_name="Generic_Person"
layout="topleft"
left="3"
mouse_opaque="true"
name="avatar_icon"
top="3"
width="18" />
<text
parse_urls="false"
allow_scroll="false"
v_pad = "6"
read_only = "true"
follows="left|right"
font.style="BOLD"
height="24"
layout="topleft"
left_pad="5"
right="-120"
name="user_name"
text_color="ChatNameColor"
bg_readonly_color="Black"
top="0"
translate="false"
use_ellipses="true"
valign="top"
value="TestString PleaseIgnore" />
<layout_stack
top="0"
height="24"
right="-120"
name="header_ls"
layout="topleft"
follows="top|left|right"
animate="false">
<layout_panel
name="icon_lp"
auto_resize="false"
user_resize="false"
width="21"
height="24"
visibility_control="ShowChatMiniIcons">
<avatar_icon
follows="left"
height="18"
image_name="Generic_Person"
layout="topleft"
left="3"
mouse_opaque="true"
name="avatar_icon"
top="3"
width="18" />
</layout_panel>
<layout_panel
name="name_lp"
auto_resize="true"
user_resize="false"
height="24">
<text
parse_urls="false"
allow_scroll="false"
v_pad="6"
read_only="true"
follows="left|right"
font.style="BOLD"
height="24"
layout="topleft"
left="4"
right="-1"
name="user_name"
text_color="ChatNameColor"
bg_readonly_color="Black"
top="0"
translate="false"
use_ellipses="true"
valign="top"
value="TestString PleaseIgnore" />
</layout_panel>
</layout_stack>
<text
allow_scroll="false"
font="SansSerifSmall"