mobile: don't add hover on mobile
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -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,28 +207,32 @@ 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();
|
||||||
|
|
||||||
let (rect, size) = ui::anim::hover_expand(
|
if is_mobile(ui.ctx()) {
|
||||||
ui,
|
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
|
||||||
egui::Id::new(ProfileAnimId {
|
} else {
|
||||||
profile_key,
|
let (rect, size) = ui::anim::hover_expand(
|
||||||
note_key,
|
ui,
|
||||||
}),
|
egui::Id::new(ProfileAnimId {
|
||||||
ui::ProfilePic::default_size(),
|
profile_key,
|
||||||
expand_size,
|
note_key,
|
||||||
anim_speed,
|
}),
|
||||||
);
|
ui::ProfilePic::default_size(),
|
||||||
|
expand_size,
|
||||||
|
anim_speed,
|
||||||
|
);
|
||||||
|
|
||||||
ui.put(
|
ui.put(
|
||||||
rect,
|
rect,
|
||||||
ui::ProfilePic::new(&mut self.app.img_cache, pic).size(size),
|
ui::ProfilePic::new(&mut self.app.img_cache, pic).size(size),
|
||||||
)
|
)
|
||||||
.on_hover_ui_at_pointer(|ui| {
|
.on_hover_ui_at_pointer(|ui| {
|
||||||
ui.set_max_width(300.0);
|
ui.set_max_width(300.0);
|
||||||
ui.add(ui::ProfilePreview::new(
|
ui.add(ui::ProfilePreview::new(
|
||||||
profile.as_ref().unwrap(),
|
profile.as_ref().unwrap(),
|
||||||
&mut self.app.img_cache,
|
&mut self.app.img_cache,
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
ui.add(ui::ProfilePic::new(
|
ui.add(ui::ProfilePic::new(
|
||||||
|
|||||||
Reference in New Issue
Block a user