Skip to main content

euv_ui/component/avatar/view/
impl.rs

1use super::*;
2
3/// Inherent implementation of [`EuvAvatarSize`].
4impl EuvAvatarSize {
5    /// Returns the square edge length in pixels for this size.
6    ///
7    /// # Returns
8    ///
9    /// - `i32` - The edge length in pixels: 24 for `Small`, 32 for `Medium`,
10    ///   40 for `Large`.
11    pub fn px(&self) -> i32 {
12        match self {
13            EuvAvatarSize::Small => 24,
14            EuvAvatarSize::Medium => 32,
15            EuvAvatarSize::Large => 40,
16        }
17    }
18}