Full history with per-item details. README keeps a concise version history.
Current version: 1.29.1 (source of truth is
ZufyUI_VERSION_STRINGinZufyUI.h; this changelog and the API doc header both derive from that macro).
2026-11-20 — PageHost animation and pointer-cancel fixes (v1.29.1)
- PageHost reverse transition: restored the EaseOut inverse to
1 - cbrt(EasedProgress()), removing the reverse jump. - PageHost hit testing: during animation, points are inverse-translated with each page's
GetChildRenderTransformbefore hit testing; hover/click/right-click no longer hit an element at its unshifted position. - PageHost page removal:
RemovePageadjusts or cancelsfromIndex_/toIndex_during animation and leaves no stale indices. - OnPointerCancel wiring:
WM_CANCELMODE/WM_CAPTURECHANGEDnow cancelpressedElement_/mouseCaptureElement_and clear capture; OLE drag-out is exempt so file drag-out keeps working. - Show events:
Opening/Openednow fire for menus and otherWantDwmChrome()==falsewindows, andPresentationStatereachesOpen. - Regression tests: added headless PageHost checks for reverse animation, transformed hit testing and page removal; updated the
TODO.mdbaseline to1.29.1. - Verification: x64 / x86 Release + ZufyUIDebugger builds and full self-tests pass.
2026-11-20 — Pointer/focus feedback, window transitions and docs (v1.29.0)
- Pointer / focus / input feedback: added
SetPointerCursors/GetPointerCursorAt/OnPointerCancel; TextBox gained focus background/border, caret colour/thickness, indicator and password-eye fixes; ComboBox supports keyboard expand and up/down selection; Slider commits the final release coordinate; ListView/TableView/TreeView, ScrollBar, Expander, SettingsList and NumberBox gained cursor/cancel handling. - Layout / font fixes: Expander, SettingsList, ChartBase/PieChart now inherit the effective font; MenuBar reserves fractional glyph width; Button
FillWidthmeasurement is fixed; ListView defersEnsureVisiblebefore first Arrange; title-bar active title colour is fixed. - Window transitions: added
PresentationState,SetTransitionDurations,GetPresentationState,GetPresentationProgress,IsTransitionActiveandDefaultWindowSetup; normal windows fade with DComp, default duration remains 0, and menu-owned opacity animation is unaffected. - Menus / PageHost: menu click callbacks use
QueueToUIThreadso a menu cannot be destroyed on the WndProc stack; PageHost supports reversing mid-transition and fixes the EaseOut reverse progress calculation. - Docs: fixed chapter 8 title mojibake, the companion README link and four API doc lines; regenerated the Chinese and English API docs.
- Verification: x64 / x86 Release + ZufyUIDebugger builds and full self-tests pass.
2026-11-19 — Nonblocking Present, high-refresh pacing, private fonts, UIA lifetime (v1.28.0)
- Nonblocking Present: opt-in
Window::SetNonBlockingPresent. When enabled,Present1(0, DXGI_PRESENT_DO_NOT_WAIT); a busy queue is retried by the existing timer/frame clock without blocking or busy-spinning. - High-refresh pacing:
SetDisplayFramePacing/GetDisplayRefreshHzandZufyUIFrameClock.h. The worker only arms a timer and posts a message; layout/drawing/Present stay on the UI thread. Off by default; menus enable it by default. - Menu sync:
MenuWindowBaseuses nonblocking Present + frame pacing by default;UseNonBlockingPresent/UseFramePacingare static opt-outs. Hide, close,WM_DESTROYand destruction callStop()on the clock. - Private fonts:
FontManager::SetAppFontCollection; install before any format/layout, the manager holds a reference. Menu paths that callCreateTextFormatdirectly still use system fonts. - UIA lifetime: root and child providers share
DetachElement + UiaDisconnectProvider;WM_DESTROYcallsUiaReturnRawElementProvider(hwnd,0,0,nullptr);UiaDisconnectProviderruns outsideUiaMutex;SetRootLayout/SetAccessibilityEnabled(false)release consistently. - Demo: window-properties page gained nonblocking Present / pacing toggles; popup page covers placement, follow, bounds, close policy and event logs.
- Verification: x64
7408/ x867425self-tests pass.
2026-11-19 — Popup window behavior (v1.27.3)
- Window placement:
Window::Placement(system default / center on owner / center on screen) plusCenterOnOwner/CenterOnScreen. - Owner follow and move bounds:
SetFollowOwnerandMoveBounds(unrestricted / owner client / monitor work area); owned child windows follow owner movement and are constrained. - Close policy:
CloseReason,RequestClose,ForceClose, andOpening/Opened/CloseRequested/CloseAccepted/CloseCancelled; supports disabled close, Escape close, close veto, and forced close. - Title bar integration: the custom title bar close button uses
RequestClose(Caption);BehaviorChangedkeeps the maximize button disabled in owner-client mode. - Popup first frame:
RenderNowSyncadvances layout and renders a frame on firstShow, reducing blank first frames. - Attribution: the popup behavior was adapted from whrct22's ZufyUI fork (MIT, commit
33c9d7e); see THIRD_PARTY_NOTICES.md. - Verification: x64/x86 Release + ZufyUIDebugger builds and self-tests pass.
2026-11-19 — Fluent gallery and structured debugging (v1.28.0)
-
Demo release: standalone x64
demo.exe, redesigned home, component search, icon navigation and live control playground; all 26 demo pages retained. Light/dark themes, shared Acrylic backdrop through the title/status bars, and 180 ms page transitions. -
Assets: original multi-resolution application icon; MiSans VF regular design frozen and subsetted for source text, embedded in the executable with system glyph fallback for open-ended input.
-
Interaction fixes: defer ListView scrolling until a viewport exists; measure fill-width rich Button content at its allocated width; reserve fractional-glyph rounding space in MenuBar. Added layout regression assertions.
-
Version resources: library and executable metadata share
ZufyUIVersion.h; export and documentation build scripts use the same source. -
Included work: header-only core/widget module extraction; opt-in unified styles and live style edit/undo; JSON CLI and 18 MCP debug tools with verified window identity and structured errors.
-
Runtime validation fixes: commit the slider release coordinate even when the last move message is coalesced; update active title text with the theme; refresh Gallery input/progress colors in dark mode. Packaging validates executable versions and the embedded font hash.
-
Real font weights: embed actual Regular and Semibold MiSans faces with normalized static metadata, eliminating simulated bold. Component entry titles/descriptions use Regular. Settings rows, expander headings and default chart fonts respect the application font.
-
Compound controls: draw password eyes with cached, uniformly scaled curves.
GetPointerCursorAtresolves text and action regions separately. Add pointer feedback for number-field actions, sliders, standalone scrollbars and scrollbars painted inside lists/tables/trees. Disabling IME no longer changes the number field's text cursor. Capture cancellation clears drag state; regressions cover regions, disabled state, cancellation and rendering resources. -
Readability review: settings rows and expander headers use action cursors. Advanced inputs and eight actions on the input/scroll page use two columns so labels remain readable. Constructing the environment test page no longer overrides the requested startup theme.
2026-11-14 — Stability, control interaction and full-pane transition patch (v1.27.2)
- Window raw-pointer / UIA crashes: added
Window::ForgetElementto clear focus, pressed, capture, hover, tooltip, pending-repaint and UIA provider caches in one place;UIElement::SetParentdetaches window-side references beforeClearChildren()releases the shared pointer, and~UIElementremains the fallback. UIA providers now callUiaDisconnectProviderbefore release, fixing the AV and CFGFAST_FAIL_GUARD_ICALL_CHECK_FAILUREcrashes after list/member rebuilds. - TreeView column width: added
SetStretchLastColumn(bool)/GetStretchLastColumn()(default on); when total content width is narrower than the viewport, the last column receives the remaining width, fixing Chinese labels truncated to...by the 40px minimum column width. - R7 selection consistency: ListView
GetSelectedIndicesnow includesselectedIndex_;SelectAll/toggle/shift/marquee emit multi-selection signals; clear APIs clear current state. TableView gainedSelectAll,GetSelected*includes the current cell, and clear/marquee emit signals. TreeViewSetSelectedNodereplaces instead of accumulating in multi-select mode. - ViewCore scaffolding: added
viewcore::ScrollAxis/ScrollViewport,RecyclePool<T>andFetchFlow<Result>; ListView now usesScrollAxisfor vertical scroll state and hasSetItemProvider(count, fetch)andSetAsyncItemProvider(count, fetcher)for virtual text; the demo exercises 200k pseudo-random rows asynchronously. - SplitView: expand buttons now follow the splitter direction; when both minimum sizes cannot fit, the button stays visible but is greyed out and non-interactive. Added
SwitchToFirst/Second/Panefull-pane slide transitions (PageHost-style easing); they play even when both panes cannot fit and commit the collapse state withActivePaneChangedwhen finished. - Async tasks: added
RunAsync<T>/AsyncTask/AsyncCancelToken/AsyncProgress/AsyncOwner; background execution, cooperative cancellation, coalesced UI progress, ordered completion/failure/cancel callbacks on the UI thread, and callback drop after the weak owner expires; added basic, exception, cancellation, lifetime, 1000 cancellation/completion races and 1000-task randomized stress self-tests. - Image / window events:
Image::FromHBITMAPreads 32bpp DIB pixels and preserves alpha (optional premultiplied flag);Window::SizeChanged/DpiChangedadded; multi-select and HBITMAP-alpha self-tests added. - SplitView collapse/drag: unified
ClampFirstLen, fixing minimum-width conflicts, reverse drags and expansion with insufficient space; added insufficient-space default-side/auto-collapse configuration. - TrayIcon: handles both NOTIFYICON_VERSION_4 and v3
WM_LBUTTONUP/WM_RBUTTONUP/WM_LBUTTONDBLCLKfallbacks, fixing unresponsive left/right click and hover; addedSetClickImmediate. - Drawer: on close completion, recursively invalidate content layout and repaint, fixing stale content after clicking the overlay scrim.
- Card: content measure/arrange now includes the child layout margin, fixing ignored top/bottom margins in Card → ColumnBox.
- TextBox password field: added a vector eye button on the right in password mode; hidden by default, click toggles plain/masked text; added
TogglePasswordRevealandSetPasswordRevealButtonVisible. - MessageBox: compute content size and call
SetSizebefore disabling resize, soWM_GETMINMAXINFOno longer clamps the height and clips the bottom button; measurement width now subtracts the root margin. - Verification: x64 Release + ZufyUIDebugger build; full self-test (including 1000 cancellation races / randomized stress) passes.
2026-10-31 — Menu/title-bar/resize fixes and independent render thread disabled (v1.27.1)
- Independent render thread: disabled and cleaned up the experimental
ZUFYUI_RENDER_THREADpath; stable single-thread rendering and the VBLANK frame-sync code remain. README/API no longer expose the experiment. - Context menu: non-DWM chrome popups skip DWM frame/corner processing, use no rounding and no DWM border, removing the extra border around menus.
- Top menu bar: closing a menu now clears both
openIndex_andhoverIndex_, preventing a stale half-hover/open highlight. - Title bar:
AdvanceFrameuses the title bar's actualIsVisible()state;SetTitleBarVisible(false)clears the title-bar height and invalidates layout immediately, fixing menus pushed down after hiding the title bar or returning to the native frame. - Resize: after
WM_SIZEresizes the swap chain it now submits a frame immediately, andPresent1does not wait for vblank while dragging, avoiding a layout that is already new while the picture is stale/transparent. - Verification: x64 Release + ZufyUIDebugger build; 280 self-test checks pass.
2026-10-29 — Windows 10 backdrop/frame, Snap, render driver and API cleanup (v1.27.0)
- Windows 10 Acrylic: enable
ACCENT_ENABLE_HOSTBACKDROPbefore creating the HostBackdropBrush, preserving the custom blur/saturation/tint/noise chain; stop writing Win11-only DWM attributes on Win10, avoiding the gray translucent result and lost border/shadow. - Custom frame / Snap: keep
DwmExtendFrameIntoClientArea({1,1,1,1})for custom frames on both Win10 and Win11; reapply frame state afterWM_SIZE,WM_WINDOWPOSCHANGED, and backdrop reloads, fixing lost borders/shadows after Win11 Snap. - Title bar: Windows 10 caption glyphs fall back to
Segoe MDL2 Assets; the maximize/restore button refreshes after system Snap, title-bar double-click, Win+Up, etc.; UI animation updates pause during drag/resize so low-end devices stay responsive. - Render driver: added
RenderDriver,SetRenderDriver(),GetActiveRenderDriver()andGetRenderDeviceName();Autoprefers hardware and falls back to WARP. The demo supports--warp/--gpuand a restart-based home-page switcher, with the status bar showing the actual driver/adapter. WARP changes only application content rendering; DWM/Compositor may still use the GPU. - Breaking API cleanup: removed public
WindowCorner,SetWindowCorner(),GetWindowCorner()and DSLcorner(). Win10 stays square, Win11 follows DWM; custom corners require calling Win32 DWM APIs directly and accepting the risks. - Verification: Win10/Win11 normal windows, Snap 1/2 and 1/4, maximize/restore; x64 Release build passes, 280 self-test checks pass.
2026-10-27 — Layout measurement contract, UIA lifetime fix, control polish (v1.26.0)
- Layout · explicit size contract: an explicit
GridLayoutwidth/height now also constrains cell measurement, so it no longer reports 260 while arranging rows at 274+;RowBox/ColumnBoxallocate finite main-axis space to Fill children;Card/Page/ScrollViewerhonour explicit sizes with no content;Buttonmeasures its content even with autoSize disabled;Labelexplicit width participates in wrapping;TabViewtab Labels are measured during Measure and arranged in Arrange/Update;ScrollViewerno longer re-measures content in Arrange. - UIA · CFG crash fix: the minidump confirms
c0000409+Subcode 0xA FAST_FAIL_GUARD_ICALL_CHECK_FAILURE(not Stack Cookie/TDR).UiaContextsnow uses shared contexts, all UIA context/provider caches share a recursive lock, providers no longer keep raw contexts,ReleaseAccessibility/ForgetAccessibleElementare serialized with callbacks, and notification paths keep providers alive. Verified with 100 UIA tree walks + 300ElementFromPointqueries. - Expander: content is measured once even while initially collapsed; expanded content always stays in
childrenView_, so collapse/re-expand no longer loses it; animation no longer callsSetHeight/duplicates invalidation every frame; content clipping keeps at least a 4 px bleed; fixes first-expand right-shifted text and clipped drop-downs. - ToggleSwitch: click toggles on mouse-up; press-drag left/right makes the knob follow the pointer and commits by drag progress; mouse capture; default animation duration 0.18 s.
- Slider: added
GetDisplayValue(); normal dragging is immediate, while clicking the track or snapping eases the display value; UIA RangeValue retained. - Demo: layout-stress page fixes for Grid height/input-row width/label wrapping; added the "all controls" page; HwndView overlay is hidden by default with a toggle.
- Docs: API zh/en synced (Grid/Expander/ToggleSwitch/Slider/UIA); README history and feature bullets; AGENTS records the layout/UIA/animation/crash-code lessons.
- Verification: x64 Release build passes; ZufyUI self-test 280 checks pass; UIA stress queries pass.
2026-10-25 — Drawer side panel, temporary key handlers, signal tests (v1.25.0)
- New ·
Drawer: left/right/top/bottom × Overlay / Push / Permanent. Overlay uses a rounded scrim; Push makes room; Permanent stays open with no animation/scrim and ignoresClose. Rounded panel, border, and a real outer shadow (shadow first, opaque panel background covers its inner layers, border painted last). - New ·
Window::AddKeyHandler / RemoveKeyHandler: temporary window-level key handlers, called afterOnWindowKeyDownand before the focused element;Draweruses one for Esc while open and removes it on close/detach/destruction. - New · Drawer demo: side/mode selectors, open/close, panel-top X, search/category/active-only/result count/filter list; content includes BarChart, Slider, Toggle, CheckBox and ListView.
- Improvement ·
ScrollViewerbleed: content clip bleed followsGetBleed()(default 4px) instead of a fixed 1px, so control borders/shadows inside the drawer are not clipped. - Tooling · test rename:
tests/dsl_tests.cpp→tests/zufyui_tests.cpp,tools/run_dsl_tests.ps1→tools/run_tests.ps1. - Tests: signal reentrancy/slot exceptions/
NewThreadweak keep-alive/UIThreadcancellation, Drawer layout/animation/scrim/Push/Permanent/vertical sides; ZufyUI self-test 213. - Demo default backdrop: reapply Acrylic after
Show()so the first DWM application always takes effect. - Verification: x64 Debug/Release and x86 Release builds pass; 213 self-test assertions pass.
2026-10-25 — Signal lifetime, receiver context, ConnectWeak (v1.24.0)
- Breaking ·
ZSignalis non-movable: removed its move constructor/assignment; signals are control/window members, so do not put them in movable containers. Old code that moves aZSignalnow fails to compile. - Breaking · member-function pointer connections:
elem->Connect(sig, &Class::Method)is no longer supported; useConnect(elem, sig, &Class::Method)(compile-time checked) orConnectWeak(elem, sig, &Class::Method). - Breaking ·
Connectionsemantics:disconnect()now logically cancels pendingUIThread/NewThreadtasks; it does not interrupt a slot already running. - Fix · signal liveness race:
ConnectionState::aliveis now atomic;disconnectruns its internal removal callback under the state lock; signal destructionkill()s states before releasing them, fixing thealivedata race and the check-then-call UAF. - Fix · queued tasks:
UIThread/NewThreadtasks capture the connection state and check liveness before running; they no longer execute after receiver destruction or a manual disconnect. - New · receiver context: a
ConnectionOwnerbase class;UIElement/Windowderive from it.elem->Connect(...), freeConnect(elem, ...)andsig.connect(elem, ...)follow the receiver's lifetime, not the signal owner's. - New ·
ConnectWeak: weakly-referenced receiver; the slot's first parameter isT*/T&or a member-function pointer; the receiver stays alive while the slot runs, and the slot is skipped after destruction. Useful forNewThreador uncertain lifetimes. - Improvement:
Window'sReloadAcrylic/ThemeChanged/ThemeReapplyglobal connections now go throughWindow::ConnectionGroup; manualConnectionmembers were removed.ConnectionGroup::size()counts live connections only and periodically prunes dead weak references. - Scope:
Menu/MenuItem/Timerstill usesignal.connectand do not auto-disconnect. - Tests: ZufyUI self-test 140 → 175; added receiver-destruction disconnect, free
Connect,ConnectWeak,Connectioncopy/move, signal-destroyed-first, reentrancy, slot exceptions,NewThreadweak keep-alive andUIThreadcancellation regressions. - Verification: x64 Debug/Release and x86 Debug builds pass; DSL 175 assertions pass. x86 Release was not rerun this round.
2026-10-23 — Button rich content/split, SetBackdrop fix, ListView division (v1.23.3)
- New · Button rich content: the internal
Labelis a real child now, soGetLabel()->AddChild(...)is laid out/composited/drawn;SetContent(shared_ptr<UIElement>)/ClearContent()replace the content entirely. - New · Button drop 2x2:
SetDropWriteBack(bool)xSetDropOpenOnClick(bool). A button click always firesClicked; when opening, the callback runs first, then the menu appears. The menu is single-select (the previous choice is marked); selecting firesDropSelected(index), readable viaGetDropSelectedIndex/GetDropSelectedText;SetDropItemsbuilds a text list,SetDropMenuaccepts a custom menu, andShowDropMenu()opens it whenDropOpenOnClick=false. The menu appears below the button without a MessageBox. - Fix ? drop-menu position:
GetDpiScale()returns 96/144 (not 1.0/1.5); the old multiplier sent the menu to the screen bottom-right. Dividing by 96 places it under the button, and the demo no longer shows a MessageBox on split click. - Fix ·
SetBackdrop: with no explicit tint,SetBackdrop(Acrylic/Mica)no longer applies an opaque white overlay (the old defaultbackdropFollowAlpha_=0xFFcovered the system material);Nonekeeps the opaque white default, and explicit tints (including alpha) are preserved. AddedGetBackdropColor()for diagnostics. - Fix ·
ListView:SetItemHeightis clamped to >=1px;Draw/ hit-testing guard against a non-positive row height, avoiding theSetItemHeight(0)divide-by-zero andintconversion UB. - Docs/cleanup: documented the
HwndViewcross-processSetParentrisks (input queue coupling, blocked messages, intermittent instability); removed the redundantWM_ACTIVATEcheck; added<cstring>toZDataViewer.h; removed the demo's emptyScrollChangedcallback. - Demo: the buttons page now shows a rich-content button and a split button.
2026-10-22 — Debug builds: add /bigobj (v1.23.2)
- Build: added
/bigobjto the Debug|Win32 and Debug|x64 configurations ofZufyUI.vcxproj/ZufyUIDebugger.vcxproj(Release already had it). Full Debug builds previously failed inZufyUI.cpp/ZufyUIDebugger.cppwithC1128: number of sections exceeded object file format limit. - Verification: Release / Debug × x64 / x86 demo + Debugger + ZufyUI self-test all pass.
- Docs: README / AGENTS / API now document the ASCII-only export and the encoding rule;
dist/asciiis gitignored and never committed.
2026-10-22 — PageHost page measurement + docs & tooling (v1.23.1)
- Fix (layout / hit-testing):
PageHostused to onlyArrangeits pages and neverMeasurethem, whilePage::Arrangere-measures only when the arranged size changes. When a page element becomes visible at runtime (typically anExpandercard shown bySetVisible(true)after a combo-box selection), the dirty measure never reached the page → the newly shown element kept a zerodesiredSize/arrangedRect→ it was drawn but had no border and failedHitTest, until the user resized the window (a size change) once.PageHost::MeasureOverridenow measures every page; clean pages hit theMeasurecache, so no duplicate work is added. - Docs: the README first screen now leads with positioning, differentiators, the Release link, a screenshot and a one-line experimental note; the full feature list is collapsed; added issue/PR templates; sources moved to
docs/src/with a newdocs/README.md; Chinese and English first screens aligned. - Engineering:
ZufyUIDebuggermoved into this repository and the solution;tools/build.ps1/run_tests.ps1locate Visual Studio viavswhere(no hard-coded paths) and map x86 to the Win32 output correctly; addedtools/export_ascii.py(ASCII-only, BOM-free export),tools/build_docs.py(ZufyUI docs wrapper) andtools/make_icon.py(icons:docs/icon.*plus the app iconsZufyUI.ico/small.ico). - Docs tooling: the generic
md2htmlno longer probes for ZufyUI; it accepts--var KEY=VALUEand--icon; ZufyUI version/icon injection lives intools/build_docs.py. - Repo hygiene:
TODO.mdis no longer published (removed from the index and gitignored);dist/build outputs are ignored.
2026-10-13 — Native window host, external visual attachment, overlay sync/performance, NumberBox error state, data-view fill (v1.23.0)
- New:
ZufyUIHwndView.h(HwndView) — embeds a WebView2 HWND controller / camera / third-party control / out-of-process window into the layout. The host is a top-level owned popup; the external HWND is embedded as aWS_CHILD(cross-process allowed). Moving the host moves the child natively; clipping = host client +SetWindowRgn(element rect ∩ window client ∩ ancestorGetClipRect). - New:
Window::CreateExternalVisual / SetExternalVisualBounds / RemoveExternalVisual(a WinRTContainerVisualattached to the root visual, for WebView2 CompositionController / video);Window::AddOverlaySync / RemoveOverlaySync / SyncOverlays(unified overlay sync). - Performance: overlay sync is a single window-level point (
WM_MOVE/WM_SIZE/WM_DPICHANGEDimmediate + one shared 16ms fallback), removing per-instance timers; DPI/client cached; redundantSetWindowPosskipped andSWP_NOSIZE/NOMOVEused as appropriate; the demo's color pattern is cached into a DIB. - Fix (NumberBox): a valid number clears the empty-text error state;
ResetToDefaultforce-clears the error after notifying the app; step/clear buttons fire on press (no second rect check). - Fix (data views):
ListView/TableView/TreeViewMeasureOverridehonoursSetFillWidth/SetFillHeight. - Demo: new "Native HWND" page (GDI color pattern + multiple layouts + an out-of-process
--outprocwindow hosted byHwndView).
2026-10-13 — Tier 0 fixes: layout overflow/alignment, IME, accessibility, visuals/engineering (v1.22.1)
- Fix (layout):
RowBox/ColumnBoxdidn't clamp each child'sbaseto min/max → a child withSetMinWidth/Heightpushed its extra space onto a stretching sibling and overflowed the row/column (the slider spilling outside its card). Nowbase = clamp(base, min, max). - Behaviour:
ColumnBox/RowBox/GridLayoutno longer shrink content — overflow is left to an outerScrollViewer. - Fix (alignment):
GridLayout'sSetHorizontalAlignment/SetVerticalAlignmentused.empty()(always false) → never applied; now checks "all zero", soCenter/Endwork. - Fix (text/IME):
TextBox/TextEditmerge UTF-16 surrogate pairs (emoji / beyond-BMP) and insert them as one unit; cursor/backspace/delete span the whole pair; on losing focus the control clears its own composition state andWindow::ResetImeState()cancels the program-side IME composition.SetImeEnabled(false)also clears composition. - Fix (accessibility):
GetAutomationIdOrAuto()now uses a per-window counter (no cross-window collisions);ElementProviderFromPointdescends child-before-parent to the deepest hit. - Fix: data view item/cell
bleedYreads each element'sGetBleed();indicatorY_initialised to-1(indicator snaps on frame 1); focus ring usesThemeRole::FocusRing+Theme::cornerRadius; title-bar buttons take priority over the resize border inWM_NCHITTEST(Snap Layouts can appear). - Engineering:
pch.hno longer includes the library headers; addedUIElement::MarkUserColor(); removed deadListView::FindEnabledFrom. - Docs:
docs/API.md/API.en.md,docs/pitfalls.md,AGENTS.mdsynced.
2026-10-12 — API debt cleanup (P0–P3): .with usability, collision-free factories, RAII theme hooks, one-line scrollable page (v1.22.0)
- Breaking · member functions with default arguments split into non-defaulted overloads (so
.with()is usable):TreeView::SetCheckable(bool)+SetCheckableShallow(bool);SetNodeCheckable+SetNodeCheckableRecursive;SetNodeEnabled+SetNodeEnabledRecursive;SetNodeCheckState+SetNodeCheckStateFull;ListView::AddItem(text)and rich-itemAddItemWidget(shared_ptr<Label>);RadioGroup::AddItem/AddItemSelected/AddButton/AddButtonSelected;Menu::AddCheckItem/AddCheckItemCb/AddCheckItemRadio. - New · collision-free aliases for name-clashing factories:
make_slider/make_card/make_page/make_menu/make_menu_bar/make_status_bar/make_radio_group/make_scroll_bar/make_expander. - New ·
Page::SetScrollableContent(content)— one line wraps the whole page in aScrollViewer+ margin. - New ·
ThemeManager::RegisterHook/RegisterSubtreeApplierreturn a RAIIHookHandle(auto-disconnect on destruction); the library's fixed hooks useRegisterHookPermanent. - New ·
docs/pitfalls.md;AGENTS.mdgained a "chaining / API conventions" section. - Fixes:
MessageBox(and modals) first-click fall-through (ReleaseCapturebeforeRunModal);ScrollViewerscroll chaining (no wheel swallowing at the edges);SplitViewexpand had no easing + button jumped sides. - Docs:
docs/API.md/API.en.mdsynced.
2026-10-12 — Feedback batch: SplitView collapse, rendering/layout fixes, demo home page + menu/status bar (v1.21.0)
- New · SplitView collapse: drag the splitter to within a threshold of one side's edge and a translucent accent overlay plus a direction arrow fades in on top of that pane's content (alpha fade, the content is not changed yet); the pane only collapses on release (its size eases to 0). Once collapsed, a small button appears at that edge (rounded light grey + arrow pointing in the expand direction + hover easing); clicking it eases that side to its minimum limit. Turn the whole feature off with
SetCollapseEnabled(false); newCollapsedChanged(int)signal plusCollapseFirst/CollapseSecond/Expand/IsFirstCollapsed/IsSecondCollapsedand friends. - New · one animation convention:
detail::EaseOutCubic/EaseInOutCubic(duration-driven, stops exactly on time).ToggleSwitchnow uses ease-in-out (DefaultAnimationDuration = 0.25s, and fixes "click/keyboard bypassedSetOnso the animation never started = instant snap");ProgressBarvalues are eased (DefaultValueAnimDuration = 0.22s). - Fixes · rendering:
Cardflashed a blue hover border (the theme set a hover border colour on cards, which cards never had);ProgressBar's inner fill radius no longer matched the outer frame after stretching (track/clip/border still used the construction-time height). - Fixes · layout:
Buttoncaptions were ellipsized even with room to spare (width was a constantDefaultWidth; it now grows to fit, andAutoSizeToText(false)opts out). - Fixes · charts:
PieChart'szoom_shadowedChartBase::zoom_, so Ctrl+wheel zoom did nothing (the pie now handles Ctrl itself); wheel panning "did not move" (the pan path was missingSyncScrollPositions()). Semantics are explicit: Ctrl+wheel = zoom / plain wheel = pan only. - Docs: added two pitfalls — "
ColumnBoxarranges a child without an explicit width at the available width (horizontal stretch ignores the weight), so wrap a card in aRowto make it hug its content" and "aSettingsListinside aCard's built-inGridLayoutdegenerates to zero width";ThemeRole::Shadow(appended at the end of the enum) andWindow::SetBackdrop(Backdrop)following the theme. - demo: new home page (settings-card navigation that jumps to each page); the multi-window page became 7 collapsible cards; the menu bar grew to 6 menus (with sub-menus that really change state: jump to page / backdrop / window size / frame-rate limit); the status bar became 5 live panels (page / theme / backdrop / DPI·client area / window state, refreshed by theme switches and window signals); every
MessageBoxWwas replaced by the libraryMessageBoxwith click feedback on all buttons; duplicated boilerplate removed (14sectionhelpers, 7accenthelpers, 14 Scroll wrappers → 3 shared helpers). - Self-tests:
tests/zufyui_tests.cpp62 → 85 assertions (including regressions for this batch).
2026-10-11 — DSL polish + one-shot build script + null/self-containment fixes (v1.20.0)
- DSL:
root()now accepts anyLayoutsubclass (Row/Griddid not even compile before, becauseRef→shared_ptr<Layout>needs two user-defined conversions);add()dispatches on the container's real API;GridLayoutgainsCell(row,col,child[,rowSpan,colSpan])coordinates; addedapply()/Wrap(), a batch of layout/size/weight/colour/spacing/alignment shortcuts, plusRadioGroup()/ScrollBar()/Glyph()factories and data-view & menu builders. - DSL:
WindowApp::run()now callsShow()(Window::Createdoes not show the window, so the old code ran a message loop with no window); addedhidden/minSize/position/frameRateLimit/theme/useAppTheme/dropTarget/icon/titleBarVisible/showTitleText/menuBarInTitleBarand the window signal hookon<&Window::Closed>;WindowAppis now movable. - Fixes: null guards in
ColumnBox/RowBox/GridLayout::AddChild(the DSL's variadic forwarding can passnullptr). - Fix:
ZufyUIWindowTool.hnow includesZufyUIWidgets.h— it usedLabel/Buttonwhile depending on the caller to include it first. - Tooling: new
tools/build.ps1(one shot: auto-fix BOM before building → kill processes holding files → build demo +ZufyUIDebugger→ run self-tests),tools/ensure_bom.ps1(BOM guard), andtests/zufyui_tests.cpp+tools/run_tests.ps1(47 assertions, no window needed, runnable from a shell or CI).
2026-10-11 — Theme system + fluent DSL + card/drag-drop controls + fixes (v1.18.1 → v1.19.7)
- v1.19.0: Charts
ZufyUICharts.h(BarChart/LineChart/PieChart);TextEditeditor; drag & dropZufyUIDragDrop.h+ card controlsExpander/SettingsList;ComboBoxrotating arrow. - v1.19.1:
TextEditstandard undo/redo (restores selection/cursor); drag fixes (drop caret, keeps source selection);ScrollViewermeasured at viewport width + 1px bleed;Label::SetImageFit(standaloneImageViewremoved). - v1.19.2:
MenuBartop menu +StatusBarbottom bar (overlaid on the custom title bar by default). - v1.19.3: theme system (
Theme/ThemeRole/ThemeManager; light/dark/high-contrast; follows system light/dark + accent; explicit instance colors win);UIZSignals::ThemeChanged/ThemeReapply. - v1.19.4: fluent construction DSL (
ZufyUIDsl.h); fixed clippedCheckBoxlabel;ListView/TableViewcache collapsed into a singleChildrenSig();ChartBasefill fallback. - v1.19.5: DSL enhancements —
dsl::App()window builder + SFINAE per-control sugar + chart composition. - v1.19.6: fixed
ListViewbutton-mode checkbox hit off by 4px andLabelwrap ignoring inline children width; version is now a single source (generator injects1.29.1) + doc cleanup. - v1.19.7: audit fixes (chart scrollbar allowance, NumberBox wheel, anim-set dangling,
Menu::ShowAtexception, layout spacing, data-view child label release, IME association, etc.); addedTODO.mdmerging the former plan files.
2026-10-06 — Docs & images update (v1.18.1)
-
Re-shot and updated the README "Quick start" images (quickstart / backdrop / custom title bar / overview).
-
README step 3 example now also sets the Mica backdrop (
SetBackdrop(Backdrop::Mica, ...)), so the custom title bar stands out. -
Added
docs/diagrams/: screenshot programscreenshots.cpp+ image manifest (with text-form diagrams — keep images to a minimum). -
Library version macro bumped to
1.18.1. -
Version 1.18.0 → 1.18.1.
2026-10-05 — Charts (BarChart/LineChart/PieChart) + multi-line editor TextEdit + fixes & docs rework (v1.18.0)
New: Charts (new header ZufyUICharts.h)
ChartBase: data/multi-series, "nice" ticks, category axis, grid, legend, palette, internal scrollbars, sticky axes, Ctrl-zoom, drag-pan, entrance animation, horizontal/vertical reference lines;UpdateSeriesValuesrefreshes live without replaying the entrance animation.BarChart: Grouped / Stacked / PercentStacked / Overlapped, horizontal orientation, per-bar colors, selection highlight, outline, corner radius;SetFitPlotSizemakes the value axis fill the control.LineChart: straight / smooth / dashed lines, markers, area fill (baseline clamped into the visible range), hover/click.PieChart: pie/donut, labels + leader lines, legend, hover pop-out, full-circle sweep-in, wheel zoom (SetZoom).- See the "Charts" chapter of the API doc.
New: multi-line editor TextEdit (ZufyUIWidgets.h)
QPlainTextEdit-style: line numbers, wrap (WrapMode), Tab indent, cross-line selection, clipboard, undo/redo, find, read-only rich text (TextRun); auto-hiding internal scrollbars; IME candidate rect;UseCache()=false.- New base virtual
UIElement::AcceptsTab()(multi-line editors consume Tab for indent instead of changing focus).
Fixes
- Memory churn on rapid page switching:
PageHostnow releases a hidden page's cache after a grace period (~1.2 s, recursively over the whole subtree; reuses it if switched back in time) instead of allocating/deleting bitmaps every switch. NewUIElement::ReleaseDeviceResourcesRecursive(). - View not repainting while the scrollbar expands/shrinks:
ScrollBarnow also repaints its host when its animation progresses. - Line chart freezing during the 2 s idle-shrink wait: the idle-shrink countdown is no longer reported as an active animation (which had put the whole window into animation mode and stopped data repaints from landing); idle shrink is now lazy (triggered by the next frame).
ScrollVieweroffscreen cache: switched toUseCache()=false(content changes/scrolls; the cache costs a large bitmap for no benefit);SetUseCache(false)now immediately frees an existing bitmap.Snap's DPI scale is now also set on the UI thread (Window::Create/WM_DPICHANGED), fixing hit-test vs. render snap mismatch at non-100% DPI.ZSignal::Fireexception safety (RAII guard);TextBoxshift+click extends from the anchor;TextEdit::SetCursorImplduplicate statement removed;Sliderzero-width NaN guard;ListViewpooled-label re-measure on width change (fixes stale ellipsis).
Docs
-
API docs reorganized by usage category (zh + en): new chapters "Charts", "Accessibility & Debug Channel", "Version Digest", "Pitfall Index", "Appendix"; every API now carries
易错(pitfall) and版本(version) notes. -
Version 1.17.0 → 1.18.0.
2026-10-04 — UIA accessibility + external debug channel + layout stretch weights + fixes (v1.17.0)
Accessibility (UI Automation, ZufyUIWindowTool.h, on by default)
Window::SetAccessibilityEnabled(default true): the window exposes a UIA provider (IRawElementProviderSimple/Fragment/FragmentRoot) viaWM_GETOBJECT.UIElementAPI:SetAccessibleName/Description/AutomationId/Role,GetAccessibleName/Role,GetAccessibleChildren,IsAccessibilityIgnored,GetAutomationIdOrAuto()(autoe{n}when unset).- Controls expose patterns by role (Invoke / Toggle / Value / RangeValue / ExpandCollapse);
AccessibilityNotify*for manual updates;SetText/SetChecked/SetOnauto-raise property changes.AccessibleRoleenum. Window::GetFocusedElement/GetHoveredElement/GetPressedElement/FocusElement/HitTestElementDIP/ForgetAccessibleElement.
External debug/automation channel (ZufyUIWindowTool.h, off by default)
ZufyUI::SetDebugEnabled(bool)/IsDebugEnabled(): the target window then answersWM_COPYDATA(dwData = 0x5A554631), replying towParam. The library does no file I/O — current-frame info only.- Commands:
1 Ping / 2 ListWindows / 3 GetFrameStats / 4 GetElementTree / 5 ForceRepaint / 6 SetElementText / 7 InvokeElement / 8 FocusElement / 9 GetElementInfo / 10 GetElementAt / 11 Highlight / 12 ClearHighlight / 13 GetErrors / 14 ClearErrors / 15~18 Top-N (repaint/layout/cache/draw) / 19 ResetCounters / 20 SetVisible / 21 SetMargin / 22 SetHighlightColor; highlight color customizable (green by default).
Layout stretch weights
ColumnBox/RowBoxnow distribute leftover space by child stretch weight (SetVerticalStretchWeight/SetHorizontalStretchWeight, orSetFillHeight/SetFillWidth); no longer keyed on type defaults.
Misc
-
Auto ToolTip for clipped text:
Label(when Ellipsis-truncated) shows the full text on hover;Buttondelegates to its inner Label. -
Custom title bar:
CaptionButton::Kind::Pin(client toggle, always-on-top) +TitleBar::AddCustomButton. -
TreeView:TreeNode::bgColorrow background +GetScrollOffsetY/SetScrollOffsetY. -
Window::DefaultBackdropColordefaults to pure white (0xFFFFFFFF). -
Version 1.16.0 → 1.17.0.
2026-10-03 — Render thread off by default + system dialogs (file/folder/color) + stability fixes (v1.16.0)
Independent render thread now off by default
ZUFYUI_RENDER_THREADdefaults to0(single-threadedWM_PAINT, stable). The mechanism is currently unstable and buggy (blank popups, delayed hover/tooltip and nested page switches, occasional crashes with large data, ...) and is not recommended; set it to1only if you really need vblank-level smoothness and can afford the debugging cost. Noted in README / API docs.
New system dialogs (ZufyUIWindowTool.h)
- File / folder:
FileDialog(modernIFileOpenDialog/IFileSaveDialog) — supports type filters (multipleFileFiltergroups), multi-select, folder picking, save-as, initial directory / default name / default extension;Open/OpenFiles/PickFolders/Save+*Oneconvenience +FilterLabels. - Color:
ColorDialog::Pick(owner, initial, opts)(ChooseColor) with preset custom colors. - Opt-in macro
ZUFYUI_ENABLE_COMCTL_V6: when defined, the library injects the Common Controls v6 manifest dependency (ChooseColor/MessageBoxget themed). Because the manifest is application-wide, it is off by default and left to the application.
Stability / correctness fixes
-
Render-thread structure:
Present1moved out ofrenderLock_(agpuLock_guards swap chain / device resources);PageHosttransition state /pages_mutations now locked; popups render synchronously on first show viaRenderNowSync; new library error signalUIZSignals::Error(menu/window/composition-backend creation failures are reported, not silent). -
Cursor: added "desired cursor" tracking;
WM_SETCURSORre-applies it per hovered element, fixing the flicker where a control's own cursor was repeatedly reset. -
Hover pass-through: while a menu is open or input is modal-blocked, main-window elements no longer hover.
-
TreeView first column: when space is tight, hide icon / checkbox / triangle in order and clamp the text start into the column so the text ellipsizes (instead of disappearing).
-
TrayIcon: callback message no longer collides with
WM_RENDER_TICK;MenuWindowcreation failures are no longer silent. -
Version 1.15.0 -> 1.16.0.
2026-10-03 — Data-view virtualization + cross-thread concurrency hardening (v1.15.0)
Data views (ListView / TableView / TreeView) virtualization
- Now viewport-virtualized: cell labels are created / arranged / drawn only for visible rows (pooled label reuse), so millions of rows no longer blow up the visual tree.
ListView/TableViewgain:- Hide:
SetItemHidden/IsItemHidden/ClearHidden; - Filter:
SetFilter(pred)(predicate takes the source row) /ClearFilter; - View-order sort:
SetViewComparator+SortView/ClearViewSort; - Two coordinate systems:
VisibleCount/SourceOfVisible/VisibleOfSource/TextAtVisible/SetSelectedVisible/GetSelectedVisible(visible order); every other existing API keeps using the source row.
- Hide:
ListViewdata API unified to*Item*(SetItemCount/SetItem/AddItem/SetItemHidden/SetItemToolTip/GetItemText, ...); the duplicate*Row*forms were removed.TreeView: newBeginUpdate/EndUpdate(rebuild the visible list once, removing the O(N^2) cost of adding nodes one by one),SetNodeText/GetNodeText(write a cell by column; empty slots auto-create a Label),SetNodeTooltip/GetNodeTooltip.GetChildrenmade read-only: every container now rebuilds its child list in the update phase viaRefreshChildren();GetChildren()just reads — the render thread no longer mutates the element tree while rendering.
Cross-thread concurrency hardening (independent render thread, arch B)
- Window-destruction UAF eliminated: a liveness token (
alive+inFlight) that lives outside the window's memory. The render thread pins before each batch; destruction setsalive=falsethen waits forinFlightto reach 0 (viacondition_variable, no busy-spin) before tearing anything down. ComboBox/TabView/TreeViewinput/data mutations now holdrenderLock_; added the lock toWindow::OnMouseUp(fixes the hover-animation-field race viaUpdateHover -> OnMouseEnter/Leave).g_imageDeviceEpoch/frameRateLimit_/windowId_made atomic;AppCore's window registry guarded by ashared_mutex;WM_SIZEresize packed into a single 64-bit atomic;~UIElementunregisters from the pending-repaint set; font cache is now event-driven (GetFontFormatfast path is lock-free, no per-framewstringcopy);ComboBox::overlayConn_disconnect moved to the UI thread.- Lost-wakeup fix:
renderRequested_is cleared after a frame is processed and re-armed once, removing the "debounce window drops a wake -> wait one extra frame for WM_TIMER" case.
ComboBox fixes
- Dropdown geometry unified (
UpdateListGeometry, shared by UI and render): hit-testing / arrow direction no longer use a stale previous-frame value. - Disabled state survives filtering (stored by source index internally); added source-index selection API
SetSelectedSourceIndex/GetSelectedSourceIndex/SourceIndexOf.
Other fixes
-
TreeView:Clear()resets the visible-index map;GetNodeAtYno longer mis-hits the header;VK_UP/DOWNwrap at the ends; column layout tracked by a version counter (no per-frame column signature); the root arrow and its hit region agree whenrootDecorated_=false. -
TabView:AddTab/InsertTab/RemoveTab/ClearTabsnow emitSelectionChangedwhen the selection changes. -
TextBox::Copy/Pasteopen the clipboard with the owning window'sHWND. -
Version 1.14.2 -> 1.15.0.
2026-10-02 — Fix A1 double-drive (doubled CPU/GPU) + A3 frame-rate cap (v1.14.2)
- Fix (critical): A1's vblank tick and the old
WM_TIMER -> HasRenderWork -> InvalidateRect -> WM_PAINTpath were both driving frames during animation, each triggeringAdvanceFrame + RequestRender-> potentially two frames per vblank -> doubled GPU/CPU (this was the "smooth but more expensive" root cause). Now, while animating,WM_TIMERyields to the tick and no longer callsInvalidateRect; non-animation work (tooltip / title polling / one-off repaints) still goes throughWM_PAINT. - A3 frame-rate cap:
Window::SetFrameRateLimit(fps)/GetFrameRateLimit(), plus staticWindow::SetDefaultFrameRateLimit(fps)/GetDefaultFrameRateLimit().0or unset = follow the display refresh (default, no behavior change);>0caps the average animation frame rate. Implemented withdetail::NowMs()(QPC monotonic ms) +detail::PreciseSleepMs()(high-resolution waitable timer, falls back toSleep) to pad the interval before composition. The demo now haswin.SetFrameRateLimit(0);(change to60to test the lower load). - Version 1.14.1 -> 1.14.2.
2026-10-02 — A1 frame pacing: drop the WM_PAINT round-trip for animation continuation (fixes 120/60 jitter) + restore the indeterminate ProgressRing demo (v1.14.1)
- A1 frame pacing (
ZUFYUI_VBLANK_CLOCK, default 1): animation continuation no longer goes throughContinueFrame -> InvalidateRect -> WM_PAINT— WM_PAINT is only synthesized when the queue has no higher-priority message and can be delayed by input, which makes the frame-start time vary a lot ->120<->60jitter. Instead the render thread directlyPostMessage(WM_RENDER_TICK)s the UI thread to runAdvanceFrame()(the "layout + animation + collect active animations" block extracted fromOnPaint), debounced byframeTickPending_. Set to 0 to fall back to the v1.14.0 behavior. - Extracted
Window::AdvanceFrame(), shared byWM_PAINTand the new tick;DwmFlushpacing is unchanged (present still aligns to vblank). - Restored the indeterminate
ProgressRing(continuous spinner) on the demo "New controls B" page — mistakenly removed during the v1.14.0 phase-0 cleanup (it was a feature demo, not a temporary diagnostic). - Version 1.14.0 -> 1.14.1.
2026-10-02 — Independent render thread (arch B) + hover repaint optimization (v1.14.0)
Independent render thread (arch B)
- Rendering is split off the UI thread: a process-level render thread handles composition /
Present1/ theDwmFlush(vblank) cadence; the UI thread only does messages, input, layout and animation, and wakes the render thread via a coalescedRequestRender(). - Shared device, per-thread context: the
ID2D1Deviceand the DComp / swap chain are created on the UI thread; the render thread creates its ownID2D1DeviceContext; element caches move fromID2D1BitmapRenderTargetto device-scopedID2D1Bitmap1(two-pass: dirty caches are drawn on a separate DC first, the main frame only blits) — sharing across DCs works. - Cross-thread correctness: DC operations are serialized by
renderLock_(the tick stays outside the lock so the UI is never blocked);WM_SIZEonly sets a pending flag and the render thread callsResizeBuffersunder the lock;WM_DPICHANGEDrebuilds under the lock; device-lost goes "render detects -> pause render -> rebuild on the UI thread -> resume"; minimized windows emit no frames. - Compile-time switch
ZUFYUI_RENDER_THREAD(default1); set to0to fall back to the original single-threadedWM_PAINTpath.
Hover repaint optimization (lower CPU)
- Fixes "moving the mouse over the blank area of the button list (
ListView) keeps burning CPU": the root cause wasListView::OnMouseMovecallingRequestRepaint()unconditionally on every move (regardless of whether the hovered item changed, or whether it was blank) ->pendingRepaint_was never empty -> full-window recomposition every frame. - Same fix for the
ComboBoxdropdown,DataViewergrid andTreeView: repaint only when the hover state actually changes (hover highlight behavior is unchanged).
Robustness
TabView/ProgressRing/SplitViewDrawnow guard against non-finitearrangedRect_, avoiding Direct2D geometry assertions from not-yet-laid-out / degenerate sizes.- Version 1.13.0 -> 1.14.0.
2026-10-01 — Menu rework: popup layer now derives from Window (fixes ~+90MB per open) + openable Window internals
Menu (major architecture rework)
- Right-click / standalone / submenu popups now derive from
Window(MenuWindowBase : Window+MenuWindow : MenuWindowBase) and use DComp + the process-shared D3D/D2D device — fixing ~+90MB per menu open (the old code usedWS_EX_LAYERED + UpdateLayeredWindow + DIB + its own D2D factory/DC render target, i.e. a separate software render device per menu). - Soft shadow, rounded corners, fade-in, screen-edge avoidance, outside-click/Esc close, and the submenu open/close delay are all preserved.
- Popups return
WM_MOUSEACTIVATE → MA_NOACTIVATEandWM_NCACTIVATE → FALSE(refuse activation), so clicking them no longer makes the owner window receive a spuriousWM_KILLFOCUS(the root cause of "clicking an item does nothing / just closes"). MenuWindowBaseis subclassable → users can build custom flyouts (flyout / panel).
Openable Window internals (new)
- Overridable creation parameters:
GetCreateStyle/GetCreateExStyle/GetCreatePos/WantDwmChrome/WantBackdrop. - Message interception:
OnWindowMessage(single entry; return true to swallow) +OnWindowMessageHandled(observe) +OnWindowClosing. - Self-draw:
RenderContent(ID2D1DeviceContext*);SetContentOpacity(whole-window opacity, for popup fade). Windowis now subclassable (virtual dtor + the virtuals above).
Misc
- Menu keyboard:
↑/↓/Home/End,Enter,Esc,←/→submenus, item shortcuts (Ctrl+C, ...);Tabcloses the menu. - ToolTip: fixed "text drawn outside the box" (clamp the layout to the render target + ellipsis + clip).
- Crash fix: a use-after-free when a menu item callback pops a modal (e.g.
MessageBox) —Window::WndProcnow has a self-destruct guard (the window object may be destroyed duringHandleMessage, so afterwards it only checks the HWND and never touchesself); menu item callbacks are deferred to after the current message is handled (detail::PostToUIThread, kept alive withshared_ptr), so they never run inside the message stack.
Data views / docs (v1.10.0)
- Data views gain coordinate helpers
ContentToLocalX/Y+LocalToContentX/Y(collapsing the scatteredarrangedRect_.x - Snap(scrollOffsetX_)into one place). - Audited and confirmed: data-mutating methods (
SetRowCount/SetColumnCount/ row/column insert/remove /SetItem/AddItem, ...) already autoInvalidateLayout+RequestRepaint; containers'AddChild/SetParentauto-mark dirty — no manualMarkChildrenDirtyneeded. - Docs: added "Window lifetime and semantics" (
Show/RunModal/ owned /shared_ptr). - Version 1.9.6 -> 1.10.0.
Internal robustness / performance (v1.10.1)
- Process DPI awareness moved to static-initialization time (before
main, before any window) — it used to live inWindow::Createwith its return value ignored, so if the process created any other window first it would silently fail and every coordinate in the process would be wrong. Window::Creategainedx/yposition parameters (defaultCW_USEDEFAULT; when omitted it can still be overridden byGetCreatePos).ListViewchild cache now uses field-by-field comparison — the old float key (count*1e6 + rowHeight*1e5 + ...) had overlapping field ranges and lost precision past ~10k items.TreeView::TreeNode::parentis nowstd::weak_ptr(weak ref breaks the cycle); checking walks the parent chain withlock(), dropping the per-level whole-treeFindNode(was O(n·d)).- System noise texture now caches the module handle + decoded WIC bitmap: a DPI change no longer re-runs
LoadLibrary+ WIC decode. ImageDeviceCache::Getmoves the GPU upload (CreateBitmapFromWicBitmap) out of the lock (double-checked).ComboBoxdropdown now connects to the globalDrawOverlayon demand: collapsed combo boxes no longer run an empty lambda every frame.Label::Draw/Label::MeasureOverridego through theFontManagerlayout cache (key now includes alignment / line spacing / max lines; the Ellipsis truncation result is cached by original text, so a hit skips the whole truncation computation). Highest-frequency widget path — biggest win in tables.
Stability fix (v1.10.2)
- Text-layout cache accessors now return a strong
ComPtrinstead of a raw pointer.GetRawLayout/GetDisplayLayout/GetStyledLayout/GetStyledDisplayLayoutused to hand back a raw borrow into the cache, and the bounded FIFO (cap 400, drops 1/4 at a time) could free that entry between "got the pointer" and "used it" -> dangling (surfaced as an access violation inLabel::MeasureOverride->GetMetricsunder large tables + frequent refresh). The caller now holds a strong reference, so an evicted entry cannot invalidate the object. FontManager's factory init,formatCache_, andlayoutCache_/layoutFifo_are now guarded by astd::mutex(defends against any future cross-thread call).
Stability / robustness fixes (v1.10.3)
MenuWindowresource leak: its brushes / text formats / stroke style are raw-pointer members (they do not live on therootElement_chain), so every menu open leaked a full set of D2D/DWrite resources; added~MenuWindow()toRelease()them all.UIElement::SetParent: detaching tonullptrnever marked the old parent'schildrenDirty_, so its child view cache stayed stale; now both the old and new parent are marked.UIElement::AttachWindowRecursive(base): now recursesGetChildren()by default, fixing stale subtreewindowId_when an ordinary control is moved (previously only containers that overrode it recursed).WndProcself-destruct guard: now also checksGWLP_USERDATA == selfand clearsGWLP_USERDATAonWM_NCDESTROY, covering HWND-handle reuse.TableView/TreeViewchild cache: the column check changed from a width sum to an order-sensitive hash, fixing a stale layout after swapping two column widths (cell text stayed at the old positions).
New controls / ScrollBar extraction (v1.11.0)
- Icon system
FontIcon+Icon(new headerZufyUIIcons.h): the enum value IS the font codepoint; Win11Segoe Fluent Icons/ Win10Segoe MDL2 Assetswith runtime fallback; glyph layouts go through the globalFontManagercache. TabView: a compact top tab strip (centered text + selected light-blue background#D6E8FB+ underline indicator + hover + rounded border); optional closex(darkens on hover); content hosted by an internalPageHostso switching reuses the transition animation; on overflow, ◀/▶ buttons (shown per scrollable direction) plus a bottom horizontal scrollbar; the wheel scrolls tabs only over the strip; closing a tab slides the rest into place.RadioButton+RadioGroup: circular radios; group mutual exclusion (an explicit group, not inferred from the parent), vertical/horizontal, group keyboard navigation (skips disabled items), selected item gets a light-blue row background + accent left bar;SelectionChanging(veto) andSelectionChangedenable custom exclusion/linkage.ScrollBarextracted into a standalone reusable control (fromScrollViewer): self-contained hover-expand + idle-shrink (default 2s -> thin line) and a callback-based value (drag immediate / track-click smooth); shared byScrollViewerandTabView.
New controls / UX (v1.12.0)
ProgressRing: determinate (arc + eased value changes) / indeterminate (head advances exactly 2 turns per cycle + sweep "breath" -> no jump, tail never reverses).NumberBox(numeric input / spinner): internalTextBox+ character filter + IME disabled; overlaid inside the box on the right: up/down steps and a clear × (shown when the value differs from the default; click restores it); empty text -> error (the control's own behavior);ValueChanged(commit) /TextChanged(live validation); out-of-range input clamped to[min,max].SplitView(two panes): draggable splitter (rounded + hover highlight); dragging re-marks only the two children (not the whole control); each pane is clipped topane rect ± bleed; multi-pane via nesting.TextBox: new bottom blue indicator (replaces the bottom border, blends with corners), error state (SetError, whole box turns red, border width unchanged), IME toggle (SetImeEnabled); read-only shows no caret (still selectable).ScrollBar: extracted into a standalone reusable control; 2s idle shrink, hover restore + hover animation.- Fix: containers (
LayoutHost/SplitView/NumberBox) previously did not recurse the animation tick down to their children -> child hover/page animations did not run; fixed.
Frame-pacing fix · buttery animations (v1.12.1)
- Symptom: frame rate measures 60 but looks like 30-40 ("stuttery").
- Root cause: uneven frame intervals (not a low frame rate).
WM_TIMERqueuesInvalidateRect->WM_PAINTgets jumped by mouse/keyboard messages, so the frame start drifts andPresent1(1)quantizes it into whole-vblank misses; the timer (~15.6ms) and vblank (16.67ms) are also inherently misaligned -> periodic micro-hitches. - Fix (two small changes):
- In
WM_TIMER, useRedrawWindow(..., RDW_INVALIDATE | RDW_UPDATENOW)to synchronously trigger WM_PAINT (bypass the message queue); - In
OnPaint, schedule the next frame right afterPresent1(1)returns (InvalidateRect) -> the cadence is driven by vblank instead of the timer.
- In
- Result: subjectively far smoother, close to native WinUI.
Right-click menu / CPU fixes (v1.12.2)
- Fixed "right-click menu never appears while the main window has a sustained animation": the root cause is that
WM_PAINThas higher retrieval priority thanWM_TIMER— the main window's present loop posts aWM_PAINTevery frame, starving both the menu window's fade-in timer and its ownWM_PAINT, so the menu stays at opacity 0 forever (looks like "it never opens"). Now the menu is set opaque immediately and painted synchronously once viaRedrawWindow(RDW_UPDATENOW), no longer depending on a starved timer. (Side effect: menus no longer fade in; they appear instantly, for reliable display under continuous animation.) - Lower CPU: removed the "hovering any element that has a tooltip keeps
HasRenderWork()true" condition fromHasRenderWork()— it made the timer repaint the whole window every 16ms. The tooltip's 500ms delay and fade-in are already advanced byUpdateTooltip()inside the timer tick; they don't need repainting to progress. - Lower GPU: no longer stuffs the whole "active animation set" (one spinner drags a dozen+ ancestor containers) into
pendingRepaint_every frame — measured to cause a full-window recomposite each frame (~10% GPU). - Frame pacing:
WM_TIMERis back toInvalidateRect(removed the previousRDW_UPDATENOWsynchronous draw) to avoid double-drawing every frame on top of the present-driven loop and to stop clogging the message pump; the present-driven next-frame gate changed fromHasRenderWork()to "an animation is actually running", avoiding a self-sustaining loop that starvesWM_TIMER(which would stop tooltips from showing). - Menus:
MenuWindow'sGetFactoryAddRefwas not paired with aRelease(one factory reference leaked per menu); the same submenu is no longer re-opened when it is already expanded. - Controls:
TabView::LayoutStripnow has a zero-size guard (avoids bogus arrangement at zero width/height);ProgressRingnow usesUseCache()=false(it changes every frame; the cache would just be rebuilt needlessly);NumberBox::ResetToDefault()now clears the error state and firesTextChangedafter restoring the default. - Version 1.12.1 -> 1.12.2.
Framework Timer / Label icons / Label-based tabs (v1.13.0)
- Framework
Timer(signal-based):Window::CreateTimer(ms)->std::shared_ptr<Timer>;Timer::Tickis aZSignal<>. StillWM_TIMERunderneath, but the id uses a reserved framework range (0x7F00+) so it never collides with the library's internal id or app-defined ids; the timer auto-detaches when the window is destroyed and auto-Stops/unregisters when theTimeris destroyed. Labelbuilt-in glyph icon:SetIcon(Icon[,size])/SetIconColor/GetIcon(reusing the existing image-icon slot;size<=0follows the font size; color defaults to the text color; icon-only when there is no text); the "icon + text (+children)" block is aligned as a unit (so on a button the icon hugs the centered text).- Icon system moved to the core:
Icon/IconGlyph/IconFontFamilymoved fromZufyUIIcons.htoZufyUIWidgets.h, usable by any control;FontIcon/MakeFontIconremain inZufyUIIcons.h. Buttonforwards the icon:SetIcon/GetIcon/SetIconColor(to its internalLabel).TabViewtab titles are nowLabels:AddTab(shared_ptr<Label>, ...)/SetTabLabel/GetTabLabel(thewstringoverload stays as a convenience) -> tabs support icons naturally.ScrollBar::ShrunkWidthRatio(default0.30): hosts can reserve exactly the shrunk thickness;TabView's "tab strip <-> content" gap is now that thin-line thickness.- Frame-loop improvements (for "timers/popups starved while animating"): before the present-driven self-continuation, dispatch due
WM_TIMERs (fixes inaccurate periodic polling), and add a yield gateHasSiblingWindowNeedingPaint()(EnumThreadWindows+GetUpdateRect, a precise test) — if another window of this thread is waiting to paint, the current round does not schedule its own frame, so their paint is not postponed indefinitely. - Menu open fade-in restored (
ShowAtPoint: synchronously paint one frame first, thenSetContentOpacity(0)+ fade in;WM_TIMERis no longer starved). - Version 1.12.2 -> 1.13.0.
2026-09-26 — Tray / taskbar / menu enhancements + app identity self-registration
Menus
- Rebuilt the right-click menu as a layered window with self-drawn soft shadow, rounded corners, and fade-in; fixed "menu won't open a second time" (root cause: the checkmark's
ID2D1StrokeStylewas astaticreused across factories →EndDrawreturnedD2DERR_WRONG_FACTORY; now created/released per instance). - Menu item enhancements:
id/ check / radio / default item (bold + Enter) / danger (red) / shortcut hint / disabled; per-itembgColor/textColor/font;Menu::font/SetDefaultFont. - Dynamic menu factory
UIElement::SetContextMenuFactory(built on each right-click) +SetContextMenuEnabled. - Standalone popup
Menu::ShowAt/ShowAtCursor(bound to no window; for tray menus); open menus are mutually exclusive. - Hover highlight is now a translucent overlay (still visible over a custom background).
Tray / taskbar / icons
TrayIcon(Shell_NotifyIconv4): hover / click / right-click / double-click, badge (self-drawn composite), balloon (ShowBalloon,BalloonIcon= None/Info/Warning/Error/Custom, realtime / silent); auto re-added afterexplorerrestarts.- Taskbar: progress (
SetTaskbarProgress), overlay badge (SetTaskbarOverlayIcon), thumbnail toolbar (SetThumbButtons, theImageoverload auto-builds anHIMAGELIST), jump lists (SetJumpList, tasks + categories + recent). Window::SetAppIcon(unifies native big/small + class icons + custom title bar),ShowActivate(four modes),Flash(FLASHW_ALL);TitleBaricon badge / progress.Image::ToHICON/CopyPixelsBgra.
Data views
ListView::ItemRightClicked(row)+GetContextRow();TableView::CellRightClicked(row,col)+GetContextRow()/GetContextColumn()for list/table right-click menus.
App identity self-registration (new)
- Declare
AppInfo{ displayName, aumid, icon }+RegisterApp(...)(free function /Application::RegisterAppforwarding): sets the process AUMID so toast / jump list / taskbar grouping share one identity. - Requires the explicit authorization macro
ZUFYUI_ALLOW_APP_REGISTRATION; when authorized it writesHKCU\...\AppUserModelId\<AUMID>(DisplayName + IconUri) and caches the icon at%LOCALAPPDATA%\ZufyUI\AppReg\<AUMID>\app.ico, cleaning both up on process exit; without the macro it only sets the AUMID (zero side effects).
Build
- Added a precompiled header
pch.h/pch.cpp(demo compile ~1.1s);Releasedrops debug info;Debugadds/bigobj.
Note (historical): menu popups early on used the "layered window + software render target" path and each menu created its own D2D factory → ~+90MB per open; fixed since v1.8.0 (
MenuWindowBase : Window+ DComp + process-shared device). Kept only as history.
2026-09-20 — Performance work + backdrop API consolidation (v1.9.6)
- Performance: page-switch peak memory 300–400MB → capped at ~30MB; layout rework (DesiredSize cache + two-level dirty flags; no more "clear all caches on any layout invalidation"; page switches no longer trigger a full relayout); no per-frame full-tree hit-testing while dragging/resizing; global cross-widget text-layout cache + binary-search ellipsis for
Label; no per-elementGetDpi(). - Backdrop API consolidated to "a 3-way layer + an overlay colour":
Backdropis onlyNone / Acrylic / Mica;BackdropModeremoved;ReloadAcrylic/ReloadMicaremoved; newSetBackgroundParams(layer, BackgroundParams/AcrylicPreset)plusAcrylicParams/MicaParams. Acrylic/Mica are rendered by ZufyUI itself, identical on Win10 and Win11. - Data views:
ListViewgainsBeginUpdate/EndUpdatefor batched add/remove. - Fixes: sort now emits
SelectionChanged;ComboBoxfiltering keeps the selection;TextBoxundo stack;CaptionButtonpress behaviour; scrollbar divide-by-zero guards; image cache device epoch.
2026-09-19 — Post-1.8.0 fixes and polish (v1.8.1)
Backdrop
- The DComp acrylic background layer is now rebuilt at runtime (new
UpdateDCompBackdrop()):SetBackdrop/SetBackdropModework even after the window is created; switchingAcrylic → Mica/otherproperly clears the old layer (no more see-through/black); it is also re-attached after device-loss rebuilds.
Window
- Added
Window::SetTitle(const std::wstring&)andWindow::SetIcon(HICON bigIcon, HICON smallIcon)(native title bar; useTitleBar::SetTitlewith a custom title bar). SetCustomTitleBarnow applies the currentSetTitleBarVisiblestate, removing the "hide then install" inconsistency.
Signals (connections)
Connectionis now a QtQMetaObject::Connection-style passive handle: copyable, and destroying it no longer disconnects.UIElement::Connect(...)now returns aConnection; ignoring the result is safe, and to disconnect a single connection useauto c = elem->Connect(sig, slot); … c.disconnect();. Auto-disconnect is still handled by the element'sConnectionGroup(ImageManager's DeviceReset subscription also goes through a group). Removed the redundantautoConnections_.
Data views / controls
TableViewcell keys changed from(long long)row*10000+colto(uint64)row<<32 | col, fixing key collisions when a column index ≥ 10000 (cellSel_/cellTextColors_/cellTips_).ListView::MoveItemnow firesSelectionChanged(andEnsureVisible).ComboBoxitem widths are cached (recomputed only when data changes) andSetToolTipwas moved out ofMeasure(no per-frame measuring / side effects).ScrollViewerclips content to the viewport (newUIElement::SetClipRect), so it no longer draws under the scrollbars; the scrollbars themselves are unaffected.
Misc
PageHostgained transition easingTransitionEasing { Linear, EaseInOut, EaseOut }, defaultEaseInOut(smooth); switch viaSetTransitionEasing.- Process DPI awareness is set once; removed the dead
D2DERR_RECREATE_TARGETbranch. - Memory leak fixed:
AppCore::dqController_is held/released viaComPtr. - Demo: removed the standalone "custom title bar window" (the main window is already custom).
2026-09-19 — Rendering migrated to DirectComposition + backdrop/signal API overhaul (v1.8.0)
Rendering: migrated to Direct2D 1.1 + DXGI flip SwapChain + DirectComposition
Windowno longer usesID2D1HwndRenderTarget; it now uses anID2D1DeviceContext+IDXGISwapChain1(CreateSwapChainForComposition) + a DComp visual tree, withWS_EX_NOREDIRECTIONBITMAP, so content is submitted via DComp and per-pixel transparency is supported.AppCoreshares a process-wideID3D11Device → IDXGIDevice → ID2D1Deviceand WinRTICompositoracross windows.- Device loss / DPI change / resize go through a unified discard-and-recreate path (
DiscardDeviceResources/ResizeSwapChain); newDeviceLost/RenderingErrorsignals.
Acrylic: switched to the DComp HostBackdropBrush + Gaussian blur
- Acrylic is now drawn by a DComp background layer (
ICompositor3::CreateHostBackdropBrush, falling back toICompositor2::CreateBackdropBrush, wrapped in a Gaussian blur effect) that samples the host backdrop, together withDWMWA_USE_HOSTBACKDROPBRUSH+AccentState(HOSTBACKDROP); it no longer relies onDWMWA_SYSTEMBACKDROP_TYPE, which breaks as the window frame changes. - Includes a hand-written
IGraphicsEffect/IGraphicsEffectD2D1Interopwrapper (no Win2D); new dependency ond2d1effects_2.handdxguid.lib.
Backdrop API overhaul ("what" vs "which API")
- New
Backdrop { None, Normal, Blur, Acrylic, Mica, MicaAlt }: what effect you want. BackdropMode { Auto, System, Accent }: which API implements it.SetBackdrop(Backdrop, tint = 0)/GetBackdrop(),SetBackdropMode/GetBackdropMode().- Removed the old
WindowBackdrop/SystemBackdropMaterial(confusing names/semantics).
Callbacks → signals
UIElementevents changed from rawstd::functionmembers to signals:MouseEnter / MouseLeave / MouseMove / MouseDown / MouseUp / KeyDown / KeyUp / Char / Focused / Blurred.MenuItem::Clicked,CaptionButton::Clicked(default behaviour wired byDefaultTitleBar; custom title bars can connect/intercept themselves).- New
Window::Closing(ZSignal<bool*>, set*cancel=trueto cancel, e.g. "confirm before close"),Window::BackdropUnsupported/Window::DeviceLost/Window::RenderingError. - Global
UIZSignals::DeviceReset: fired when render device resources are discarded/recreated, so subscribers can clear device-keyed caches (ImageManagerclears image bitmap caches, fixing dangling render-target keys and bitmap leaks). - Removed
SetBackdropUnsupportedHandler/SetDeviceLostHandler/SetRenderingErrorHandler.
Window
Window::Createno longer shows the window automatically; the app decides when toShow().- Custom title bar: added per-button enable/visible control:
TitleBar::GetButton / SetButtonEnabled / IsButtonEnabled / SetButtonVisible / IsButtonVisible;DefaultTitleBarconvenienceSetMinimizeEnabled / SetMaximizeEnabled / SetCloseEnabledand...Visible. DWMWA_BORDER_COLORnow defaults to the system default (no hard-coded grey).
Fixes and cleanup
- ComboBox popup hover/click hit-testing now uses the same width as drawing (
ListWidth()), fixing the unreachable overhang on the right. TableView::SortByColumnremapscheckedRows_after sorting.- Double-click detection now uses the system
GetDoubleClickTime()(three places). ScrollViewer::ArrangeusesSetVisibleNoInvalidate()to avoid a layout loop;DrawTextWithEllipsistruncation changed from O(n²) to binary search.MenuWindowpositioning now usesMonitorFromPoint+GetMonitorInfo.- Removed several fallback/temporary bits (debug-only
PageHostspecial case, unusedanimationIdleFrames_, etc.).
Demo (ZufyUI.cpp)
- The main window now uses a custom title bar.
- The separate small tool window was removed; the multi-window / owned / modal demos moved into a new "Multi-window" page of the main window.
- Version bumped to 1.8.0 (new
ZufyUI_VERSION_STRINGetc. macros, referenced by the demo title).
2026-09-16 — Custom title bar (ZufyUIWindowTool) and backdrop modes
New: custom title bar (new file ZufyUIWindowTool.h)
TitleBar/CaptionButton/DefaultTitleBar: window-level controls installed as a non-layout overlay viaWindow::SetCustomTitleBar; passnullptrto restore the native title bar.- The three caption buttons are drawn with the system icon font (
Segoe Fluent Icons/Segoe MDL2 Assets, glyphsE921/E922/E923/E8BB), with hover/press gradients and red close hover#C42B1C; buttons reportHTMINBUTTON/HTMAXBUTTON/HTCLOSEfromWM_NCHITTEST, enabling the system Snap Layouts; clicks are handled inWM_NCLBUTTONUP; the title bar area is the drag region (drag / Aero Snap / double-click maximize handled by the system). - The title bar and buttons are not Tab-focusable; default
DrawAfterLayout,UseCache. - Helpers:
SetTitleBarVisible,SetButtonsEnabled,SetButtonWidth/Height,SetRightMargin,CaptionButton::SetAnimationSpeed, etc.
New: layout participation / drag mechanism (UIElement)
LayoutParticipation { Normal, DrawBeforeLayout, DrawAfterLayout }: non-participating elements are drawn by the window before/after the normal layout tree; layouts and theComposeImplchild recursion skip them.- Drag regions:
SetDraggable / SetDragRegion / CollectDragRegions; the window collects them each frame and feedsWM_NCHITTEST(returnsHTCAPTION).
New: three backdrop modes
BackdropMode { Auto, Acrylic, SystemBackdrop }+SystemBackdropMaterial { Auto, Mica, MicaAlt, Acrylic }+SetBackdropUnsupportedHandler.SystemBackdropuses Win11DWMWA_SYSTEMBACKDROP_TYPE; if unsupported the handler is called and it falls back toAccentState.
Window / frame fixes
- Snapped windows keep the DWM border and shadow:
WM_NCCALCSIZEinsets only the edges snapped to the work area (using the actualDWMWA_VISIBLE_FRAME_BORDER_THICKNESS), and maximizing does not inset;SWP_FRAMECHANGEDis sent when the maximize/snap state changes. - From maximized, dragging down from the top edge restores the window; the close button aligns with the native position.
Demo: ZufyUI.cpp gained a "custom title bar window".
Known limitations (important)
- ZufyUI currently renders through
ID2D1HwndRenderTarget(an opaque redirection surface) and cannot display DWM system materials:BackdropMode::Autouses AccentState on both Win10 and Win11, andSystemBackdropis not visible until the render target is migrated to DirectComposition (it looks gray/black). - AccentState acrylic is an undocumented API and makes DWM skip window transition animations (minimize/maximize) on both Win10 and Win11. Getting "acrylic + native animations + Mica" together requires migrating rendering to DirectComposition (SwapChain / CompositionSurface), which is planned.
2026-09-15 — Image system, window mechanisms, and root-cause fixes
Images (new ZufyUIImages.h)
- New
Image: WIC decoding + Direct2D (GPU) drawing/transforms. Loading:FromFile / FromMemory / FromBase64 / FromResource(HMODULE,name,type) / FromResource(id,type) / FromHBITMAP / FromHICON; transforms:Scaled / ScaledToWidth / ScaledToHeight / Rotated / Mirrored / Cropped(lightweight descriptors applied by the GPU at draw time); drawing:Draw(opacity / interpolation),Bake; encoding:Save / Encode(CreateStreamOnHGlobalmemory stream, no temp files). ImageManager: sharedIWICImagingFactoryand device-cache registry;ImageDeviceCache: oneID2D1Bitmapper render target, rebuilt on device loss. The same image is uploaded to the GPU once per window.- Root-cause fix:
IWICStream::InitializeFromMemorydoes not copy the buffer and decoding/conversion are lazy; pixels are now copied into an independent WIC bitmap immediately at decode time viaWICBitmapCacheOnLoad, soFromMemory/FromBase64/RT_BITMAPno longer read freed memory while drawing (previously the image never appeared). - Root-cause fix: the transform matrix composition in
DrawWithTransformwas reversed, pushing rotated/mirrored images out of the target rect (they appeared missing); fixed by using theRotation/Scaleoverloads that take acenter. Labelnow supports an icon and nested children:SetImage/GetImage,SetIconSize/GetIconSize,SetIconSpacing/GetIconSpacing,AddChild/ClearChildren/GetChildCount(icon + text + children laid out inline).
Windows
RunModalnow uses the official mechanism:EnableWindow(owner, FALSE)+ activating the modal window + anIsDialogMessagenested loop; the global low-level mouse hook was removed (it used to swallow clicks for other processes, breaking the whole desktop's input while modal).- Owned child windows now establish the owner relationship at creation (via the
CreateWindowExparent parameter), so they have no separate taskbar button; when the owner is minimized their owned children are hidden unconditionally and restored on restore/activate (no longer relying on the shell's minimize grouping, which fails when the owner is in the background). - New convenience APIs:
Flash(times=5, captionOnly=true)/StopFlash()(FlashWindowEx),GetOwnedWindows(),GetStyle()/GetExStyle(),SetWindowStyleFlag/SetWindowExStyleFlag(e.g.WS_EX_TOOLWINDOW),Show()/ShowNoActivate()/Hide()/Raise(). - New
OwnedMinimizePolicy { None, Hide, DisableMinimize }+SetOwnedMinimizePolicyfor how an owned child handles being minimized on its own. - Fix: on destroy a window clears every reference other windows hold to it (
owner_/ hidden lists), so address reuse can never affect unrelated windows. - Fix:
SIZE_RESTOREDalso fires while dragging to resize, which used to unconditionally restore hidden owned children (resizing made them pop back); now they are restored only on a real "minimize -> restore".
Controls / rendering
- Root-cause fix: when an element cache bitmap is composited onto the main render target, the destination pixel size must exactly match the bitmap's pixel size; otherwise any interpolation resamples the whole cache and text looks blurry. Now the destination size is derived from the bitmap's actual pixel size.
ComboBox: the collapsed box sizes to the average item text width (overflow is ellipsized with an automaticToolTipof the full text); the drop-down list sizes to the widest item so every option is fully visible; fixed the scrollbar being drawn in the middle when the list is wider than the box.
Docs
- API docs gained an Images chapter (zh/en), plus new
Window,Label, andComboBoxAPIs and notes.
2026-09-13 — Major update: interaction states, shadows / tooltips, controls and data views
Core
UIElementgained: enabled/disabled (SetEnabled/IsEnabled/IsEffectivelyEnabled— disabled state inherits from the parent chain, blocks mouse/keyboard input, and controls grey themselves), generic tooltips (SetToolTip/GetToolTip), shadows (SetShadow/SetShadowColor/SetShadowBlur/SetShadowOffset/SetShadowCornerRadius/GetShadowExtent), and a context-menu hookOnContextMenu.Window: element shadows are composited into the offscreen cache; a shared tooltip overlay (anchored at a fixed offset above the mouse position when shown, fades in after a 0.5s hover, white background with black text and a soft shadow, dismissed as soon as the mouse moves); Tab focus traversal (the focus ring is shown only for Tab navigation, not for mouse clicks).- Shadows rewritten as layered Gaussian CDF (
DrawSoftShadow): per-layer alpha is derived from the Gaussian distribution so the composite approximatestargetA·(1-Φ(d/σ)); the alpha ofSetShadowColornow means the visible edge opacity (the interior is roughly 2×). - Frame-time clamping:
deltaTimeinOnPaintis capped at0.033s, fixing animations that jumped straight to their end after an idle period or a restore from minimize. PageHost: fixed a bug where, during a page transition, the same page was updated twice per frame, doubling the speed of animations nested inside it.- Timer precision:
timeBeginPeriod(1)on window creation andtimeEndPeriod(1)on destruction reduce animation jitter. - Debug output is now controlled by the
ZufyUI_DEBUGmacro (off by default; define it to enable); Release hot paths no longer build debug strings. - Performance / memory:
GetChildren()now returnsconst&(reused buffer, no per-frame allocation);ZSignal::Fireuses a thread-local snapshot;Composeculls subtrees entirely outside the clip; the active-animation set reuses a buffer;DrawSoftShadowuses fixed-size arrays to avoid per-frame heap allocation.
Basic controls
Button: disabled state, Enter/Space activation, checkable mode (SetCheckable/SetChecked/IsChecked/Toggled), text alignment / padding, auto-repeat.CheckBox: hover halo animation, text label and color, hover box color, keyboard, disabled.ToggleSwitch: disabled, text label, keyboard,SetSize, indeterminate state, custom colors.Label: padding, line spacing, max lines (with ellipsis),GetDesiredSize, disabled color.ProgressBar:ValueChanged, range, percentage text with text color, disabled.Slider:SliderReleased, stepping / snapping (SetStep/SetSnapToStep), arrow keys / Home / End, disabled.ScrollViewer: scrollbar visibility policy (Auto/Always/Hidden),ScrollChanged,GetScrollOffset, per-instance colors,ContentMargin.TextBox: read-only (SetReadOnly), input filter (SetInputFilter),ReturnPressed, public selection / undo / copy-paste / select-all, placeholder color, password reveal (SetRevealPassword); fixed Shift and mouse-drag selection not accumulating (independent anchor).ComboBox: data add/remove/query, placeholder, per-item disabled, max visible items, open/close signals (DropDownOpened/DropDownClosed), editable + input filtering (SetEditable/SetFilterEnabled/SetEditText, with a blinking caret and click positioning).
Data views
ListView: newNoneselection mode; type-ahead; sort comparator + indicator; per-item disabled / text color / tooltip (bound to the item itself, so they survive sorting); keyboard navigation skips disabled items.TableView: per-column sorting + indicator (row-level metadata is remapped when sorting or inserting/removing rows/columns); cell text color / tooltip; per-row disabled; column hiding; column alignment; per-row height; keyboard navigation skips disabled rows.TreeView: filter / search,GetNodePath, default expand depth; per-nodetooltipwired to the shared tooltip in the base class.
Docs
- Added this changelog; the API docs were rewritten from a "list of signatures" into a more detailed "implementation notes + pitfalls" style; added a warning about signal/object lifetime reference cycles.
2026-09-13 (cont.) — Multi-window support (Application)
- New
ZufyUI::Application:app.CreateWindow(...)to create windows andapp.Run()for a single shared message loop, Qt style; windows are truly independent. - Repaint/layout are routed per owning window (
UIElement::GetWindow()); the DPI scale is now thread-local (set per window before drawing);Windowgained instance signalsActivated/Deactivated/Closed, andUIZSignals::WindowDeactivated/GlobalMouseDownnow carry aWindow*. - Closing one window no longer quits the app; it quits when the last window closes. The
ID2D1FactoryandtimeBeginPeriodare shared by the app core. - All window-related global signals now carry a
Window*(DrawOverlay/GlobalMouseDown/WindowDeactivated, plus capture and repaint fallbacks); subscribers filter withGetWindow(). This fixes the cross-talk where window A's popup was drawn onto window B or clicking B wrongly collapsed A. AddedWindow::SetPosition/SetSize/IsValid. - Fixed ComboBoxes holding the thread-wide system mouse capture after expanding (which made other windows unusable): Win32 capture is now held only while the mouse button is down and released on mouse-up (element-level logical capture is unaffected); also handled
WM_CAPTURECHANGED. - Added modal and owned windows:
Window::SetOwner/GetOwner,Window::RunModal(owner),Application::CreateWindow(..., owner); while modal, clicking the disabled owner flashes the modal window. - Robustness: elements store the owning window as an id (instead of a raw pointer); after the window is destroyed
GetWindow()returns nullptr, removing crashes from dangling window pointers. - Fixed
PageHostcallingReleaseDeviceResources()on non-current pages every frame after a transition finished (now released once, on the completing frame); non-current pages are made invisible, so expanded controls (ComboBox) auto-collapse. - Fixed
UIElement::Connectreturning a moved-from emptyConnection(now returns nothing); fixedTreeView::RemoveChildrennot clearingcheckAnim_(dangling node keys). - Added
AGENTS.mdcodifying the principle: for any bug, find and fix the root cause first — never mask it with a new mechanism. - Backward compatible:
Window win; win.Create(...); win.Run();still works.#undef CreateWindowavoids the Win32 macro clash.