-
Notifications
You must be signed in to change notification settings - Fork 848
优化下载页面依赖项展示 #5872
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
base: main
Are you sure you want to change the base?
优化下载页面依赖项展示 #5872
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -351,7 +351,7 @@ static ComponentSublist createSublist(DownloadPage control, String title, List<S | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| private static final class DependencyModItem extends StackPane { | ||||||
| private static final class DependencyModItem extends LineButton { | ||||||
| public static final EnumMap<RemoteMod.DependencyType, String> I18N_KEY = new EnumMap<>(Lang.mapOf( | ||||||
| Pair.pair(RemoteMod.DependencyType.EMBEDDED, "mods.dependency.embedded"), | ||||||
| Pair.pair(RemoteMod.DependencyType.OPTIONAL, "mods.dependency.optional"), | ||||||
|
|
@@ -367,16 +367,16 @@ private static final class DependencyModItem extends StackPane { | |||||
| pane.setPadding(new Insets(0, 8, 0, 8)); | ||||||
| pane.setAlignment(Pos.CENTER_LEFT); | ||||||
| TwoLineListItem content = new TwoLineListItem(); | ||||||
| pane.setMouseTransparent(true); | ||||||
| HBox.setHgrow(content, Priority.ALWAYS); | ||||||
| var imageView = new ImageContainer(40); | ||||||
| pane.getChildren().setAll(imageView, content); | ||||||
|
|
||||||
| RipplerContainer container = new RipplerContainer(pane); | ||||||
| FXUtils.onClicked(container, () -> { | ||||||
| FXUtils.setLimitHeight(this, 60); | ||||||
| FXUtils.onClicked(pane, () -> { | ||||||
| fireEvent(new DialogCloseEvent()); | ||||||
| Controllers.navigate(new DownloadPage(page, addon, version, callback)); | ||||||
| }); | ||||||
| getChildren().setAll(container); | ||||||
| setNode(IDX_LEADING, pane); | ||||||
|
||||||
| setNode(IDX_LEADING, pane); | |
| setNode(IDX_TITLE, pane); |
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.
paneis set tomouseTransparent(true)but the click handler is registered onpaneviaFXUtils.onClicked(pane, ...). A mouse-transparent node will never receive mouse events, so this handler won't fire and dependency items become non-clickable. Register the handler on theDependencyModItem/LineButtonitself (e.g.,setOnAction(...)orFXUtils.onClicked(this, ...)) and keep inner content mouse-transparent, or removepane.setMouseTransparent(true)if you really wantpaneto handle the click.