mobile: don't add hover on mobile

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-04-29 12:48:26 -07:00
parent a173e38141
commit 632e5b89d1

View File

@@ -4,7 +4,7 @@ pub mod options;
pub use contents::NoteContents; pub use contents::NoteContents;
pub use options::NoteOptions; pub use options::NoteOptions;
use crate::{colors, ui, Damus}; use crate::{colors, ui, ui::is_mobile, Damus};
use egui::{Label, RichText, Sense}; use egui::{Label, RichText, Sense};
use nostrdb::{NoteKey, Transaction}; use nostrdb::{NoteKey, Transaction};
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
@@ -207,6 +207,9 @@ impl<'a> Note<'a> {
let profile_key = profile.as_ref().unwrap().record().note_key(); let profile_key = profile.as_ref().unwrap().record().note_key();
let note_key = note_key.as_u64(); let note_key = note_key.as_u64();
if is_mobile(ui.ctx()) {
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
} else {
let (rect, size) = ui::anim::hover_expand( let (rect, size) = ui::anim::hover_expand(
ui, ui,
egui::Id::new(ProfileAnimId { egui::Id::new(ProfileAnimId {
@@ -230,6 +233,7 @@ impl<'a> Note<'a> {
)); ));
}); });
} }
}
None => { None => {
ui.add(ui::ProfilePic::new( ui.add(ui::ProfilePic::new(
&mut self.app.img_cache, &mut self.app.img_cache,