From c19e60a23ca2ca8f864c09f39949e7794f80f851 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 29 Jun 2026 21:23:06 +0100 Subject: [PATCH] Add Path-drawn KeyButton control for a real keycap look Border+CornerRadius kept producing corner-clipping/chamfering artifacts on this Uno.Sdk build regardless of technique, so the letter/year browse-grid keys are now a custom KeyButton control whose default style draws the beveled keycap with Path geometry inside a Viewbox (so the five facet shapes scale together as one rigid design instead of each independently warping to fill the tile). Bevel walls use translucent black/white overlays rather than theme-tier brushes, which read as near-identical flat tones in several palettes. --- .../Presentation/Components/KeyButton.cs | 18 ++++ Marechai.App/Styles/SharedStyles.xaml | 90 +++++++++++++++---- 2 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 Marechai.App/Presentation/Components/KeyButton.cs diff --git a/Marechai.App/Presentation/Components/KeyButton.cs b/Marechai.App/Presentation/Components/KeyButton.cs new file mode 100644 index 00000000..c8a315b0 --- /dev/null +++ b/Marechai.App/Presentation/Components/KeyButton.cs @@ -0,0 +1,18 @@ +using Microsoft.UI.Xaml.Controls; + +namespace Marechai.App.Presentation.Components; + +/// +/// A keycap-styled button used by the letter/year browse grids. Its default +/// style (see SharedStyles.xaml) draws the beveled keycap entirely with +/// straight-line Path geometry instead of Border+CornerRadius, since every +/// CornerRadius-based attempt hit a corner-clipping rendering bug on this +/// Uno.Sdk build. +/// +public sealed partial class KeyButton : Button +{ + public KeyButton() + { + DefaultStyleKey = typeof(KeyButton); + } +} diff --git a/Marechai.App/Styles/SharedStyles.xaml b/Marechai.App/Styles/SharedStyles.xaml index 844c6d8b..a15ab6ca 100644 --- a/Marechai.App/Styles/SharedStyles.xaml +++ b/Marechai.App/Styles/SharedStyles.xaml @@ -1,6 +1,7 @@ + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:components="using:Marechai.App.Presentation.Components"> @@ -179,12 +180,15 @@ -