Snap widget to taskbar regions and resize bars to fit - #17
Conversation
|
@Helveg, thank you again for putting so much thought into this! Your handling of the awkward Windows 11 taskbar internals was especially impressive, including the UIA scan for XAML-hosted icons, open-region highlights, invalid-drop recovery, and adaptive segment sizing. With v2.0 now released, the underlying placement and sizing problem this PR set out to solve is covered through the new Theme Studio. I did not merge this exact implementation, as v2 takes a broader theme-driven approach instead of automatically detecting open regions and showing drop highlights. Users can now:
For a placement similar to the original widget:
This gives people control over exactly where the widget lives while also supporting multiple monitors and fully custom widget designs. Really appreciate the work and care you put into exploring this, @Helveg. It directly targeted one of the most awkward parts of fitting a custom widget naturally into the Windows taskbar. With the new v2 system now released and covering the broader use case, I’m going to close this PR as superseded. Thank you! 🚀 |
|
Beautiful! Thanks for the reply and the work :) |
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
Releasing outside any valid region reverts to the pre-drag position.
taskbar left-align the widget; regions on the right half right-align.
DesktopWindowContentBridge) so Win11 pinned/running apps are accounted for. TheUIA 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).
--debug-renderflag overlays red-bordered boxes with class+size labels around every detected occupant, for diagnosing detection.