actionbar: remove border on reply button, add expand animation

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-06-13 09:36:53 -07:00
parent db1642bc31
commit c4e0c710c9
3 changed files with 29 additions and 17 deletions

View File

@@ -4,16 +4,16 @@ pub fn hover_expand(
size: f32,
expand_size: f32,
anim_speed: f32,
) -> (egui::Rect, f32) {
) -> (egui::Rect, f32, egui::Response) {
// Allocate space for the profile picture with a fixed size
let default_size = size + expand_size;
let (rect, response) =
ui.allocate_exact_size(egui::vec2(default_size, default_size), egui::Sense::hover());
ui.allocate_exact_size(egui::vec2(default_size, default_size), egui::Sense::click());
let val = ui
.ctx()
.animate_bool_with_time(id, response.hovered(), anim_speed);
let size = size + val * expand_size;
(rect, size)
(rect, size, response)
}