[client] overlay: guard ImGui table and tab bar scopes

This commit is contained in:
Geoffrey McRae
2026-07-30 09:17:09 +10:00
parent 510f6e8e14
commit 8fb355e6b7
2 changed files with 80 additions and 70 deletions

View File

@@ -84,21 +84,24 @@ static void config_renderLGTab(void)
{ {
igTextWrapped("%s", LG_DONATION_STR); igTextWrapped("%s", LG_DONATION_STR);
igBeginTable("donations_split", 2, 0, (ImVec2){}, 0.0f); if (igBeginTable("donations_split", 2, 0, (ImVec2){}, 0.0f))
{
igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, fontSize, 0); igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, fontSize, 0);
igTableNextColumn(); igTableNextColumn();
igBulletText(""); igBulletText("");
igTableNextColumn(); igTableNextColumn();
overlayTextURL(LG_DONATION_URL, NULL); overlayTextURL(LG_DONATION_URL, NULL);
igEndTable(); igEndTable();
} }
}
if (igCollapsingHeader_BoolPtr("Help & Support", NULL, if (igCollapsingHeader_BoolPtr("Help & Support", NULL,
ImGuiTreeNodeFlags_DefaultOpen)) ImGuiTreeNodeFlags_DefaultOpen))
{ {
igBeginTable("help_support_split", 2, 0, (ImVec2){}, 0.0f); if (igBeginTable("help_support_split", 2, 0, (ImVec2){}, 0.0f))
igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, fontSize * 9.0f, 0); {
igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed,
fontSize * 9.0f, 0);
for(const StringPair * help = LG_HELP_LINKS; help->name; ++help) for(const StringPair * help = LG_HELP_LINKS; help->name; ++help)
{ {
igTableNextColumn(); igTableNextColumn();
@@ -108,6 +111,7 @@ static void config_renderLGTab(void)
} }
igEndTable(); igEndTable();
} }
}
if (igCollapsingHeader_BoolPtr("The Looking Glass Team", NULL, if (igCollapsingHeader_BoolPtr("The Looking Glass Team", NULL,
ImGuiTreeNodeFlags_DefaultOpen)) ImGuiTreeNodeFlags_DefaultOpen))
@@ -126,10 +130,13 @@ static void config_renderLGTab(void)
"do so directly via the following platform%s:", "do so directly via the following platform%s:",
member->donate[1].name ? "s" : ""); member->donate[1].name ? "s" : "");
igBeginTable("member_donations_split", 2, 0, (ImVec2){}, 0.0f); if (igBeginTable("member_donations_split", 2, 0,
(ImVec2){}, 0.0f))
{
igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, igTableSetupColumn("", ImGuiTableColumnFlags_WidthFixed,
fontSize * 10.0f, 0); fontSize * 10.0f, 0);
for(const StringPair * donate = member->donate; donate->name; ++donate) for(const StringPair * donate = member->donate;
donate->name; ++donate)
{ {
igTableNextColumn(); igTableNextColumn();
igBulletText("%s", donate->name); igBulletText("%s", donate->name);
@@ -138,6 +145,7 @@ static void config_renderLGTab(void)
} }
igEndTable(); igEndTable();
} }
}
igTreePop(); igTreePop();
igSeparator(); igSeparator();
} }
@@ -181,8 +189,8 @@ static int config_render(void * udata, bool interactive, struct Rect * windowRec
return 1; return 1;
} }
igBeginTabBar("Configuration#tabs", 0); if (igBeginTabBar("Configuration#tabs", 0))
{
if (igBeginTabItem("About", NULL, 0)) if (igBeginTabItem("About", NULL, 0))
{ {
config_renderLGTab(); config_renderLGTab();
@@ -233,6 +241,7 @@ static int config_render(void * udata, bool interactive, struct Rect * windowRec
} }
igEndTabBar(); igEndTabBar();
}
overlayGetImGuiRect(windowRects); overlayGetImGuiRect(windowRects);
igEnd(); igEnd();

View File

@@ -51,8 +51,8 @@ static void configCallback(void * udata, int * id)
igCheckbox("Show timing graphs", &gs.show); igCheckbox("Show timing graphs", &gs.show);
igSeparator(); igSeparator();
igBeginTable("graphs_split", 2, 0, (ImVec2){}, 0); if (igBeginTable("graphs_split", 2, 0, (ImVec2){}, 0))
{
GraphHandle graph; GraphHandle graph;
ll_lock(gs.graphs); ll_lock(gs.graphs);
ll_forEachNL(gs.graphs, item, graph) ll_forEachNL(gs.graphs, item, graph)
@@ -65,6 +65,7 @@ static void configCallback(void * udata, int * id)
ll_unlock(gs.graphs); ll_unlock(gs.graphs);
igEndTable(); igEndTable();
}
} }
static void showTimingKeybind(int sc, void * opaque) static void showTimingKeybind(int sc, void * opaque)