Skip to content

Extend VisualElement and IStyle fluent extensions#33

Merged
VPDPersonal merged 8 commits into
mainfrom
extend-visual-element-extensions
May 25, 2026
Merged

Extend VisualElement and IStyle fluent extensions#33
VPDPersonal merged 8 commits into
mainfrom
extend-visual-element-extensions

Conversation

@VPDPersonal
Copy link
Copy Markdown
Owner

@VPDPersonal VPDPersonal commented May 24, 2026

Summary

  • Add per-type SetLabel overloads for BaseField<T> covering 29 Unity types (Quaternion, AnimationCurve, Bounds, Color, Vector2/3/4, int, float, string, etc.) and reorganize into BaseFields/ subdirectory
  • Add raw-enum overloads for all StyleEnum<T> setters on IStyleExtensions and VisualElementExtensions.Style (e.g. SetFlexWrap(Wrap) alongside SetFlexWrap(StyleEnum<Wrap>))
  • Add conditional *If variants (AddChildIf, InsertChildIf, AddChildrenIf, InsertChildrenIf) for all child management methods across all collection types
  • Extend INotifyValueChanged, IStyle, BaseListView, MultiColumnListView, MultiColumnTreeView, Button, Focusable, Manipulators, ProgressBar with new fluent methods
  • Add Math-assembly SetValue extensions for float2/3/4, int2/3/4 types
  • Add editor extensions: SetLabel for PropertyField, SetBindingPath for IBindable; tighten BindPropertyTo constraint to where T : VisualElement, IBindable; rename UnbindUnbindFrom for consistency with BindTo
  • Fix SetMinSize parameter naming bug (maxHeightminHeight), null-safety in FocusableExtensions.IsFocus, and null-guard in AddStyleSheetsFromResource / RemoveStyleSheetsFromResource

Notes for review

  • The SetFlexDirection has two overloads: StyleEnum<FlexDirection> (new) and FlexDirection (existing) — these are intentionally distinct signatures, not duplicates.
  • Plugins.meta deletion and ProjectSettings.asset change are minor Unity project housekeeping included in the PR.

Add raw-enum overloads for all StyleEnum<T> setters, conditional
*If variants for child management methods, XML documentation for
new methods, and fix SetMinSize parameter naming bug.
@VPDPersonal VPDPersonal added type: feature New feature or capability status: work-in-progress Draft / not ready for review area: runtime Runtime / player code labels May 24, 2026
- Add BaseFieldExtensionsSetLabel overloads for 25 Unity types (Quaternion, AnimationCurve, Bounds, Color, Vector2/3/4, etc.) and reorganize into BaseFields/ subdirectory
- Extend IStyle, VisualElement.Style, VisualElement.Child, VisualElement.Uss, INotifyValueChanged, and list/tree view extensions with new fluent methods
- Add editor extensions: IBindable, PropertyField, EnumFlagsField; rename Unbind to UnbindFrom for consistency with BindTo
- Add Math-assembly SetValue extensions for float2/3/4, int2/3/4 types
@VPDPersonal VPDPersonal added the area: editor Editor-only code label May 24, 2026
@VPDPersonal VPDPersonal marked this pull request as ready for review May 25, 2026 09:51
@VPDPersonal VPDPersonal removed the status: work-in-progress Draft / not ready for review label May 25, 2026
@VPDPersonal VPDPersonal merged commit c0ee29f into main May 25, 2026
2 checks passed
@VPDPersonal VPDPersonal deleted the extend-visual-element-extensions branch May 25, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor Editor-only code area: runtime Runtime / player code type: feature New feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant