Refactor: results expose Element as a named field

Every component result type now names its element Element instead of
embedding *ui.Element. The eleven element-plus-changed results
(AccordionView, CarouselView, CollapsibleView, ImageViewerView,
PaginationResult, StepsResult, SidebarResult, TabsResult, RatingParts,
FileDropZoneParts, TransferParts) fold into ChoiceResult.

Fixes four Gallery demos where .Width(...).Changed() read the element's
flag instead of the component's: Accordion, MultiSelect, Cascader,
TreeSelect. TestDataAccordionDemoLogsChange covers the Accordion.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 13:35:53 -04:00
1 parent 078dcab8b4
commit 8880865021
73 files changed
+163 -245

No files matched your search

+3 -3
View File
@@ -20,7 +20,7 @@ func (h *carouselHarness) view(c *ui.Context) {
v := Carousel(c, &h.index, 4, h.opts, func(i int) {
ui.Text(c, fmt.Sprintf("Window %d", i+1)).Padding(20)
})
v.Grow(1)
v.Element.Grow(1)
if v.Changed() {
h.changes++
}
@@ -126,7 +126,7 @@ func TestCarouselSnapshot(t *testing.T) {
ui.Column(c).Grow(1).Center().Children(func() {
ui.Text(c, fmt.Sprintf("Rose window %d", n+1)).FontSize(FontSize(c, 18))
})
}).Grow(1)
}).Element.Grow(1)
})
})
}
@@ -135,7 +135,7 @@ func TestCarouselEmptyAutoplayKeys(t *testing.T) {
index := 0
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
Carousel(c, &index, 0, CarouselOptions{Autoplay: true}, func(int) {}).Size(300, 200)
Carousel(c, &index, 0, CarouselOptions{Autoplay: true}, func(int) {}).Element.Size(300, 200)
}, 320, 240)
for range 4 {
tt.Key(0, ui.KeyTab)