| 10846 | } |
| 10847 | |
| 10848 | ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker) |
| 10849 | { |
| 10850 | ImGuiContext& g = *GImGui; |
| 10851 | ImVec2 label_size = CalcTextSize(label, NULL, true); |
| 10852 | ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f); |
| 10853 | if (has_close_button_or_unsaved_marker) |
| 10854 | size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle. |
| 10855 | else |
| 10856 | size.x += g.Style.FramePadding.x + 1.0f; |
| 10857 | return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y); |
| 10858 | } |
| 10859 | |
| 10860 | ImVec2 ImGui::TabItemCalcSize(ImGuiWindow*) |
| 10861 | { |