17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 19:09:25 +02:00
Files
maszyna/widgets/popup.cpp
2026-09-09 20:35:26 +02:00

30 lines
432 B
C++

module;
#include "imgui/imgui.h"
#include <string>
module eu07.application.uilayer;
ui::popup::popup(ui_panel &panel) : m_parent(panel) {}
ui::popup::~popup() {}
bool ui::popup::render()
{
if (!m_id.size())
{
m_id = "popup:" + std::to_string(id++);
ImGui::OpenPopup(m_id.c_str());
}
if (!ImGui::BeginPopup(m_id.c_str()))
return true;
render_content();
ImGui::EndPopup();
return false;
}
int ui::popup::id = 0;