Skip to content

Commit 526198d

Browse files
committed
Fix PR comments
1 parent 34f95f0 commit 526198d

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

src/Fabulous.Tests/APISketchTests/TestUI.Widgets.fs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,7 @@ module TestUI_Widgets =
155155
)
156156

157157
static member Stack<'msg, 'marker when 'marker :> IMarker>() =
158-
CollectionBuilder<'msg, TestStackMarker, 'marker>(
159-
TestStackKey,
160-
Attributes.Container.Children,
161-
AttributesBundle(StackList.empty(), ValueNone, ValueNone)
162-
)
158+
CollectionBuilder<'msg, TestStackMarker, 'marker>(TestStackKey, StackList.empty(), Attributes.Container.Children)
163159

164160
[<Extension>]
165161
type CollectionBuilderExtensions =

src/Fabulous/Builders.fs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,33 @@ type CollectionBuilder<'msg, 'marker, 'itemMarker> =
128128
val Attr: WidgetCollectionAttributeDefinition
129129
val Attributes: AttributesBundle
130130

131-
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, attributes: AttributesBundle) =
132-
{ WidgetKey = widgetKey
133-
Attr = attr
134-
Attributes = attributes }
135-
136-
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalars: StackList<ScalarAttribute>) =
131+
new(widgetKey: WidgetKey, scalars: StackList<ScalarAttribute>, attr: WidgetCollectionAttributeDefinition) =
137132
{ WidgetKey = widgetKey
138-
Attr = attr
139-
Attributes = AttributesBundle(scalars, ValueNone, ValueNone) }
133+
Attributes = AttributesBundle(scalars, ValueNone, ValueNone)
134+
Attr = attr }
140135

141136
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition) =
142137
{ WidgetKey = widgetKey
143-
Scalars = AttributesBundle(StackList.empty(), ValueNone, ValueNone)
138+
Attributes = AttributesBundle(StackList.empty(), ValueNone, ValueNone)
139+
Attr = attr }
140+
141+
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, attributes: AttributesBundle) =
142+
{ WidgetKey = widgetKey
143+
Attributes = attributes
144144
Attr = attr }
145145

146146
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalar: ScalarAttribute) =
147147
{ WidgetKey = widgetKey
148-
Scalars = AttributesBundle(StackList.one scalar, ValueNone, ValueNone)
148+
Attributes = AttributesBundle(StackList.one scalar, ValueNone, ValueNone)
149149
Attr = attr }
150150

151151
new(widgetKey: WidgetKey, attr: WidgetCollectionAttributeDefinition, scalarA: ScalarAttribute, scalarB: ScalarAttribute) =
152152
{ WidgetKey = widgetKey
153-
Scalars = AttributesBundle(StackList.two(scalarA, scalarB), ValueNone, ValueNone)
153+
Attributes = AttributesBundle(StackList.two(scalarA, scalarB), ValueNone, ValueNone)
154154
Attr = attr }
155155

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

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

197197
CollectionBuilder<'msg, 'marker, 'itemMarker>(
198198
x.WidgetKey,

0 commit comments

Comments
 (0)