1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
use iced::widget::svg;
use iced::widget::{svg::Handle, Svg};
use iced::Element;
pub enum Icon {
AddContact24,
Attachment24,
Away16,
Away16Color,
Bubble16,
Bubble16Color,
Bubble24,
Contact24,
Delivered16,
Dnd16,
Dnd16Color,
Error16Color,
Forward24,
Heart24,
NewBubble24,
Reply24,
Sending16,
Sent16,
}
impl From<Icon> for Svg<'_> {
fn from(value: Icon) -> Self {
match value {
Icon::AddContact24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/addcontact24.svg"
)))
.width(24)
.height(24),
Icon::Attachment24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/attachment24.svg"
)))
.width(24)
.height(24),
Icon::Away16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/away16.svg"
)))
.width(16)
.height(16),
Icon::Away16Color => svg(Handle::from_memory(include_bytes!(
"../assets/icons/away16color.svg"
)))
.width(16)
.height(16),
Icon::Bubble16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/bubble16.svg"
)))
.width(16)
.height(16),
Icon::Bubble16Color => svg(Handle::from_memory(include_bytes!(
"../assets/icons/bubble16color.svg"
)))
.width(16)
.height(16),
Icon::Bubble24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/bubble24.svg"
)))
.width(24)
.height(24),
Icon::Contact24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/contact24.svg"
)))
.width(24)
.height(24),
Icon::Delivered16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/delivered16.svg"
)))
.width(16)
.height(16),
Icon::Dnd16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/dnd16.svg"
)))
.width(16)
.height(16),
Icon::Dnd16Color => svg(Handle::from_memory(include_bytes!(
"../assets/icons/dnd16color.svg"
)))
.width(16)
.height(16),
Icon::Error16Color => svg(Handle::from_memory(include_bytes!(
"../assets/icons/error16color.svg"
)))
.width(16)
.height(16),
Icon::Forward24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/forward24.svg"
)))
.width(24)
.height(24),
Icon::Heart24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/heart24.svg"
)))
.width(24)
.height(24),
Icon::NewBubble24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/newbubble24.svg"
)))
.width(24)
.height(24),
Icon::Reply24 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/reply24.svg"
)))
.width(24)
.height(24),
Icon::Sending16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/sending16.svg"
)))
.width(16)
.height(16),
Icon::Sent16 => svg(Handle::from_memory(include_bytes!(
"../assets/icons/sent16.svg"
)))
.width(16)
.height(16),
}
}
}
impl<Message> From<Icon> for Element<'_, Message> {
fn from(value: Icon) -> Self {
Into::<Svg>::into(value).into()
}
}
|