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>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user