From 4e03b381dc2a9cab6e90297adfdc5b39d28aa7e9 Mon Sep 17 00:00:00 2001 From: choco Date: Tue, 23 Dec 2025 00:48:47 +0100 Subject: [PATCH] animated header main menu redesign test --- LightlessAPI | 2 +- LightlessSync/UI/CompactUI.cs | 9 +++++++++ LightlessSync/UI/Style/MainStyle.cs | 7 ++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/LightlessAPI b/LightlessAPI index 8e4432a..5656600 160000 --- a/LightlessAPI +++ b/LightlessAPI @@ -1 +1 @@ -Subproject commit 8e4432af45c1955436afe309c93e019577ad10e5 +Subproject commit 56566003e0e93bba05dcef49fd3ce23c6a204d81 diff --git a/LightlessSync/UI/CompactUI.cs b/LightlessSync/UI/CompactUI.cs index b1195b4..2c9e112 100644 --- a/LightlessSync/UI/CompactUI.cs +++ b/LightlessSync/UI/CompactUI.cs @@ -68,6 +68,7 @@ public class CompactUi : WindowMediatorSubscriberBase private bool _wasOpen; private float _windowContentWidth; private readonly SeluneBrush _seluneBrush = new(); + private readonly AnimatedHeader _animatedHeader = new() { Height = 120f, EnableBottomGradient = false }; private const float _connectButtonHighlightThickness = 14f; private Pair? _focusedPair; private Pair? _pendingFocusPair; @@ -153,6 +154,7 @@ public class CompactUi : WindowMediatorSubscriberBase public override void OnClose() { ForceReleaseFocus(); + _animatedHeader.ClearParticles(); base.OnClose(); } @@ -164,6 +166,13 @@ public class CompactUi : WindowMediatorSubscriberBase using var selune = Selune.Begin(_seluneBrush, drawList, windowPos, windowSize); _windowContentWidth = UiSharedService.GetWindowContentRegionWidth(); + + // Draw animated header background (just the gradient/particles, content drawn by existing methods) + var startCursorY = ImGui.GetCursorPosY(); + _animatedHeader.Draw(_windowContentWidth, (_, _) => { }); + // Reset cursor to draw content on top of the header background + ImGui.SetCursorPosY(startCursorY); + if (!_apiController.IsCurrentVersion) { var ver = _apiController.CurrentClientVersion; diff --git a/LightlessSync/UI/Style/MainStyle.cs b/LightlessSync/UI/Style/MainStyle.cs index 3da7455..53dd682 100644 --- a/LightlessSync/UI/Style/MainStyle.cs +++ b/LightlessSync/UI/Style/MainStyle.cs @@ -40,9 +40,10 @@ internal static class MainStyle new("color.frameBg", "Frame Background", () => Rgba(40, 40, 40, 255), ImGuiCol.FrameBg), new("color.frameBgHovered", "Frame Background (Hover)", () => Rgba(50, 50, 50, 100), ImGuiCol.FrameBgHovered), new("color.frameBgActive", "Frame Background (Active)", () => Rgba(30, 30, 30, 255), ImGuiCol.FrameBgActive), - new("color.titleBg", "Title Background", () => Rgba(24, 24, 24, 232), ImGuiCol.TitleBg), - new("color.titleBgActive", "Title Background (Active)", () => Rgba(30, 30, 30, 255), ImGuiCol.TitleBgActive), - new("color.titleBgCollapsed", "Title Background (Collapsed)", () => Rgba(27, 27, 27, 255), ImGuiCol.TitleBgCollapsed), + new("color.titleBg", "Title Background", () => Rgba(22, 14, 41, 255), ImGuiCol.TitleBg), + new("color.titleBgActive", "Title Background (Active)", () => Rgba(22, 14, 41, 255), ImGuiCol.TitleBgActive), + new("color.titleBgCollapsed", "Title Background (Collapsed)", () => Rgba(22, 14, 41, 255), ImGuiCol.TitleBgCollapsed), + new("color.menuBarBg", "Menu Bar Background", () => Rgba(36, 36, 36, 255), ImGuiCol.MenuBarBg), new("color.scrollbarBg", "Scrollbar Background", () => Rgba(0, 0, 0, 0), ImGuiCol.ScrollbarBg), new("color.scrollbarGrab", "Scrollbar Grab", () => Rgba(62, 62, 62, 255), ImGuiCol.ScrollbarGrab),