ui: use proper response in wide-rendered note

This was causing hitbox issues

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-12-03 17:52:52 -08:00
parent aafddf5acb
commit 229694466a

View File

@@ -451,9 +451,11 @@ impl<'a> NoteView<'a> {
// wide design // wide design
let response = if self.options().has_wide() { let response = if self.options().has_wide() {
ui.vertical(|ui| {
ui.horizontal(|ui| { ui.horizontal(|ui| {
if self.pfp(note_key, &profile, ui).clicked() { if self.pfp(note_key, &profile, ui).clicked() {
note_action = Some(NoteAction::OpenProfile(Pubkey::new(*self.note.pubkey()))); note_action =
Some(NoteAction::OpenProfile(Pubkey::new(*self.note.pubkey())));
}; };
let size = ui.available_size(); let size = ui.available_size();
@@ -496,19 +498,21 @@ impl<'a> NoteView<'a> {
note_key, note_key,
self.options(), self.options(),
); );
let resp = ui.add(&mut contents);
ui.add(&mut contents);
if let Some(action) = contents.action() { if let Some(action) = contents.action() {
note_action = Some(*action); note_action = Some(*action);
} }
if self.options().has_actionbar() { if self.options().has_actionbar() {
if let Some(action) = render_note_actionbar(ui, self.note.id(), note_key).inner { if let Some(action) = render_note_actionbar(ui, self.note.id(), note_key).inner
{
note_action = Some(action); note_action = Some(action);
} }
} }
})
resp .response
} else { } else {
// main design // main design
ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| { ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| {