From 77e1adeaf8e6d4d5b8b04d0b84b442ce141b88f2 Mon Sep 17 00:00:00 2001 From: LynxTWO Date: Sun, 23 Aug 2026 22:51:50 -0400 Subject: [PATCH] Give the bank keys and the rail keys the same housing lamp The keys got light instead of an outline; the bank positions and the navigation rail still had the outline. Two of the three surfaces you click responding one way and the third responding another is worse than either choice on its own. Bank keys get a tighter, dimmer version of the same fixture - they sit 2 DIP apart, and a button-sized bloom on each would wash across its neighbours. It deliberately does not light the SELECTED position: the teal pip says which one is engaged and the warm lamp says which one you are on, and running both off the same key would collapse two different questions into one glow. The rail keys draw themselves in code rather than from a template, so the lamp is built there and composed over whatever shadow the active state already chose. An active key keeps its teal halo and gains the warm one, the way a lit key still lights its own seam. D-080 (4) put the rail in scope for exactly this reason: it is the most-clicked surface in the app and it should not be the one thing that stops responding. Not doing here: the rail keys still do not DEFORM. That needs RailStripKey to grow a layered template, which is a bigger change than this one, and the light is the part that makes the console feel like one object. --- src/CUETools.Linux.App/Controls/RailStrip.cs | 49 ++++++++++++ .../Theme/AnalogControls.axaml | 79 ++++++++++++++----- tests/CUETools.Linux.Tests/SeamLightTests.cs | 24 ++++++ 3 files changed, 131 insertions(+), 21 deletions(-) diff --git a/src/CUETools.Linux.App/Controls/RailStrip.cs b/src/CUETools.Linux.App/Controls/RailStrip.cs index 39a36bc..05ea17e 100644 --- a/src/CUETools.Linux.App/Controls/RailStrip.cs +++ b/src/CUETools.Linux.App/Controls/RailStrip.cs @@ -68,6 +68,14 @@ public RailStripKey(Geometry glyph, string pageName) public bool IsActiveKey { get; private set; } + /// Pointer state for the housing lamp (D-088). These keys draw + /// themselves rather than living in a template, so the seam light that the + /// key styles get from XAML has to be built here instead. D-080 (4) put the + /// rail in scope precisely so the most-clicked surface in the app would not + /// be the one thing that stopped responding. + private bool _hot; + private bool _held; + public void SetActive(bool active) { IsActiveKey = active; @@ -104,5 +112,46 @@ public void Restyle() _glyph.Effect = null; BoxShadow = BoxShadows.Parse(dark ? "0 1.5 3 0 #70000000" : "0 1.5 3 0 #30536057"); } + + // the housing lamp under the key, over whatever shadow the state above + // chose. An active key keeps its teal halo and gains the warm one, the + // same way a lit key on a console still lights its own seam. + if (_hot || _held) + { + string seam = this.TryFindResource("KeySeamColor", ActualThemeVariant, out object? c) && c is Color sc + ? $"{sc.R:X2}{sc.G:X2}{sc.B:X2}" + : (dark ? "F0A24A" : "C9762A"); + string alpha = _held ? "B0" : "55"; + BoxShadow = BoxShadows.Parse($"{BoxShadow}, 0 1 13 0 #{alpha}{seam}"); + } + } + + protected override void OnPointerEntered(Avalonia.Input.PointerEventArgs e) + { + base.OnPointerEntered(e); + _hot = true; + Restyle(); + } + + protected override void OnPointerExited(Avalonia.Input.PointerEventArgs e) + { + base.OnPointerExited(e); + _hot = false; + _held = false; + Restyle(); + } + + protected override void OnPointerPressed(Avalonia.Input.PointerPressedEventArgs e) + { + base.OnPointerPressed(e); + _held = true; + Restyle(); + } + + protected override void OnPointerReleased(Avalonia.Input.PointerReleasedEventArgs e) + { + base.OnPointerReleased(e); + _held = false; + Restyle(); } } diff --git a/src/CUETools.Linux.App/Theme/AnalogControls.axaml b/src/CUETools.Linux.App/Theme/AnalogControls.axaml index aeb6d90..4b3049c 100644 --- a/src/CUETools.Linux.App/Theme/AnalogControls.axaml +++ b/src/CUETools.Linux.App/Theme/AnalogControls.axaml @@ -355,25 +355,48 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -388,8 +411,22 @@ - + + +