27 const float top_pad = options.
compact ? 8.0f : 24.0f;
28 const float mid_pad = options.
compact ? 6.0f : 12.0f;
29 ImGui::Dummy(ImVec2(0.0f, top_pad));
31 if (options.
icon && options.
icon[0] !=
'\0') {
32 const ImVec2 icon_size = ImGui::CalcTextSize(options.
icon);
33 CenterNextItem(icon_size.x);
37 if (options.
title && options.
title[0] !=
'\0') {
39 const ImVec2 title_size = ImGui::CalcTextSize(options.
title);
40 CenterNextItem(title_size.x);
46 ImGui::Dummy(ImVec2(0.0f, mid_pad * 0.5f));
47 const float wrap_width =
48 ImGui::GetContentRegionAvail().x * (options.
compact ? 0.95f : 0.85f);
49 const float indent = (ImGui::GetContentRegionAvail().x - wrap_width) * 0.5f;
51 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + indent);
53 ImGui::PushTextWrapPos(ImGui::GetCursorPosX() + wrap_width);
54 ImGui::TextDisabled(
"%s", options.
detail);
55 ImGui::PopTextWrapPos();
60 ImGui::Dummy(ImVec2(0.0f, mid_pad));
61 const ImVec2 label_size = ImGui::CalcTextSize(options.
action_label);
62 const float button_width =
63 label_size.x + ImGui::GetStyle().FramePadding.x * 4.0f;
64 CenterNextItem(button_width);
73 ImGui::Dummy(ImVec2(0.0f, top_pad * 0.5f));
bool PrimaryButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a primary action button (accented color).