euv_ui/component/icon/view/impl.rs
1use super::*;
2
3impl EuvIconSize {
4 /// Returns the glyph edge length in pixels for this size.
5 ///
6 /// # Returns
7 ///
8 /// - `i32` - The edge length in pixels: 12 for `Xs`, 16 for `Sm`, 20 for
9 /// `Md`, 24 for `Lg`, 32 for `Xl`.
10 pub fn px(&self) -> i32 {
11 match self {
12 EuvIconSize::Xs => 12,
13 EuvIconSize::Sm => 16,
14 EuvIconSize::Md => 20,
15 EuvIconSize::Lg => 24,
16 EuvIconSize::Xl => 32,
17 }
18 }
19}