commit 80982059fc213edca90271d4bd70271d91b768c3
parent 59dec0c066d0821441ed38a837c90e3388589590
Author: William Casarin <jb55@jb55.com>
Date: Tue, 17 Dec 2024 12:32:15 -0800
ui: fix repost button size
triggering ocd
Changelog-Fixed: Fix repost button size
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/crates/notedeck_columns/src/ui/note/mod.rs b/crates/notedeck_columns/src/ui/note/mod.rs
@@ -716,11 +716,14 @@ fn repost_icon(dark_mode: bool) -> egui::Image<'static> {
}
fn quote_repost_button(ui: &mut egui::Ui, note_key: NoteKey) -> egui::Response {
- let (rect, size, resp) =
- ui::anim::hover_expand_small(ui, ui.id().with(("repost_anim", note_key)));
-
+ let size = 14.0;
let expand_size = 5.0;
- let rect = rect.translate(egui::vec2(-(expand_size / 2.0), 0.0));
+ let anim_speed = 0.05;
+ let id = ui.id().with(("repost_anim", note_key));
+
+ let (rect, size, resp) = ui::anim::hover_expand(ui, id, size, expand_size, anim_speed);
+
+ let rect = rect.translate(egui::vec2(-(expand_size / 2.0), -1.0));
let put_resp = ui.put(rect, repost_icon(ui.visuals().dark_mode).max_width(size));