fix(branding): enlarge fox banner and add a contrast card
This commit is contained in:
@@ -172,20 +172,41 @@ public sealed class FirstRunWizard : Window
|
||||
ImGui.TextUnformatted(HellionStrings.Wizard_Step1_Title);
|
||||
ImGui.Spacing();
|
||||
|
||||
// Fox-banner image: the embedded Hellion Forge fox artwork, replacing
|
||||
// the ASCII FoxBanner. Async load renders nothing until the texture is
|
||||
// ready (a few frames). No theme tinting, the fox keeps its identity.
|
||||
// Fox-banner image: the embedded Hellion Forge fox artwork. The card
|
||||
// behind the image gives the dark fox enough contrast against the
|
||||
// plugin's dark UI so the logo reads clearly at a glance.
|
||||
var banner = FoxBannerTexture.Shared.GetWrapOrDefault();
|
||||
if (banner is not null)
|
||||
{
|
||||
var height = 120f * ImGuiHelpers.GlobalScale;
|
||||
var width = height * banner.Size.X / banner.Size.Y;
|
||||
// Anchor the centering offset to the current cursor X. Avoids a
|
||||
// negative position if the banner is ever wider than the region.
|
||||
var offsetX = (ImGui.GetContentRegionAvail().X - width) * 0.5f;
|
||||
if (offsetX > 0f)
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + offsetX);
|
||||
ImGui.Image(banner.Handle, new Vector2(width, height));
|
||||
const uint CardColor = 0xFFE8E8E8; // off-white fill so the dark fox pops
|
||||
var imgHeight = 170f * ImGuiHelpers.GlobalScale;
|
||||
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;
|
||||
|
||||
// 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();
|
||||
|
||||
@@ -75,9 +75,32 @@ internal sealed class Information : ISettingsTab
|
||||
if (banner is null)
|
||||
return;
|
||||
|
||||
var height = 120f * ImGuiHelpers.GlobalScale;
|
||||
var width = height * banner.Size.X / banner.Size.Y;
|
||||
ImGui.Image(banner.Handle, new Vector2(width, height));
|
||||
const uint CardColor = 0xFFE8E8E8; // off-white fill so the dark fox pops
|
||||
var imgHeight = 170f * ImGuiHelpers.GlobalScale;
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user