Add modern CandidateWindow rendering and theme support#3
Open
omni624562 wants to merge 13 commits into
Open
Conversation
The original code had no return after the early resize(margin_*2, margin_*2) for empty items, causing execution to fall through to width calculation where items_.size()-1 underflows to SIZE_MAX, producing incorrect window dimensions. Restructured the function to measure header width as well as height, then handle the empty-items case explicitly with header-based sizing. Also added max(width, headerWidth+margin_*2) for non-empty cases to ensure the window is always wide enough to display the header. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…owDC call Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Separate the composition header from the candidate row, add divider-aware sizing, and keep modern candidate item hit areas aligned with the visual layout.
Calculate modern candidate window height from the same top offset used by itemRect and reserve extra bottom padding so selected candidates do not collide with the window border.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
中文
這個 PR 新增 libIME2
CandidateWindow的新版候選窗繪製能力,讓 PIME 端可以啟用較現代化、可客製化的候選窗 UI。主要內容:
recalculateSize()期間重複取得 DC 的成本English
This PR adds modern rendering support to libIME2
CandidateWindow, allowing PIME clients to opt into a more customizable candidate window UI.Highlights:
recalculateSize()Compatibility / 相容性
中文
新版 UI 需要由上層 client 明確啟用;未啟用時,既有候選窗行為應維持不變。
English
The modern UI is opt-in from the client side. Existing legacy candidate window behavior should remain unchanged when it is not enabled.
Validation / 驗證
Validated through the dependent PIME branch:
PIMETextServiceRelease build, Win32PIMETextServiceRelease build, x64