Skip to content

Commit

Permalink
fix(toggler): remove extra padding
Browse files Browse the repository at this point in the history
  • Loading branch information
git-f0x committed Nov 27, 2024
1 parent a6db807 commit ebb0f4b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,30 @@ impl<App: Application> ApplicationExt for 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 {
None
Expand Down
1 change: 1 addition & 0 deletions src/widget/toggler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ where
{
widget::Toggler::new(is_checked)
.size(24)
.spacing(0)
.width(Length::Shrink)
}

0 comments on commit ebb0f4b

Please sign in to comment.