auto(0129): agents_dashboard — secret_store_cpp_infra + CMakeLists register #4
@@ -17,6 +17,10 @@ add_imgui_app(shaders_lab
|
||||
${CMAKE_SOURCE_DIR}/functions/gfx/dag_node_previews.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/gfx/shaderlab_db.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/gfx/code_to_generator.cpp
|
||||
# Primitivos UI usados por el modal Save-as-generator.
|
||||
${CMAKE_SOURCE_DIR}/functions/core/modal_dialog.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/core/text_input.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/core/button.cpp
|
||||
# fps_overlay, panel_menu, layouts_menu, app_menubar, layout_storage ya
|
||||
# viven en fn_framework.
|
||||
)
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#include "core/panel_menu.h"
|
||||
#include "core/layouts_menu.h"
|
||||
#include "core/layout_storage.h"
|
||||
#include "core/modal_dialog.h"
|
||||
#include "core/text_input.h"
|
||||
#include "core/button.h"
|
||||
#include "core/tokens.h"
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
@@ -236,41 +240,41 @@ static void render() {
|
||||
// --- Code window ---
|
||||
if (g_show_code) {
|
||||
if (ImGui::Begin("Code", &g_show_code)) {
|
||||
if (ImGui::Button("Save as generator...")) {
|
||||
if (fn_ui::button("Save as generator...", fn_ui::ButtonVariant::Secondary)) {
|
||||
g_save_modal_open = true;
|
||||
g_save_err.clear();
|
||||
ImGui::OpenPopup("save_as_generator");
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupModal("save_as_generator", &g_save_modal_open,
|
||||
ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
ImGui::Text("Guardar shader actual como nodo Gen del DAG.");
|
||||
if (fn_ui::modal_dialog_begin("Save as generator", &g_save_modal_open,
|
||||
ImVec2(420, 0))) {
|
||||
ImGui::TextUnformatted("Guardar shader actual como nodo Gen del DAG.");
|
||||
ImGui::Spacing();
|
||||
ImGui::InputText("name (snake_case)", g_save_name, sizeof(g_save_name));
|
||||
ImGui::InputText("label", g_save_label, sizeof(g_save_label));
|
||||
fn_ui::text_input("name (snake_case)", g_save_name, sizeof(g_save_name),
|
||||
"ej: my_shader");
|
||||
fn_ui::text_input("label", g_save_label, sizeof(g_save_label));
|
||||
ImGui::InputTextMultiline("description", g_save_desc, sizeof(g_save_desc),
|
||||
ImVec2(380, 60));
|
||||
ImGui::InputText("tags (CSV)", g_save_tags, sizeof(g_save_tags));
|
||||
fn_ui::text_input("tags (CSV)", g_save_tags, sizeof(g_save_tags));
|
||||
|
||||
if (!g_save_err.empty()) {
|
||||
ImGui::TextColored(ImVec4(1, 0.4f, 0.4f, 1), "%s", g_save_err.c_str());
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, fn_tokens::colors::error);
|
||||
ImGui::TextWrapped("%s", g_save_err.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
if (ImGui::Button("Save", ImVec2(120, 0))) {
|
||||
ImGui::Separator();
|
||||
if (fn_ui::button("Cancel", fn_ui::ButtonVariant::Subtle)) {
|
||||
g_save_modal_open = false;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (fn_ui::button("Save", fn_ui::ButtonVariant::Primary)) {
|
||||
g_save_err = save_current_as_generator();
|
||||
if (g_save_err.empty()) {
|
||||
g_save_modal_open = false;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", ImVec2(120, 0))) {
|
||||
g_save_modal_open = false;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
fn_ui::modal_dialog_end();
|
||||
|
||||
ImVec2 avail = ImGui::GetContentRegionAvail();
|
||||
float footer_h = g_code_err.empty() ? 0.0f : ImGui::GetTextLineHeightWithSpacing() + 8.0f;
|
||||
|
||||
Reference in New Issue
Block a user