ui: add profile picture hover animation
I wanted to practice doing animation in egui, so here is a simple profile picture hover affect. When you mouse over a profile picture, it get slightly bigger. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -16,10 +16,14 @@ impl<'cache, 'url> egui::Widget for ProfilePic<'cache, 'url> {
|
||||
|
||||
impl<'cache, 'url> ProfilePic<'cache, 'url> {
|
||||
pub fn new(cache: &'cache mut ImageCache, url: &'url str) -> Self {
|
||||
let size = 32.0;
|
||||
let size = Self::default_size();
|
||||
ProfilePic { cache, url, size }
|
||||
}
|
||||
|
||||
pub fn default_size() -> f32 {
|
||||
32.0
|
||||
}
|
||||
|
||||
pub fn no_pfp_url() -> &'static str {
|
||||
"https://damus.io/img/no-profile.svg"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user