Skip to content

Snap widget to taskbar regions and resize bars to fit#17

Open
Helveg wants to merge 2 commits intoCodeZeno:mainfrom
Helveg:layout
Open

Snap widget to taskbar regions and resize bars to fit#17
Helveg wants to merge 2 commits intoCodeZeno:mainfrom
Helveg:layout

Conversation

@Helveg
Copy link
Copy Markdown

@Helveg Helveg commented Apr 27, 2026

I added a bit of layout logic so that the widget can be easily placed into open places on the taskbar, and also resizes and relayouts on changes.

Summary

  • Dragging the widget now shows translucent highlights over open taskbar regions; the one under the cursor lights up, and dropping snaps the widget into it.
    Releasing outside any valid region reverts to the pre-drag position.
  • The widget resizes to fill the dropped region by stretching its progress-bar segments (clamped between 5 and 12 design-pixels). Regions on the left half of the
    taskbar left-align the widget; regions on the right half right-align.
  • Open regions are computed from HWND enumeration plus a UIA scan of XAML hosts (DesktopWindowContentBridge) so Win11 pinned/running apps are accounted for. The
    UIA cache refreshes off the UI thread on a 500 ms tick and after every drag, and the widget auto-resizes if its current region shrinks below the minimum fit (jumping
    to the nearest valid region).
  • New --debug-render flag overlays red-bordered boxes with class+size labels around every detected occupant, for diagnosing detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant