feat(widget): add dropdown widget as pick_list replacement
The Dropdown widget is based on the PickList widget from iced.
This commit is contained in:
parent
dbd6c978ba
commit
ca7c17ce21
9 changed files with 1121 additions and 15 deletions
17
src/widget/dropdown/mod.rs
Normal file
17
src/widget/dropdown/mod.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// Copyright 2019 Héctor Ramón, Iced contributors
|
||||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
|
||||
pub mod menu;
|
||||
pub use menu::Menu;
|
||||
|
||||
mod widget;
|
||||
pub use widget::*;
|
||||
|
||||
pub fn dropdown<'a, S: AsRef<str>, Message: 'a>(
|
||||
selections: &'a [S],
|
||||
selected: Option<usize>,
|
||||
on_selected: impl Fn(usize) -> Message + 'a,
|
||||
) -> Dropdown<'a, S, Message> {
|
||||
Dropdown::new(selections, selected, on_selected)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue