fix(dropdown): styling
This commit is contained in:
parent
2d06ec4226
commit
58fc034459
5 changed files with 50 additions and 69 deletions
|
|
@ -156,21 +156,21 @@ impl<'a, Message: 'a> Overlay<'a, Message> {
|
|||
style,
|
||||
} = menu;
|
||||
|
||||
let mut container = Container::new(Scrollable::new(List {
|
||||
options,
|
||||
icons,
|
||||
hovered_option,
|
||||
selected_option,
|
||||
on_selected,
|
||||
on_option_hovered,
|
||||
text_size,
|
||||
text_line_height,
|
||||
padding,
|
||||
}));
|
||||
|
||||
container = container
|
||||
.padding(padding)
|
||||
.class(crate::style::Container::Dropdown);
|
||||
let mut container = Container::new(Scrollable::new(
|
||||
Container::new(List {
|
||||
options,
|
||||
icons,
|
||||
hovered_option,
|
||||
selected_option,
|
||||
on_selected,
|
||||
on_option_hovered,
|
||||
text_size,
|
||||
text_line_height,
|
||||
padding,
|
||||
})
|
||||
.padding(padding),
|
||||
))
|
||||
.class(crate::style::Container::Dropdown);
|
||||
|
||||
state.tree.diff(&mut container as &mut dyn Widget<_, _, _>);
|
||||
|
||||
|
|
|
|||
|
|
@ -152,20 +152,20 @@ impl<'a, Message: 'a> Overlay<'a, Message> {
|
|||
style,
|
||||
} = menu;
|
||||
|
||||
let mut container = Container::new(Scrollable::new(InnerList {
|
||||
options,
|
||||
hovered_option,
|
||||
selected_option,
|
||||
on_selected,
|
||||
on_option_hovered,
|
||||
padding,
|
||||
text_size,
|
||||
text_line_height,
|
||||
}));
|
||||
|
||||
container = container
|
||||
.padding(padding)
|
||||
.class(crate::style::Container::Dropdown);
|
||||
let mut container = Container::new(Scrollable::new(
|
||||
Container::new(InnerList {
|
||||
options,
|
||||
hovered_option,
|
||||
selected_option,
|
||||
on_selected,
|
||||
on_option_hovered,
|
||||
padding,
|
||||
text_size,
|
||||
text_line_height,
|
||||
})
|
||||
.padding(padding),
|
||||
))
|
||||
.class(crate::style::Container::Dropdown);
|
||||
|
||||
state.tree.diff(&mut container as &mut dyn Widget<_, _, _>);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ pub fn header_bar<'a, Message>() -> HeaderBar<'a, Message> {
|
|||
center: Vec::new(),
|
||||
end: Vec::new(),
|
||||
density: None,
|
||||
horizontal_padding: 8,
|
||||
focused: false,
|
||||
on_double_click: None,
|
||||
}
|
||||
|
|
@ -75,9 +74,6 @@ pub struct HeaderBar<'a, Message> {
|
|||
#[setters(strip_option)]
|
||||
density: Option<Density>,
|
||||
|
||||
/// Horizontal padding of the headerbar
|
||||
horizontal_padding: u16,
|
||||
|
||||
/// Focused state of the window
|
||||
focused: bool,
|
||||
}
|
||||
|
|
@ -346,7 +342,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
|||
)
|
||||
.align_y(iced::Alignment::Center)
|
||||
.height(Length::Fixed(height))
|
||||
.padding([0, self.horizontal_padding])
|
||||
.padding([0, 8])
|
||||
.spacing(8)
|
||||
.apply(widget::container)
|
||||
.class(crate::theme::Container::HeaderBar {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue