Small buttons fits within text without additional vertical spacing.
| 830 | |
| 831 | // Small buttons fits within text without additional vertical spacing. |
| 832 | bool ImGui::SmallButton(const char* label) |
| 833 | { |
| 834 | ImGuiContext& g = *GImGui; |
| 835 | float backup_padding_y = g.Style.FramePadding.y; |
| 836 | g.Style.FramePadding.y = 0.0f; |
| 837 | bool pressed = ButtonEx(label, ImVec2(0, 0), ImGuiButtonFlags_AlignTextBaseLine); |
| 838 | g.Style.FramePadding.y = backup_padding_y; |
| 839 | return pressed; |
| 840 | } |
| 841 | |
| 842 | // Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack. |
| 843 | // Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id) |