| 76 | return opened != 0; |
| 77 | } |
| 78 | bool FileNode(const char* label, ImTextureID icon) { |
| 79 | ImGuiContext& g = *GImGui; |
| 80 | ImGuiWindow* window = g.CurrentWindow; |
| 81 | |
| 82 | //ImU32 id = window->GetID(label); |
| 83 | ImVec2 pos = window->DC.CursorPos; |
| 84 | bool ret = ImGui::InvisibleButton(label, ImVec2(-FLT_MIN, g.FontSize + g.Style.FramePadding.y * 2)); |
| 85 | |
| 86 | bool hovered = ImGui::IsItemHovered(); |
| 87 | bool active = ImGui::IsItemActive(); |
| 88 | if (hovered || active) |
| 89 | window->DrawList->AddRectFilled(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, ImGui::ColorConvertFloat4ToU32(ImGui::GetStyle().Colors[active ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered])); |
| 90 | |
| 91 | // Icon, text |
| 92 | window->DrawList->AddImage(icon, ImVec2(pos.x, pos.y), ImVec2(pos.x + ICON_SIZE, pos.y + ICON_SIZE)); |
| 93 | ImGui::RenderText(ImVec2(pos.x + g.Style.FramePadding.y + ICON_SIZE, pos.y + g.Style.FramePadding.y), label); |
| 94 | |
| 95 | return ret; |
| 96 | } |
| 97 | bool PathBox(const char* label, std::filesystem::path& path, char* pathBuffer, ImVec2 size_arg) { |
| 98 | ImGuiWindow* window = ImGui::GetCurrentWindow(); |
| 99 | if (window->SkipItems) |
nothing calls this directly
no outgoing calls
no test coverage detected