fix(toggler): remove extra padding
This commit is contained in:
parent
a6db807c1b
commit
a6c08d68f9
2 changed files with 25 additions and 1 deletions
|
|
@ -882,7 +882,30 @@ impl<App: Application> ApplicationExt for App {
|
||||||
header = header.end(element.map(Message::App));
|
header = header.end(element.map(Message::App));
|
||||||
}
|
}
|
||||||
|
|
||||||
header.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
|
if content_container {
|
||||||
|
header.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
|
||||||
|
} else {
|
||||||
|
// Needed to avoid header bar corner gaps for apps without a content container
|
||||||
|
header
|
||||||
|
.apply(container)
|
||||||
|
.style(move |theme| container::Style {
|
||||||
|
background: Some(iced::Background::Color(
|
||||||
|
theme.cosmic().background.base.into(),
|
||||||
|
)),
|
||||||
|
border: iced::Border {
|
||||||
|
radius: [
|
||||||
|
theme.cosmic().radius_s()[0] - 1.0,
|
||||||
|
theme.cosmic().radius_s()[1] - 1.0,
|
||||||
|
theme.cosmic().radius_0()[2],
|
||||||
|
theme.cosmic().radius_0()[3],
|
||||||
|
]
|
||||||
|
.into(),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header")))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,6 @@ where
|
||||||
{
|
{
|
||||||
widget::Toggler::new(is_checked)
|
widget::Toggler::new(is_checked)
|
||||||
.size(24)
|
.size(24)
|
||||||
|
.spacing(0)
|
||||||
.width(Length::Shrink)
|
.width(Length::Shrink)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue