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