fix: embed spin button and warning icons on non-linux systems
This commit is contained in:
parent
c42b8ff5a5
commit
d4a87bd394
4 changed files with 40 additions and 35 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue