Preedit 和 CandidateList 的 UI 更新是合并的? #657
Unanswered
qingxiang-jia
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
因为我的情况是候选词是从网络上来的, 所以延迟比较大. 我想让感官上的延迟小一点, 思路是用户打了字, 马上就更新 preedit (这样打字的时候, preedit 的出现理论上不会有延迟), 然后异步地做网络请求. 等候选词来了之后再 populate candidate list.
所以每次有输入的时候, 我都 updatePreedit() 然后 updateUserInterface(). 等 candidate list 被 populate 之后我再 updateUserInterface() 一次.
但是我的观察是, preedit 的 UI update 似乎会等待 candidate 的, 一个表现就是, 当候选词请求了还没到的时候, preedit 其实也没上屏, 他们俩似乎总是同时出现在 UI 上. 不知道是不是可以这样设计的. 如果是的话, 我觉得办法也有, 就是重用 candidate list: 每次有用户输入的时候, 立马 populate candidate list, 显示一个 loading 符号啥的, 就跟现在的 cloud pinyin 那个单独的候选词一样, 然后有了真正的候选词之后再更新 candidate list.
Update: 具体更新 UI 的代码在这里: https://github.com/qingxiang-jia/full-cloud-pinyin/blob/97a29ff3fd028f9ca4cacb5c073b8f47c325244b/fcitx5/src/quwei.cpp#L199
Update: 试了一下, 貌似的确是这样的: qingxiang-jia/full-cloud-pinyin@728fb51
谢谢
Beta Was this translation helpful? Give feedback.
All reactions