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:
Michael Aaron Murphy 2023-10-23 16:57:37 +02:00 committed by Michael Murphy
parent dbd6c978ba
commit ca7c17ce21
9 changed files with 1121 additions and 15 deletions

View 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)
}