Skip to content
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

添加 SimpleStackPanel:没有间距错误的轻量级 StackPanel #783

Merged
merged 9 commits into from
Dec 17, 2023

Conversation

Blinue
Copy link
Owner

@Blinue Blinue commented Dec 17, 2023

SimpleStackPanel 相比 StackPanel 有两个优势:

  1. StackPanel 对隐藏的子项也会应用间距,经常导致布局错误,这是创建 SimpleStackPanel 的主要原因。过去我们通过设置 Margin 来隐藏这个问题,现在不需要这种 hack 了。
  2. SimpleStackPanel 非常轻量,只支持三个核心属性:Orientation、Padding 和 Spacing,在几乎所有情况下,这三个属性都够用了。

鉴于 SimpleStackPanel 的优势,它是比 StackPanel 更好的替代品,应尽可能使用,除非有不得不使用 StackPanel 的理由。

这个 PR 还优化了几乎所有页面和控件的布局,但没有大的样式更改。

@Blinue Blinue added enhancement New feature or request area: UI labels Dec 17, 2023
@Blinue Blinue merged commit ca1a412 into render-system Dec 17, 2023
2 checks passed
@Blinue Blinue deleted the stack-panel-spacing branch December 17, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UI enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant