chore: update iced
This commit is contained in:
parent
b7aed0e4d6
commit
2a1af3a24f
4 changed files with 18 additions and 18 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1a25f501d02f545f0989cf13e2bd4cac5d8d520f
|
Subproject commit 70d104a28a87f06eb46d76268b6fa18c407ee2c2
|
||||||
|
|
@ -15,14 +15,14 @@ pub fn calendar<M>(
|
||||||
on_select: impl Fn(NaiveDate) -> M + 'static,
|
on_select: impl Fn(NaiveDate) -> M + 'static,
|
||||||
on_prev: impl Fn() -> M + 'static,
|
on_prev: impl Fn() -> M + 'static,
|
||||||
on_next: impl Fn() -> M + 'static,
|
on_next: impl Fn() -> M + 'static,
|
||||||
first_day_of_week: Weekday
|
first_day_of_week: Weekday,
|
||||||
) -> Calendar<M> {
|
) -> Calendar<M> {
|
||||||
Calendar {
|
Calendar {
|
||||||
model,
|
model,
|
||||||
on_select: Box::new(on_select),
|
on_select: Box::new(on_select),
|
||||||
on_prev: Box::new(on_prev),
|
on_prev: Box::new(on_prev),
|
||||||
on_next: Box::new(on_next),
|
on_next: Box::new(on_next),
|
||||||
first_day_of_week
|
first_day_of_week,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ pub struct Calendar<'a, M> {
|
||||||
on_select: Box<dyn Fn(NaiveDate) -> M>,
|
on_select: Box<dyn Fn(NaiveDate) -> M>,
|
||||||
on_prev: Box<dyn Fn() -> M>,
|
on_prev: Box<dyn Fn() -> M>,
|
||||||
on_next: Box<dyn Fn() -> M>,
|
on_next: Box<dyn Fn() -> M>,
|
||||||
first_day_of_week: Weekday
|
first_day_of_week: Weekday,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message> From<Calendar<'a, Message>> for crate::Element<'a, Message>
|
impl<'a, Message> From<Calendar<'a, Message>> for crate::Element<'a, Message>
|
||||||
|
|
|
||||||
|
|
@ -153,13 +153,14 @@ macro_rules! make_button {
|
||||||
($spin_button:expr, $icon:expr, $operation:expr) => {{
|
($spin_button:expr, $icon:expr, $operation:expr) => {{
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let button = icon::from_name($icon);
|
let button = icon::from_name($icon);
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let button = icon::from_svg_bytes(
|
let button =
|
||||||
include_bytes!(concat!["../../res/icons/", $icon ,".svg"])
|
icon::from_svg_bytes(include_bytes!(concat!["../../res/icons/", $icon, ".svg"]))
|
||||||
).symbolic(true);
|
.symbolic(true);
|
||||||
|
|
||||||
button.apply(button::icon)
|
button
|
||||||
|
.apply(button::icon)
|
||||||
.on_press(($spin_button.on_press)($operation(
|
.on_press(($spin_button.on_press)($operation(
|
||||||
$spin_button.value,
|
$spin_button.value,
|
||||||
$spin_button.step,
|
$spin_button.step,
|
||||||
|
|
@ -252,4 +253,4 @@ mod tests {
|
||||||
fn decrement() {
|
fn decrement() {
|
||||||
assert_eq!(super::decrement(0i32, 10, 15, 35), 15);
|
assert_eq!(super::decrement(0i32, 10, 15, 35), 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,12 @@ impl<'a, Message: 'static + Clone> Warning<'a, Message> {
|
||||||
.on_press_maybe(self.on_close);
|
.on_press_maybe(self.on_close);
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let close_button = icon::from_svg_bytes(
|
let close_button =
|
||||||
include_bytes!("../../res/icons/window-close-symbolic.svg")
|
icon::from_svg_bytes(include_bytes!("../../res/icons/window-close-symbolic.svg"))
|
||||||
)
|
.symbolic(true)
|
||||||
.symbolic(true)
|
.apply(widget::button::icon)
|
||||||
.apply(widget::button::icon)
|
.icon_size(16)
|
||||||
.icon_size(16)
|
.on_press_maybe(self.on_close);
|
||||||
.on_press_maybe(self.on_close);
|
|
||||||
|
|
||||||
widget::row::with_capacity(2)
|
widget::row::with_capacity(2)
|
||||||
.push(label)
|
.push(label)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue