Centralize retained popup menu closing

This commit is contained in:
2026-06-12 16:01:32 +02:00
parent 32cea98661
commit 22748d9967
3 changed files with 7 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
#include "pch.h"
#include "log.h"
#include "legacy_ui_overlay_services.h"
#include "node_popup_menu.h"
#include "node_button_custom.h"
#include "app.h"
@@ -27,11 +28,7 @@ kEventResult NodePopupMenu::handle_event(Event* e)
case kEventType::MouseDownL:
break;
case kEventType::MouseUpL:
if (!m_mouse_inside)
{
mouse_release();
}
else
if (m_mouse_inside)
{
for (int i = 0; i < m_children.size(); i++)
{
@@ -42,9 +39,8 @@ kEventResult NodePopupMenu::handle_event(Event* e)
break;
}
}
mouse_release();
}
destroy();
pp::panopainter::close_legacy_popup_overlay(*this);
break;
default:
return kEventResult::Available;