fix: embed spin button and warning icons on non-linux systems

This commit is contained in:
Mia McMahill 2025-05-16 10:00:35 -05:00 committed by GitHub
parent c42b8ff5a5
commit d4a87bd394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 40 additions and 35 deletions

View file

@ -33,11 +33,21 @@ impl<'a, Message: 'static + Clone> Warning<'a, Message> {
pub fn into_widget(self) -> widget::Container<'a, Message, crate::Theme, Renderer> {
let label = widget::container(crate::widget::text(self.message)).width(Length::Fill);
#[cfg(target_os = "linux")]
let close_button = icon::from_name("window-close-symbolic")
.size(16)
.apply(widget::button::icon)
.on_press_maybe(self.on_close);
#[cfg(not(target_os = "linux"))]
let close_button = icon::from_svg_bytes(
include_bytes!("../../res/icons/window-close-symbolic.svg")
)
.symbolic(true)
.apply(widget::button::icon)
.icon_size(16)
.on_press_maybe(self.on_close);
widget::row::with_capacity(2)
.push(label)
.push(close_button)