7eef2544ab
Funciones C++/ImGui para dashboards (grid, panel, docking, sidebar, tabs), visualizaciones (candlestick, gauge, histogram, pie, sparkline, heatmap, scatter, line, bar, surface3d, kpi, table), grafos (force layout, renderer, viewport, spatial hash, types) y utilidades (time series buffer, tracy zones, memory/fps overlay, plot theme). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
566 B
C++
26 lines
566 B
C++
#include "core/sidebar.h"
|
|
#include "imgui.h"
|
|
|
|
static bool s_sidebar_was_open = false;
|
|
|
|
bool sidebar_begin(const char* title, bool* open, float width) {
|
|
if (!*open) {
|
|
s_sidebar_was_open = false;
|
|
if (ImGui::Button(">")) {
|
|
*open = true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
s_sidebar_was_open = true;
|
|
ImGui::SetNextWindowSize(ImVec2(width, 0.0f), ImGuiCond_Always);
|
|
ImGui::Begin(title, open, ImGuiWindowFlags_NoCollapse);
|
|
return true;
|
|
}
|
|
|
|
void sidebar_end() {
|
|
if (s_sidebar_was_open) {
|
|
ImGui::End();
|
|
}
|
|
}
|