notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 31ec21ea02f21c546cb1ba55359363408003911e
parent d3d8d7be4b330c68631375860a4b49362ae82f00
Author: kernelkind <kernelkind@gmail.com>
Date:   Sat, 26 Jul 2025 17:44:48 -0400

mention-picker: re-add spacing from inner_margin

shouldn't do this in Frame, for some reason that captures the drag

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck_columns/src/ui/mentions_picker.rs | 18+++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/crates/notedeck_columns/src/ui/mentions_picker.rs b/crates/notedeck_columns/src/ui/mentions_picker.rs @@ -77,6 +77,7 @@ impl<'a> MentionPickerView<'a> { .show(ui, |ui| { let width = rect.width() - (2.0 * inner_margin_size); + ui.allocate_space(vec2(ui.available_width(), inner_margin_size)); let close_button_resp = { let close_button_size = 16.0; let (close_section_rect, _) = ui.allocate_exact_size( @@ -96,10 +97,10 @@ impl<'a> MentionPickerView<'a> { .inner }; - ui.add_space(8.0); + ui.allocate_space(vec2(ui.available_width(), inner_margin_size)); let scroll_resp = ScrollArea::vertical() - .max_width(width) + .max_width(rect.width()) .auto_shrink(Vec2b::FALSE) .show(ui, |ui| self.show(ui, width)); ui.advance_cursor_after_rect(rect); @@ -129,7 +130,18 @@ fn user_result<'a>( let spacing = 8.0; let body_font_size = get_font_size(ui.ctx(), &NotedeckTextStyle::Body); - let helper = AnimationHelper::new(ui, ("user_result", index), vec2(width, max_image)); + let animation_rect = { + let max_width = ui.available_width(); + let extra_width = (max_width - width) / 2.0; + let left = ui.cursor().left(); + let (rect, _) = + ui.allocate_exact_size(vec2(width + extra_width, max_image), egui::Sense::click()); + + let (_, right) = rect.split_left_right_at_x(left + extra_width); + right + }; + + let helper = AnimationHelper::new_from_rect(ui, ("user_result", index), animation_rect); let icon_rect = { let r = helper.get_animation_rect();