Auto expand the connection if there's only one.

This commit is contained in:
xxAtrain223 2025-07-24 19:40:22 -05:00
commit 9236fd3683

View file

@ -653,8 +653,9 @@ static void DrawNode(LogicTrackerNode& node) {
auto& connectionHeader = connection.ParentName;
std::string accessAvailable =
GetAccessString(connection) + " " + ICON_FA_ARROW_RIGHT + " " + GetAvailableString(connection);
if (expandingNode && node.Connections.size() == 1) {
ImGui::SetNextItemOpen(expandNodeId == node.NodeId, ImGuiCond_Always);
}
bool connectionOpen =
ImGui::CollapsingHeader(("From " + connection.ParentName).c_str(),
@ -663,6 +664,9 @@ static void DrawNode(LogicTrackerNode& node) {
ImGui::SetTooltip("Show Connection Logic");
}
std::string accessAvailable =
GetAccessString(connection) + " " + ICON_FA_ARROW_RIGHT + " " + GetAvailableString(connection);
ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(accessAvailable.c_str()).x);
ImGui::TextUnformatted(accessAvailable.c_str());
if (ImGui::IsItemHovered()) {