mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
select item on dropdown build
This commit is contained in:
parent
1d5fa4febb
commit
fd5a7196b1
1 changed files with 7 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue