-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
游戏下载页面添加搜索功能 #3517
游戏下载页面添加搜索功能 #3517
Conversation
toolbarPane.setContent(checkPane, ContainerAnimations.FADE); | ||
centrePane.getContent().add(0, toolbarPane); | ||
|
||
PauseTransition pause = new PauseTransition(Duration.millis(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要延时 100ms?即时显示搜索结果应该不会造成卡顿?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
解决有人短时间内频繁输入
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
搜索是个很快的过程,应该立即展示结果而不是等 0.1s,这是个肉眼可见的延迟。短时间内频繁输入也不会造成性能问题。
Hey, should this fix #3141? |
应当等待。主要的损耗在 JFX 排布 ListView 上而非搜索的逻辑层,这在模组很多的情况下较为明显
在 2025-01-02 12:52:48,"Haowei Wen" ***@***.***> 写道:
@yushijinhun commented on this pull request.
In HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java:
+
+ JFXButton searchButton = new JFXButton(i18n("search"));
+ searchButton.getStyleClass().add("jfx-tool-bar-button");
+ searchButton.setGraphic(wrap(SVG.MAGNIFY.createIcon(Theme.blackFill(), -1, -1)));
+ searchButton.setOnAction(e -> {
+ toolbarPane.setContent(searchBar, ContainerAnimations.FADE);
+ searchField.requestFocus();
+ });
+
+ checkPane.getChildren().add(checkPane.getChildren().size() - 1, searchButton);
+
+ centrePane.getContent().remove(checkPane);
+ toolbarPane.setContent(checkPane, ContainerAnimations.FADE);
+ centrePane.getContent().add(0, toolbarPane);
+
+ PauseTransition pause = new PauseTransition(Duration.millis(100));
搜索是个很快的过程,应该立即展示结果而不是等 0.1s,这是个肉眼可见的延迟。短时间内频繁输入也不会造成性能问题。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
_org.jackhuang.hmcl.Launcher_20250101153851.mp4