[WrapPanel] Add Spacing Properties#18079
[WrapPanel] Add Spacing Properties#18079MrJul merged 7 commits intoAvaloniaUI:masterfrom Poker-sang:feat/wrappanel-spacing
Conversation
|
You can test this PR using the following package version. |
|
In the UWP/WinUI community toolkit naming if these properties was discussed and decided as https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/wrappanel#properties Horizontal/Vertical terminology is more general-purpose (can apply to other controls) and fits well with existing properties for alignment. |
|
@robloo I was going to use that name, but after careful consideration I realized:
So after weighing them, I choose to use |
|
@Poker-sang You've thought this through more than I thought and more than what was decided in the toolkit. I think the logic for your point 1 above is the strongest argument. With controls that have an orientation property -- itself with horizontal/vertical -- that is a complication. It would be nice to be able to set the Spacing and just have it work and make sense for all orientations. Let me think about this a bit more. I suspect you're right though. |
|
@robloo I was also like you at the beginning but am mostly sold on it for this control. Take StackPanel, it has only Spacing and will lead to the same results regardless of the orientation. That should be the same here imo. But the team also needs to agree on it |
|
I'm basically sold that we shouldn't be using H/V Spacing terminology for the above mentioned reasons. Additional thoughts I've had on naming these properties are:
So bottom line, we could align with existing controls/properties more if we changed the wording:
Edit: On second thought, "Row" does have an orientation implied. "Line" might make more sense for both orientations as a line could either be horizontal or vertical. |
|
Public API for review: namespace Avalonia.Controls
{
public class WrapPanel : Panel
{
+ public static readonly StyledProperty<double> ItemSpacingProperty;
+ public static readonly StyledProperty<double> LineSpacingProperty;
+ public double ItemSpacing { get; set; }
+ public double LineSpacing { get; set; }
}
} |
|
During the API review session, we were hesitating between At the end of the day, |
|
@MrJul Yea, it kind-of fell in the middle and terminology wasn't exactly clear. I trust the debate you had. Out of Curiosity did you discuss |
|
You can test this PR using the following package version. |
|
I cant run the project now after it updated to main🥺 |
Probably the submodules move from #18431. Sorry, it was a necessary pain. If git complains about not being able to remove some directories, or if you've got duplicated symbol errors when building, clean your working directory and all submodules: |
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
What does the pull request do?
Add ItemSpacing and LineSpacing Properties for WrapPanel
What is the current behavior?
WrapPanel has no spacing properties
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues