mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
select item on dropdown build
This commit is contained in:
parent
1d5fa4febb
commit
fd5a7196b1
@ -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::<Item>().unwrap().is_active()
|
||||
})
|
||||
.unwrap(),
|
||||
)
|
||||
.factory(&factory)
|
||||
.build();
|
||||
|
||||
// Select active record
|
||||
dropdown.set_selected(
|
||||
list_store
|
||||
.find_with_equal_func(|item| item.dynamic_cast_ref::<Item>().unwrap().is_active())
|
||||
.unwrap(),
|
||||
); // @TODO panic or handle?
|
||||
|
||||
// Return activated `Self`
|
||||
Self {
|
||||
list_store,
|
||||
|
Loading…
x
Reference in New Issue
Block a user