feat(icon): optimize & bundle icons with crabtime for non-unix platforms
This commit is contained in:
parent
ce0868582b
commit
639326fcc3
27 changed files with 128 additions and 189 deletions
|
|
@ -449,25 +449,12 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
|||
fn window_controls(&mut self) -> Element<'a, Message> {
|
||||
macro_rules! icon {
|
||||
($name:expr, $size:expr, $on_press:expr) => {{
|
||||
#[cfg(target_os = "linux")]
|
||||
let icon = {
|
||||
widget::icon::from_name($name)
|
||||
.apply(widget::button::icon)
|
||||
.padding(8)
|
||||
};
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let icon = {
|
||||
widget::icon::from_svg_bytes(include_bytes!(concat!(
|
||||
"../../res/icons/",
|
||||
$name,
|
||||
".svg"
|
||||
)))
|
||||
.symbolic(true)
|
||||
.apply(widget::button::icon)
|
||||
.padding(8)
|
||||
};
|
||||
|
||||
icon.class(crate::theme::Button::HeaderBar)
|
||||
.selected(self.focused)
|
||||
.icon_size($size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue