Close on select before selection callback, if desired

This commit is contained in:
Lirusaito
2019-07-20 18:52:27 -04:00
parent 8126418ef3
commit 7d9642210d

View File

@@ -257,16 +257,21 @@ void LLFloaterAvatarPicker::onBtnSelect()
uuid_vec_t avatar_ids; uuid_vec_t avatar_ids;
std::vector<LLAvatarName> avatar_names; std::vector<LLAvatarName> avatar_names;
getSelectedAvatarData(list, avatar_ids, avatar_names); getSelectedAvatarData(list, avatar_ids, avatar_names);
if (mCloseOnSelect) // Singu Note: Close before callback if we get here first, makes potential next dialog floater position correctly
{
mCloseOnSelect = FALSE;
close();
}
mSelectionCallback(avatar_ids, avatar_names); mSelectionCallback(avatar_ids, avatar_names);
} }
} }
getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE); getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE);
if(mCloseOnSelect) if (mCloseOnSelect)
{ {
mCloseOnSelect = FALSE; mCloseOnSelect = FALSE;
close(); close();
} }
} }