fix(style): use radius_s for nav bar toggle

This commit is contained in:
Vukašin Vojinović 2024-12-05 21:16:10 +01:00 committed by Michael Murphy
parent 75a11b3c84
commit 2d06ec4226
5 changed files with 35 additions and 27 deletions

View file

@ -22,6 +22,7 @@ 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,
}
@ -74,6 +75,9 @@ 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,
}
@ -299,7 +303,6 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
let mut end = std::mem::take(&mut self.end);
// Also packs the window controls at the very end.
end.push(widget::horizontal_space().width(Length::Fixed(12.0)).into());
end.push(self.window_controls());
let height = match self.density.unwrap_or_else(crate::config::header_size) {
@ -343,7 +346,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
)
.align_y(iced::Alignment::Center)
.height(Length::Fixed(height))
.padding([0, 8])
.padding([0, self.horizontal_padding])
.spacing(8)
.apply(widget::container)
.class(crate::theme::Container::HeaderBar {

View file

@ -20,7 +20,7 @@ pub fn nav_bar_toggle<Message>() -> NavBarToggle<Message> {
NavBarToggle {
active: false,
on_toggle: None,
class: crate::theme::Button::Text,
class: crate::theme::Button::NavToggle,
selected: false,
}
}