fix: window controls on linux not clickable
This commit is contained in:
parent
716b3dee56
commit
9e344b15c3
1 changed files with 10 additions and 10 deletions
|
|
@ -361,22 +361,22 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
||||||
macro_rules! icon {
|
macro_rules! icon {
|
||||||
($name:expr, $size:expr, $on_press:expr) => {{
|
($name:expr, $size:expr, $on_press:expr) => {{
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
let icon = { widget::icon::from_name($name).apply(widget::button::icon) };
|
||||||
widget::icon::from_name($name).apply(widget::button::icon)
|
|
||||||
}
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
{
|
let icon = {
|
||||||
widget::icon::from_svg_bytes(include_bytes!(concat!(
|
widget::icon::from_svg_bytes(include_bytes!(concat!(
|
||||||
"../../res/icons/",
|
"../../res/icons/",
|
||||||
$name,
|
$name,
|
||||||
".svg"
|
".svg"
|
||||||
)))
|
)))
|
||||||
.apply(widget::button::icon)
|
.apply(widget::button::icon)
|
||||||
}
|
};
|
||||||
.style(crate::theme::Button::HeaderBar)
|
|
||||||
.selected(self.focused)
|
icon.style(crate::theme::Button::HeaderBar)
|
||||||
.icon_size($size)
|
.selected(self.focused)
|
||||||
.on_press($on_press)
|
.icon_size($size)
|
||||||
|
.on_press($on_press)
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,7 +391,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
||||||
.push_maybe(
|
.push_maybe(
|
||||||
self.on_minimize
|
self.on_minimize
|
||||||
.take()
|
.take()
|
||||||
.map(|m| icon!("window-minimize-symbolic", 16, m)),
|
.map(|m: Message| icon!("window-minimize-symbolic", 16, m)),
|
||||||
)
|
)
|
||||||
.push_maybe(
|
.push_maybe(
|
||||||
self.on_maximize
|
self.on_maximize
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue