added hellwal and matugen generators (WIP)

This commit is contained in:
2026-01-29 00:55:01 +03:00
parent 3e798f1fb8
commit 4697f69dac
24 changed files with 1023 additions and 58 deletions

View File

@@ -1,6 +1,7 @@
#include "input_dialog.hpp"
#include "imgui.h"
#include <cstring>
#include <string>
namespace clrsync::gui::widgets
{
@@ -41,6 +42,21 @@ bool input_dialog::render()
IM_ARRAYSIZE(m_input_buffer),
ImGuiInputTextFlags_EnterReturnsTrue);
ImGui::SameLine();
if (ImGui::Button("Browse"))
{
if (m_on_browse)
{
std::string initial = m_input_buffer;
std::string res = m_on_browse(initial);
if (!res.empty())
{
std::strncpy(m_input_buffer, res.c_str(), IM_ARRAYSIZE(m_input_buffer) - 1);
m_input_buffer[IM_ARRAYSIZE(m_input_buffer) - 1] = '\0';
}
}
}
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
@@ -108,4 +124,9 @@ void input_dialog::set_on_cancel(const std::function<void()> &callback)
m_on_cancel = callback;
}
void input_dialog::set_path_browse_callback(const std::function<std::string(const std::string &)> &callback)
{
m_on_browse = callback;
}
} // namespace clrsync::gui::widgets