Skip to content

实现游戏日志窗口开关自动换行#6424

Open
ZZZank wants to merge 2 commits into
HMCL-dev:mainfrom
ZZZank:logging-line-wrap
Open

实现游戏日志窗口开关自动换行#6424
ZZZank wants to merge 2 commits into
HMCL-dev:mainfrom
ZZZank:logging-line-wrap

Conversation

@ZZZank

@ZZZank ZZZank commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

自动换行目前默认值固定为开,日志窗口里可以开关,但是配置值不会持久化保存。

2026-07-17.094405.mp4
AI usage

本来是用AI写的,但是AI补丁摞补丁,写了个几百行的不知道什么出来,最后只好删了代码重新做。语言文件与wrapTextCheckBox的定义是AI生成的

EDIT: 视频演示有一处过时了,在 e675641 之后,水平滚动可以停在当前可见的最长log的右边界,而不是延伸到所有log中最长的长度

@ZZZank ZZZank changed the title 实现游戏日志窗口自动换行 实现游戏日志窗口开关自动换行 Jul 17, 2026
@github-actions github-actions Bot added the 40+ label Jul 17, 2026
@Glavo

Glavo commented Jul 17, 2026

Copy link
Copy Markdown
Member

这实现的太诡异了吧,好像也完全没处理窗口大小的变化。为什么要用这么别扭低效的方式做换行,而不是直接启用 wrapText

@github-actions github-actions Bot added 10+ and removed 40+ labels Jul 18, 2026
@Glavo

Glavo commented Jul 18, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e67564123c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +343 to +344
setMaxWidth(Region.USE_PREF_SIZE);
setPrefWidth(Region.USE_COMPUTED_SIZE);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the horizontal scrollbar when wrapping is off

When wrapTextCheckBox is unchecked, this branch lets cells become wider than the viewport, but the ListView still always has the no-horizontal-scrollbar style class from the constructor, and root.css sets that horizontal scrollbar height to 0. In unwrapped mode on a mouse/keyboard-only desktop, long log lines are clipped with no visible horizontal scroll control; toggle that style class or otherwise expose horizontal scrolling while wrapping is disabled.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants