docs(issues): marcar 0025 y 0026 como completados + WIP master
Wave 1 de parallel-fix-issues integrada a master: - 0025: text_editor_cpp_core + file_watcher_cpp_core - 0026: gl_texture_load_cpp_gfx (vendor: stb_image v2.30) Ademas se commitea WIP previo de master que estaba sin commitear (cambios en shaders_lab, dag_*, framework, tokens, kpi_card, gl_loader.md, etc.) para dejar HEAD buildable. Notas: - Algunos deps del gallery (button.cpp, toolbar.cpp, modal_dialog.cpp...) siguen UNTRACKED — gating con FN_BUILD_GALLERY=ON (default OFF) para que master build (sin flag) no los necesite. - Build OK con y sin flag. fn index registra 904 functions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
#include "implot.h"
|
||||
#include "core/tokens.h"
|
||||
#include "core/icon_font.h"
|
||||
#include "core/app_settings.h"
|
||||
#include "core/fps_overlay.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <cstdio>
|
||||
@@ -52,11 +56,34 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
|
||||
// Lee app_settings.ini (font_id, font_size_px, show_fps) antes de cargar
|
||||
// fuentes. Si no existe el .ini, los defaults se aplican.
|
||||
fn_ui::settings_load();
|
||||
|
||||
// Texto vectorial (Karla / Roboto / DroidSans / Cousine, segun settings)
|
||||
// + iconos Tabler mergeados al mismo tamaño en el mismo ImFont.
|
||||
fn_ui::load_fonts_from_settings();
|
||||
|
||||
// ImGui 1.92+ usa style.FontSizeBase como tamaño activo (escalable sin
|
||||
// rebuild de atlas). Inicializa al valor del .ini para que el primer
|
||||
// frame ya respete el setting.
|
||||
{
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
style.FontSizeBase = fn_ui::settings().font_size_px;
|
||||
style._NextFrameFontSizeBase = style.FontSizeBase;
|
||||
}
|
||||
|
||||
if (config.viewports) {
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
}
|
||||
|
||||
ImGui::StyleColorsDark();
|
||||
// Identidad visual — ver cpp/DESIGN_SYSTEM.md
|
||||
switch (config.theme) {
|
||||
case ThemeMode::FnDark: fn_tokens::apply_dark_theme(); break;
|
||||
case ThemeMode::ImGuiDark: ImGui::StyleColorsDark(); break;
|
||||
case ThemeMode::ImGuiLight: ImGui::StyleColorsLight(); break;
|
||||
case ThemeMode::None: break;
|
||||
}
|
||||
|
||||
// When viewports are enabled, tweak WindowRounding/WindowBg so
|
||||
// platform windows look consistent with the main window
|
||||
@@ -78,12 +105,35 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Tamaño de fuente: aplica via style.FontSizeBase cada frame. Cambios
|
||||
// se ven al instante (ImGui 1.92+ escala el atlas dinamicamente, no
|
||||
// hace falta rebuild).
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
if (style.FontSizeBase != fn_ui::settings().font_size_px) {
|
||||
style.FontSizeBase = fn_ui::settings().font_size_px;
|
||||
style._NextFrameFontSizeBase = style.FontSizeBase; // FIXME-ImGui hack
|
||||
}
|
||||
|
||||
// Cambio de fuente (font_id): rebuild atlas. ImGui_ImplOpenGL3
|
||||
// refresca la GPU texture via UpdateTexture en RenderDrawData.
|
||||
if (fn_ui::settings_consume_font_dirty()) {
|
||||
fn_ui::load_fonts_from_settings();
|
||||
}
|
||||
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
render_fn();
|
||||
|
||||
// Ventana de Settings (no-op si esta cerrada).
|
||||
fn_ui::settings_window_render();
|
||||
|
||||
// FPS overlay si esta activado en Settings.
|
||||
if (fn_ui::settings().show_fps) {
|
||||
fps_overlay();
|
||||
}
|
||||
|
||||
ImGui::Render();
|
||||
int display_w, display_h;
|
||||
glfwGetFramebufferSize(window, &display_w, &display_h);
|
||||
@@ -107,6 +157,9 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// Persiste settings al exit (idempotente con auto-saves del menu).
|
||||
fn_ui::settings_save();
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
|
||||
@@ -4,15 +4,24 @@
|
||||
|
||||
namespace fn {
|
||||
|
||||
// Modos de tema para run_app.
|
||||
enum class ThemeMode {
|
||||
FnDark, // Identidad del registry (Mantine v9 dark + indigo). DEFAULT.
|
||||
ImGuiDark, // Tema estandar de ImGui (ImGui::StyleColorsDark).
|
||||
ImGuiLight,
|
||||
None, // No tocar el ImGuiStyle — la app lo configura.
|
||||
};
|
||||
|
||||
struct AppConfig {
|
||||
const char* title = "fn_registry";
|
||||
int width = 1280;
|
||||
int height = 720;
|
||||
bool vsync = true;
|
||||
bool viewports = false; // Enable multi-viewport: ImGui windows become real OS windows
|
||||
float bg_r = 0.1f;
|
||||
float bg_g = 0.1f;
|
||||
float bg_b = 0.1f;
|
||||
ThemeMode theme = ThemeMode::FnDark; // Identidad visual unificada por defecto
|
||||
float bg_r = 0.102f; // fn_tokens::colors::bg (dark.7 #1A1B1E)
|
||||
float bg_g = 0.106f;
|
||||
float bg_b = 0.118f;
|
||||
};
|
||||
|
||||
// Run an ImGui application. The render_fn is called every frame
|
||||
|
||||
Reference in New Issue
Block a user