Skip to content

优化下载页面依赖项展示#5872

Open
CiiLu wants to merge 3 commits intoHMCL-dev:mainfrom
CiiLu:awawawawa
Open

优化下载页面依赖项展示#5872
CiiLu wants to merge 3 commits intoHMCL-dev:mainfrom
CiiLu:awawawawa

Conversation

@CiiLu
Copy link
Copy Markdown
Contributor

@CiiLu CiiLu commented Mar 28, 2026

8388c833-16fe-4eda-a4d0-be3d9c7f73b4 1e8e998f-7aaa-4076-a8ff-befaa0154818

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 旨在优化“下载页面/版本详情弹窗”中依赖项(Dependency)列表的展示与交互,使依赖项条目使用统一的行按钮组件(LineButton)来承载布局与点击反馈。

Changes:

  • 将依赖项条目 DependencyModItemStackPane 改为继承 LineButton,以复用行按钮样式/水波纹交互容器
  • 调整依赖项条目的点击绑定与节点装配方式(由 RipplerContainer 包裹改为直接装配到 LineButton 的节点体系中)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


RipplerContainer container = new RipplerContainer(pane);
FXUtils.onClicked(container, () -> {
FXUtils.onClicked(pane, () -> {
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pane is set to mouseTransparent(true) but the click handler is registered on pane via FXUtils.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 the DependencyModItem/LineButton itself (e.g., setOnAction(...) or FXUtils.onClicked(this, ...)) and keep inner content mouse-transparent, or remove pane.setMouseTransparent(true) if you really want pane to handle the click.

Suggested change
FXUtils.onClicked(pane, () -> {
FXUtils.onClicked(this, () -> {

Copilot uses AI. Check for mistakes.
Controllers.navigate(new DownloadPage(page, addon, version, callback));
});
getChildren().setAll(container);
setNode(IDX_LEADING, pane);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DependencyModItem extends LineButton, but the custom pane is inserted at IDX_LEADING. LineComponent already has an internal title container at IDX_TITLE with HBox.setHgrow(..., ALWAYS), so keeping it alongside your pane can leave a large empty area and prevent your TwoLineListItem from expanding to full width. Consider replacing the title node instead (use setNode(IDX_TITLE, pane) or setTitle/setSubtitle APIs) so the dependency row lays out correctly.

Suggested change
setNode(IDX_LEADING, pane);
setNode(IDX_TITLE, pane);

Copilot uses AI. Check for mistakes.
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Mar 29, 2026

image

修改后涟漪溢出边界了。

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Mar 30, 2026

image

涟漪问题还在,而且有些时候会让这里冒出横向滚动条。

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants