improv(button): specialize button for cosmic, and apply alpha to header buttons

This commit is contained in:
Michael Aaron Murphy 2024-05-17 19:08:43 +02:00 committed by Michael Murphy
parent c7dc5ab1ed
commit 1355588723
8 changed files with 138 additions and 164 deletions

View file

@ -109,24 +109,23 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
.into()
});
let button: super::Button<'a, Message, crate::Theme, crate::Renderer> =
row::with_capacity(3)
// Optional icon to place before label.
.push_maybe(leading_icon)
// Optional label between icons.
.push_maybe(label)
// Optional icon to place behind the label.
.push_maybe(trailing_icon)
.padding(builder.padding)
.width(builder.width)
.height(builder.height)
.spacing(builder.spacing)
.align_items(Alignment::Center)
.apply(button)
.padding(0)
.id(builder.id)
.on_press_maybe(builder.on_press.take())
.style(builder.style);
let button: super::Button<'a, Message> = row::with_capacity(3)
// Optional icon to place before label.
.push_maybe(leading_icon)
// Optional label between icons.
.push_maybe(label)
// Optional icon to place behind the label.
.push_maybe(trailing_icon)
.padding(builder.padding)
.width(builder.width)
.height(builder.height)
.spacing(builder.spacing)
.align_items(Alignment::Center)
.apply(button)
.padding(0)
.id(builder.id)
.on_press_maybe(builder.on_press.take())
.style(builder.style);
if builder.tooltip.is_empty() {
button.into()