Fix findChild during draw in conversation log floater

master
Rye Mutt 2024-07-26 00:31:51 -04:00
parent 99b4f1dd20
commit dce1218b03
2 changed files with 5 additions and 2 deletions

View File

@ -55,10 +55,11 @@ bool LLFloaterConversationLog::postBuild()
}
// Use the context menu of the Conversation list for the Conversation tab gear menu.
mConversationsGearBtn = getChild<LLMenuButton>("conversations_gear_btn");
LLToggleableMenu* conversations_gear_menu = mConversationLogList->getContextMenu();
if (conversations_gear_menu)
{
getChild<LLMenuButton>("conversations_gear_btn")->setMenu(conversations_gear_menu, LLMenuButton::MP_BOTTOM_LEFT);
mConversationsGearBtn->setMenu(conversations_gear_menu, LLMenuButton::MP_BOTTOM_LEFT);
}
getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterConversationLog::onFilterEdit, this, _2));
@ -68,7 +69,7 @@ bool LLFloaterConversationLog::postBuild()
void LLFloaterConversationLog::draw()
{
getChild<LLMenuButton>("conversations_gear_btn")->setEnabled(mConversationLogList->getSelectedItem() != NULL);
mConversationsGearBtn->setEnabled(mConversationLogList->getSelectedItem() != NULL);
LLFloater::draw();
}

View File

@ -29,6 +29,7 @@
#include "llfloater.h"
class LLConversationLogList;
class LLMenuButton;
class LLFloaterConversationLog : public LLFloater
{
@ -50,6 +51,7 @@ private:
bool isActionChecked(const LLSD& userdata);
LLConversationLogList* mConversationLogList;
LLMenuButton* mConversationsGearBtn = nullptr;
};