Wire up style to PickList and overlay::Menu
This commit is contained in:
parent
687c35e052
commit
fe4dfeafdb
4 changed files with 30 additions and 87 deletions
|
|
@ -1,26 +1,9 @@
|
|||
//! Display a dropdown list of selectable values.
|
||||
use crate::backend::{self, Backend};
|
||||
use crate::Renderer;
|
||||
|
||||
use iced_native::Padding;
|
||||
use iced_style::menu;
|
||||
|
||||
pub use iced_native::pick_list::State;
|
||||
pub use iced_style::pick_list::{Style, StyleSheet};
|
||||
|
||||
/// A widget allowing the selection of a single value from a list of options.
|
||||
pub type PickList<'a, T, Message, Backend> =
|
||||
iced_native::PickList<'a, T, Message, Renderer<Backend>>;
|
||||
|
||||
impl<B> iced_native::pick_list::Renderer for Renderer<B>
|
||||
where
|
||||
B: Backend + backend::Text,
|
||||
{
|
||||
type Style = Box<dyn StyleSheet>;
|
||||
|
||||
const DEFAULT_PADDING: Padding = Padding::new(5);
|
||||
|
||||
fn menu_style(style: &Box<dyn StyleSheet>) -> menu::Style {
|
||||
style.menu()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue