From f3d63072e6c40b73f2abeb952e1a536dc5649fb2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 06:43:10 +0000 Subject: [PATCH 1/3] Hand cursor only on what can be clicked The tab styles set Cursor="Hand" on the TabItem. A page's content is the TabItem's logical child, so the hand reached the whole page: lists, cards and empty space all looked clickable. The hand now sits on the tab header's border only, for the navigation rail and the inner tabs. Disabled buttons and check boxes show the arrow. CI hovers the payload page and a navigation entry and checks the cursor Windows reports for each. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018ZnrQUTw6hd6BgdooEqhkR --- .github/scripts/screenshots.ps1 | 35 +++++++++++++++++++++++++++++++++ Themes/Dark.xaml | 11 +++++++---- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.github/scripts/screenshots.ps1 b/.github/scripts/screenshots.ps1 index 4ab5ccb..b101d1f 100644 --- a/.github/scripts/screenshots.ps1 +++ b/.github/scripts/screenshots.ps1 @@ -28,6 +28,16 @@ public static class Win32 { [DllImport("user32.dll")] public static extern bool RedrawWindow(IntPtr h, IntPtr rect, IntPtr region, uint flags); [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr h, IntPtr after, int x, int y, int cx, int cy, uint flags); [DllImport("dwmapi.dll")] public static extern int DwmGetWindowAttribute(IntPtr h, int attr, out RECT r, int size); + [StructLayout(LayoutKind.Sequential)] public struct POINT { public int X, Y; } + [StructLayout(LayoutKind.Sequential)] public struct CURSORINFO { public int cbSize; public int flags; public IntPtr hCursor; public POINT pt; } + [DllImport("user32.dll")] public static extern bool SetCursorPos(int x, int y); + [DllImport("user32.dll")] public static extern bool GetCursorInfo(ref CURSORINFO ci); + [DllImport("user32.dll")] public static extern IntPtr LoadCursor(IntPtr instance, IntPtr name); + public static IntPtr CurrentCursor() { + CURSORINFO ci = new CURSORINFO(); + ci.cbSize = Marshal.SizeOf(ci); + return GetCursorInfo(ref ci) ? ci.hCursor : IntPtr.Zero; + } } "@ [Win32]::SetProcessDPIAware() | Out-Null @@ -237,6 +247,31 @@ foreach ($sub in (Visible-Tabs $payloadTab)) { Save-Window ('{0:D2}-payload-{1}' -f $i, ($sub.Current.Name -replace '[^A-Za-z0-9]+', '-').Trim('-').ToLower()); $i++ } +# ---------------------------------------------------------------- the mouse cursor +# The hand belongs on what can be clicked: a navigation entry shows it, the page it opens +# does not. (A cursor set on a tab used to reach the whole page under it.) +function Cursor-Over($element) { + $r = $element.Current.BoundingRectangle + $x = [int]($r.X + $r.Width / 2); $y = [int]($r.Y + $r.Height / 2) + [Win32]::SetForegroundWindow($script:hwnd) | Out-Null + [Win32]::SetCursorPos($x, $y) | Out-Null + Start-Sleep -Milliseconds 400 + [Win32]::SetCursorPos($x + 2, $y + 1) | Out-Null # a move makes WPF ask for the cursor again + Start-Sleep -Milliseconds 400 + return [Win32]::CurrentCursor() +} +$arrow = [Win32]::LoadCursor([IntPtr]::Zero, [IntPtr]32512) # IDC_ARROW +$hand = [Win32]::LoadCursor([IntPtr]::Zero, [IntPtr]32649) # IDC_HAND +$onPage = Cursor-Over (Wait-For { Shown $root 'payload_info' } 10 "the payload properties") +$onNav = Cursor-Over (Wait-For { By-Id $mainTabs 'device_tab' } 10 "the Device entry") +Write-Host "cursor over the page: $onPage (arrow $arrow), over a navigation entry: $onNav (hand $hand)" +if ($onPage -eq [IntPtr]::Zero -or $onNav -eq [IntPtr]::Zero) { + Write-Host "the runner reports no cursor; skipping the cursor check" +} else { + if ($onPage -ne $arrow) { Fail "the payload page shows a cursor other than the arrow" } + if ($onNav -ne $hand) { Fail "a navigation entry does not show the hand cursor" } +} + # ---------------------------------------------------------------- device list and device $deviceTab = Go 'device_tab' $devices = Wait-For { By-Id $root 'fastboot_devices_list' } 10 "the device list" diff --git a/Themes/Dark.xaml b/Themes/Dark.xaml index ac59c77..5beb187 100644 --- a/Themes/Dark.xaml +++ b/Themes/Dark.xaml @@ -171,6 +171,7 @@ + @@ -279,6 +280,7 @@ + @@ -316,6 +318,7 @@ + @@ -480,15 +483,16 @@ +