From 9528128ca72c3dc567ab6a80fedf8d0b35defc5b Mon Sep 17 00:00:00 2001 From: gramps Date: Fri, 30 Oct 2026 08:39:42 -0700 Subject: [PATCH] feat(settings): brand-logo thumbnail with a hover enlargement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The creator (2026-10-30): the brand-logo field in App Settings showed only a file NAME, so a myopic user could not confirm which picture was set. Now a 28x28 thumbnail sits left of the field showing the actual image, and hovering it opens an enlarged copy (up to 420x320) beside the panel with the file name underneath. A click collapses it; moving the pointer away closes it, unless the pointer walked onto the popup itself, where it stays so the creator can look closely. Mechanics: - `MainViewModel.BrandLogoPreviewImage` decodes the stored asset ONCE and freezes it, so the thumbnail and the enlargement share one bitmap and no dispatcher hop is needed. A corrupt image returns null instead of taking the dialog down. - The thumbnail is hidden when no image is set (NotNullToVis), so there is nothing to hover and no empty frame can appear. - The popup is a separate window: WPF refuses to open one until its placement target is in a live visual tree, which is why the test hosts the control in a real window rather than asserting on a detached control. Guard: BrandLogoPreviewTests — the wiring (image binding, the no-image gate, the four gesture handlers, the readable enlargement size) and the control's open/close behaviour. --- Controls/OverlayHost.xaml | 27 ++++++++++++ Controls/OverlayHost.xaml.cs | 30 ++++++++++++++ ViewModels/MainViewModel.BrandLogo.cs | 48 +++++++++++++++++++++ ytLive.Tests/BrandLogoPreviewTests.cs | 60 +++++++++++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 ytLive.Tests/BrandLogoPreviewTests.cs diff --git a/Controls/OverlayHost.xaml b/Controls/OverlayHost.xaml index a41e0dc..ec8a2bb 100644 --- a/Controls/OverlayHost.xaml +++ b/Controls/OverlayHost.xaml @@ -57,9 +57,36 @@