fix: menu folder corners

This commit is contained in:
Ashley Wulber 2026-06-29 15:47:13 -04:00 committed by Ashley Wulber
parent cad4be9401
commit a365d45091
2 changed files with 18 additions and 2 deletions

View file

@ -472,7 +472,10 @@ impl<'a, Message: 'a + Clone> Widget<Message, crate::Theme, crate::Renderer>
theme.active(state.is_focused, self.selected, &self.style)
};
if matches!(self.style, crate::theme::Button::MenuItem) {
if matches!(
self.style,
crate::theme::Button::MenuItem | crate::theme::Button::MenuFolder
) {
match theme.list_item_position {
Some((Alignment::Start, _)) => {
styling.border_radius =

View file

@ -818,13 +818,26 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
.children()
.nth(active.saturating_sub(start_index))
{
let i = active.saturating_sub(start_index);
let mut rad = styling.menu_border_radius;
let rad_0 = theme.cosmic().radius_0();
if start_index == end_index {
} else if 0 == i {
rad[0] = rad_0[0];
rad[1] = rad_0[1];
} else if i == end_index - start_index {
rad[2] = rad_0[2];
rad[3] = rad_0[3];
} else {
rad = rad_0;
}
let path_quad = renderer::Quad {
bounds: active_layout
.bounds()
.intersection(&viewport)
.unwrap_or_default(),
border: Border {
radius: styling.menu_border_radius.into(),
radius: rad.into(),
..Default::default()
},
shadow: Shadow::default(),