From fd5a7196b1d316e21014480c63c6f3d0346d07ce Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 6 Dec 2024 23:39:16 +0200 Subject: [PATCH] select item on dropdown build --- .../tab/item/identity/gemini/widget/form/list.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/browser/window/tab/item/identity/gemini/widget/form/list.rs b/src/app/browser/window/tab/item/identity/gemini/widget/form/list.rs index 3d449814..ceedd7ea 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget/form/list.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget/form/list.rs @@ -122,16 +122,16 @@ impl List { // Init main widget let dropdown = DropDown::builder() .model(&list_store) + .selected( + list_store + .find_with_equal_func(|item| { + item.dynamic_cast_ref::().unwrap().is_active() + }) + .unwrap(), + ) .factory(&factory) .build(); - // Select active record - dropdown.set_selected( - list_store - .find_with_equal_func(|item| item.dynamic_cast_ref::().unwrap().is_active()) - .unwrap(), - ); // @TODO panic or handle? - // Return activated `Self` Self { list_store,