fix(material): wrap DialogWarningHeader so long warnings don't clip
Export All Keys' long DANGER warning was clipped at the card edge because the header rendered a single unwrapped line. Add PushTextWrapPos so a long warning flows to a second line; short one-line warnings (import/backup/settings) fit and are unaffected. Surfaced by the Windows sweep on modal-export-all-keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1676,7 +1676,11 @@ inline void DialogWarningHeader(const char* warningLabel, const ImVec4& col = Wa
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
// Vertically center the label with the taller warning glyph (stays within the icon's row height).
|
// Vertically center the label with the taller warning glyph (stays within the icon's row height).
|
||||||
if (iconH > textH) ImGui::SetCursorPosY(rowTop + (iconH - textH) * 0.5f);
|
if (iconH > textH) ImGui::SetCursorPosY(rowTop + (iconH - textH) * 0.5f);
|
||||||
|
// Wrap so a long warning flows to a second line instead of clipping at the card edge; short
|
||||||
|
// warnings (which fit) are unaffected.
|
||||||
|
ImGui::PushTextWrapPos(0.0f);
|
||||||
ImGui::TextColored(col, "%s", warningLabel);
|
ImGui::TextColored(col, "%s", warningLabel);
|
||||||
|
ImGui::PopTextWrapPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 50/50 Cancel / confirm footer for overlay dialogs. Sets `outCancel` /
|
// 50/50 Cancel / confirm footer for overlay dialogs. Sets `outCancel` /
|
||||||
|
|||||||
Reference in New Issue
Block a user