Fix listbox item double click behavior

This commit is contained in:
Robert Müller 2022-02-20 19:56:51 +01:00
parent 2fd4389311
commit 9ebb85f520

View file

@ -634,8 +634,10 @@ CMenus::CListboxItem CMenus::UiDoListboxNextItem(const void *pId, bool Selected,
HitRect.h = minimum(HitRect.h, (gs_ListBoxOriginalView.y + gs_ListBoxOriginalView.h) - HitRect.y);
bool DoubleClickable = false;
if(Item.m_Visible && UI()->DoButtonLogic(pId, "", gs_ListBoxSelectedIndex == gs_ListBoxItemIndex, &HitRect))
{
DoubleClickable |= gs_ListBoxNewSelected == ThisItemIndex;
gs_ListBoxClicked = true;
gs_ListBoxNewSelected = ThisItemIndex;
}
@ -647,7 +649,7 @@ CMenus::CListboxItem CMenus::UiDoListboxNextItem(const void *pId, bool Selected,
{
gs_ListBoxDoneEvents = 1;
if(m_EnterPressed || (UI()->ActiveItem() == pId && Input()->MouseDoubleClick()))
if(m_EnterPressed || (DoubleClickable && Input()->MouseDoubleClick()))
{
gs_ListBoxItemActivated = true;
UI()->SetActiveItem(0);