Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed May 15, 2024
1 parent 34f95f0 commit 526198d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
6 changes: 1 addition & 5 deletions src/Fabulous.Tests/APISketchTests/TestUI.Widgets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ module TestUI_Widgets =
)

static member Stack<'msg, 'marker when 'marker :> IMarker>() =
CollectionBuilder<'msg, TestStackMarker, 'marker>(
TestStackKey,
Attributes.Container.Children,
AttributesBundle(StackList.empty(), ValueNone, ValueNone)
)
CollectionBuilder<'msg, TestStackMarker, 'marker>(TestStackKey, StackList.empty(), Attributes.Container.Children)

[<Extension>]
type CollectionBuilderExtensions =
Expand Down
26 changes: 13 additions & 13 deletions src/Fabulous/Builders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -128,33 +128,33 @@ type CollectionBuilder<'msg, 'marker, 'itemMarker> =
val Attr: WidgetCollectionAttributeDefinition
val Attributes: AttributesBundle

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, attributes: AttributesBundle) =
{ WidgetKey = widgetKey
Attr = attr
Attributes = attributes }

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalars: StackList<ScalarAttribute>) =
new(widgetKey: WidgetKey, scalars: StackList<ScalarAttribute>, attr: WidgetCollectionAttributeDefinition) =
{ WidgetKey = widgetKey
Attr = attr
Attributes = AttributesBundle(scalars, ValueNone, ValueNone) }
Attributes = AttributesBundle(scalars, ValueNone, ValueNone)
Attr = attr }

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition) =
{ WidgetKey = widgetKey
Scalars = AttributesBundle(StackList.empty(), ValueNone, ValueNone)
Attributes = AttributesBundle(StackList.empty(), ValueNone, ValueNone)
Attr = attr }

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, attributes: AttributesBundle) =
{ WidgetKey = widgetKey
Attributes = attributes
Attr = attr }

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalar: ScalarAttribute) =
{ WidgetKey = widgetKey
Scalars = AttributesBundle(StackList.one scalar, ValueNone, ValueNone)
Attributes = AttributesBundle(StackList.one scalar, ValueNone, ValueNone)
Attr = attr }

new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalarA: ScalarAttribute, scalarB: ScalarAttribute) =
{ WidgetKey = widgetKey
Scalars = AttributesBundle(StackList.two(scalarA, scalarB), ValueNone, ValueNone)
Attributes = AttributesBundle(StackList.two(scalarA, scalarB), ValueNone, ValueNone)
Attr = attr }

member inline x.Run(c: Content<'msg>) =
let struct (scalars, widgets, widgetCollections) = x.Scalars
let struct (scalars, widgets, widgetCollections) = x.Attributes

let attrValue =
match MutStackArray1.toArraySlice &c.Widgets with
Expand Down Expand Up @@ -192,7 +192,7 @@ type CollectionBuilder<'msg, 'marker, 'itemMarker> =
[<EditorBrowsable(EditorBrowsableState.Never)>]
member inline x.AddScalar(attr: ScalarAttribute) =
let struct (scalarAttributes, widgetAttributes, widgetCollectionAttributes) =
x.Scalars
x.Attributes

CollectionBuilder<'msg, 'marker, 'itemMarker>(
x.WidgetKey,
Expand Down

0 comments on commit 526198d

Please sign in to comment.