fix(branding): enlarge fox banner and add a contrast card

This commit is contained in:
2026-05-21 19:01:42 +02:00
parent 4f6c916bd9
commit aaeca76bfd
2 changed files with 58 additions and 14 deletions
+32 -11
View File
@@ -172,20 +172,41 @@ public sealed class FirstRunWizard : Window
ImGui.TextUnformatted(HellionStrings.Wizard_Step1_Title); ImGui.TextUnformatted(HellionStrings.Wizard_Step1_Title);
ImGui.Spacing(); ImGui.Spacing();
// Fox-banner image: the embedded Hellion Forge fox artwork, replacing // Fox-banner image: the embedded Hellion Forge fox artwork. The card
// the ASCII FoxBanner. Async load renders nothing until the texture is // behind the image gives the dark fox enough contrast against the
// ready (a few frames). No theme tinting, the fox keeps its identity. // plugin's dark UI so the logo reads clearly at a glance.
var banner = FoxBannerTexture.Shared.GetWrapOrDefault(); var banner = FoxBannerTexture.Shared.GetWrapOrDefault();
if (banner is not null) if (banner is not null)
{ {
var height = 120f * ImGuiHelpers.GlobalScale; const uint CardColor = 0xFFE8E8E8; // off-white fill so the dark fox pops
var width = height * banner.Size.X / banner.Size.Y; var imgHeight = 170f * ImGuiHelpers.GlobalScale;
// Anchor the centering offset to the current cursor X. Avoids a var imgWidth = imgHeight * banner.Size.X / banner.Size.Y;
// negative position if the banner is ever wider than the region. var pad = 14f * ImGuiHelpers.GlobalScale;
var offsetX = (ImGui.GetContentRegionAvail().X - width) * 0.5f; var cardWidth = imgWidth + pad * 2f;
if (offsetX > 0f) var cardHeight = imgHeight + pad * 2f;
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + offsetX); var rounding = 8f * ImGuiHelpers.GlobalScale;
ImGui.Image(banner.Handle, new Vector2(width, height));
// Centre the card in the content region. Clamp to zero so the card
// never shifts left of the window edge on very narrow windows.
var offsetX = Math.Max(0f, (ImGui.GetContentRegionAvail().X - cardWidth) * 0.5f);
var cardOrigin = ImGui.GetCursorScreenPos() + new Vector2(offsetX, 0f);
// Draw the rounded card behind the image, then place the image on top.
ImGui
.GetWindowDrawList()
.AddRectFilled(
cardOrigin,
cardOrigin + new Vector2(cardWidth, cardHeight),
CardColor,
rounding
);
ImGui.SetCursorScreenPos(cardOrigin + new Vector2(pad, pad));
ImGui.Image(banner.Handle, new Vector2(imgWidth, imgHeight));
// Advance the layout cursor past the full card so the content below
// starts at the right position and does not overlap the card.
ImGui.SetCursorScreenPos(cardOrigin);
ImGui.Dummy(new Vector2(cardWidth, cardHeight));
} }
ImGui.Spacing(); ImGui.Spacing();
+26 -3
View File
@@ -75,9 +75,32 @@ internal sealed class Information : ISettingsTab
if (banner is null) if (banner is null)
return; return;
var height = 120f * ImGuiHelpers.GlobalScale; const uint CardColor = 0xFFE8E8E8; // off-white fill so the dark fox pops
var width = height * banner.Size.X / banner.Size.Y; var imgHeight = 170f * ImGuiHelpers.GlobalScale;
ImGui.Image(banner.Handle, new Vector2(width, height)); var imgWidth = imgHeight * banner.Size.X / banner.Size.Y;
var pad = 14f * ImGuiHelpers.GlobalScale;
var cardWidth = imgWidth + pad * 2f;
var cardHeight = imgHeight + pad * 2f;
var rounding = 8f * ImGuiHelpers.GlobalScale;
// Left-aligned: card origin stays at the current layout cursor position.
var cardOrigin = ImGui.GetCursorScreenPos();
// Draw the rounded card behind the image, then place the image on top.
ImGui
.GetWindowDrawList()
.AddRectFilled(
cardOrigin,
cardOrigin + new Vector2(cardWidth, cardHeight),
CardColor,
rounding
);
ImGui.SetCursorScreenPos(cardOrigin + new Vector2(pad, pad));
ImGui.Image(banner.Handle, new Vector2(imgWidth, imgHeight));
// Advance the layout cursor past the full card so content below does not overlap.
ImGui.SetCursorScreenPos(cardOrigin);
ImGui.Dummy(new Vector2(cardWidth, cardHeight));
} }
private void DrawVersionInfoSection() private void DrawVersionInfoSection()