-
Notifications
You must be signed in to change notification settings - Fork 869
重构 SchematicsPage 以使用 ListCell 展示元素 #5276
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,8 +19,10 @@ | |||||
|
|
||||||
| import com.jfoenix.controls.JFXButton; | ||||||
| import com.jfoenix.controls.JFXDialogLayout; | ||||||
| import com.jfoenix.controls.JFXListView; | ||||||
| import javafx.geometry.Insets; | ||||||
| import javafx.geometry.Pos; | ||||||
| import javafx.scene.Group; | ||||||
| import javafx.scene.Node; | ||||||
| import javafx.scene.control.*; | ||||||
| import javafx.scene.image.Image; | ||||||
|
|
@@ -30,6 +32,7 @@ | |||||
| import javafx.scene.layout.BorderPane; | ||||||
| import javafx.scene.layout.HBox; | ||||||
| import javafx.scene.layout.StackPane; | ||||||
| import javafx.scene.shape.SVGPath; | ||||||
| import javafx.stage.FileChooser; | ||||||
| import org.jackhuang.hmcl.schematic.LitematicFile; | ||||||
| import org.jackhuang.hmcl.setting.Profile; | ||||||
|
|
@@ -221,7 +224,7 @@ private void navigateTo(DirItem item) { | |||||
| getItems().addAll(item.children); | ||||||
| } | ||||||
|
|
||||||
| abstract class Item extends Control implements Comparable<Item> { | ||||||
| abstract sealed class Item implements Comparable<Item> { | ||||||
|
||||||
| abstract sealed class Item implements Comparable<Item> { | |
| abstract sealed class Item implements Comparable<Item> permits BackItem, DirItem, LitematicFileItem { |
Copilot
AI
Jan 21, 2026
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.
The tooltip is being installed and uninstalled repeatedly in updateItem, which can cause memory leaks and performance issues. The tooltip should be installed once in the constructor (similar to the WorldListCell pattern at line 254 in WorldListPage.java), and only the text should be updated in updateItem. When the item is empty or has no path, set the tooltip text to an empty string instead of uninstalling it. Additionally, ensure that tooltip.setText is called in the empty branch at line 635 to clear the tooltip text when the cell is reused.
Uh oh!
There was an error while loading. Please reload this page.