Close editor popups when opening file dialog

As the popups would render above the file dialog, they should be closed before opening it.
This commit is contained in:
Robert Müller 2022-12-22 22:30:59 +01:00
parent db08cc01cd
commit ac592b2a54
3 changed files with 10 additions and 0 deletions

View file

@ -4667,6 +4667,7 @@ void CEditor::InvokeFileDialog(int StorageType, int FileType, const char *pTitle
const char *pBasePath, const char *pDefaultName,
void (*pfnFunc)(const char *pFileName, int StorageType, void *pUser), void *pUser)
{
UiClosePopupMenus();
m_FileDialogStorageType = StorageType;
m_pFileDialogTitle = pTitle;
m_pFileDialogButtonText = pButtonText;

View file

@ -1096,6 +1096,7 @@ public:
void UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect, void *pContext), void *pContext = nullptr);
void UiDoPopupMenu();
void UiClosePopupMenus();
bool UiPopupExists(void *pID);
bool UiPopupOpen();

View file

@ -104,6 +104,14 @@ void CEditor::UiDoPopupMenu()
}
}
void CEditor::UiClosePopupMenus()
{
m_LockMouse = false;
UI()->SetActiveItem(nullptr);
g_UiNumPopups = 0;
m_PopupEventWasActivated = false;
}
bool CEditor::UiPopupExists(void *pid)
{
for(int i = 0; i < g_UiNumPopups; i++)