blob: 80d6d590c2e91c1a7eb98a4942b5c0785e0619a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
use iced::Element;
use crate::gui::components::button;
use super::{Message, Navigation};
impl<'a, TOption> Navigation<TOption>
where
TOption: Clone + PartialEq + 'a,
Element<'a, Message<TOption>>: From<&'a TOption>,
{
pub(super) fn view_navigation_button(
&'a self,
option: &'a TOption,
) -> Element<'a, Message<TOption>> {
let focus = self
.active_option
.as_ref()
.is_some_and(|o| TOption::eq(o, option));
button(option, Message::ActivateOption(option.clone()), focus).into()
}
}
|