This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch eo-api-finalize
in repository ego.

View the commit online.

commit 60f524bc4f992c60d602d4a2224afdc3f31fefb7
Author: Cedric Bail <[email protected]>
AuthorDate: Thu Nov 26 12:01:19 2026 -0600

    ui: a factory with a bound style is tested to resolve with its items
    
    A widget factory whose style is bound to a model property resolved
    its future with an array of Eina_Value instead of the items, and
    create_with_event crashed on it. That is fixed in EFL ("elementary:
    a factory bound to a style resolves with its items"); this test
    needs an EFL that has it.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
---
 efl/ui/future_test.go | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/efl/ui/future_test.go b/efl/ui/future_test.go
index af020bfd..7a325bfe 100644
--- a/efl/ui/future_test.go
+++ b/efl/ui/future_test.go
@@ -9,6 +9,7 @@ import (
 	"git.enlightenment.org/cedric/ego/efl/eo"
 	"git.enlightenment.org/cedric/ego/efl/ui"
 	"git.enlightenment.org/cedric/ego/efl/ui/layoutfactory"
+	"git.enlightenment.org/cedric/ego/efl/ui/widgetfactory"
 	"git.enlightenment.org/cedric/ego/efl/ui/win"
 )
 
@@ -51,6 +52,62 @@ func TestFactoryCreateFuture(t *testing.T) {
 	})
 }
 
+// A factory whose style comes from the model waits for it, and still
+// resolves with the items it made.
+func TestFactoryCreateFutureWithBoundStyle(t *testing.T) {
+	var w *ui.Win
+	var items *efl.Future[[]*efl.Object]
+	efl.Sync(func() {
+		var err error
+		if w, err = ui.NewWin(nil, win.WithWinName("styled-factory-future")); err != nil {
+			t.Error(err)
+			return
+		}
+		models := efl.Must(eo.NewGenericModel(w))
+		rows := []efl.Objecter{models.ChildAdd(), models.ChildAdd()}
+		for _, row := range rows {
+			model, ok := eo.AsModel(row)
+			if !ok {
+				t.Error("a child of a generic model is not a model")
+				return
+			}
+			style := efl.Must(efl.NewValue("anchor"))
+			model.SetProperty("the_style", style)
+			style.Free()
+		}
+		factory := efl.Must(ui.NewWidgetFactory(w, widgetfactory.WithItemClass(ui.ButtonClass())))
+		factory.PropertyBind("style", "the_style")
+		asFactory, _ := ui.AsFactory(factory)
+		items = ui.CreateWithEvent(asFactory, rows)
+	})
+	if items == nil {
+		t.FailNow()
+	}
+	defer efl.Sync(func() { w.Del() })
+
+	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+	defer cancel()
+	made, err := items.Await(ctx)
+	if err != nil {
+		t.Fatal(err)
+	}
+	efl.Sync(func() {
+		if len(made) != 2 {
+			t.Errorf("%d items, want 2", len(made))
+		}
+		for _, item := range made {
+			styled, ok := ui.AsButton(item)
+			if !ok {
+				t.Errorf("%s is not a button", efl.ClassName(item))
+				continue
+			}
+			if got := styled.Style(); got != "anchor" {
+				t.Errorf("style %q, want anchor", got)
+			}
+		}
+	})
+}
+
 // A future of content: what was put on the clipboard.
 func TestSelectionGetFuture(t *testing.T) {
 	const kind = "text/plain;charset=utf-8"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to