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