feat(settings): Bootstrap modal — DialogWarningHeader + centered confirm buttons
Phase 1 (last low-risk modal). Replace the hand-rolled amber warning child-card with the standard material::DialogWarningHeader (⚠ + Warning color, wrapping), and center the Download / Mirror / Cancel button row. Already struct-form, TactileButton, and i18n'd. Completes Phase 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,21 +91,8 @@ private:
|
|||||||
ImGui::TextWrapped("%s", TR("bootstrap_desc"));
|
ImGui::TextWrapped("%s", TR("bootstrap_desc"));
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
// Warning card
|
// Care header (reference style: ⚠ + Warning color, wraps if long).
|
||||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.9f, 0.6f, 0.0f, 0.08f));
|
DialogWarningHeader(TR("bootstrap_warning"));
|
||||||
ImGui::BeginChild("##bsWarn", ImVec2(0, 0),
|
|
||||||
ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysUseWindowPadding,
|
|
||||||
ImGuiWindowFlags_NoScrollbar);
|
|
||||||
{
|
|
||||||
ImFont* iconFont = Type().iconSmall();
|
|
||||||
ImGui::PushFont(iconFont);
|
|
||||||
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(Warning()), "%s", ICON_MD_WARNING);
|
|
||||||
ImGui::PopFont();
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::TextWrapped("%s", TR("bootstrap_warning"));
|
|
||||||
}
|
|
||||||
ImGui::EndChild();
|
|
||||||
ImGui::PopStyleColor();
|
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
@@ -124,9 +111,12 @@ private:
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
// Buttons: Download | Mirror | Cancel
|
// Buttons: Download | Mirror | Cancel — centered as a group.
|
||||||
float btnW = 140.0f * dp;
|
float btnW = 140.0f * dp;
|
||||||
float btnSm = 90.0f * dp;
|
float btnSm = 90.0f * dp;
|
||||||
|
const float rowTotal = btnW * 2.0f + btnSm + ImGui::GetStyle().ItemSpacing.x * 2.0f;
|
||||||
|
const float rowOff = (ImGui::GetContentRegionAvail().x - rowTotal) * 0.5f;
|
||||||
|
if (rowOff > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + rowOff);
|
||||||
|
|
||||||
if (TactileButton(TR("download"), ImVec2(btnW, 0))) {
|
if (TactileButton(TR("download"), ImVec2(btnW, 0))) {
|
||||||
startDownload("");
|
startDownload("");
|
||||||
|
|||||||
Reference in New Issue
Block a user