Skip to content

Commit

Permalink
fix(shell): animation
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Feb 4, 2025
1 parent 0b77b51 commit ca761b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/shell/contextmenu/menu_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ std::pair<float, float> mb_shell::mouse_menu_widget_main::calculate_position(
auto bottom_overflow = y + menu_height * ctx.rt.dpi_scale >
ctx.screen.height - padding_horizontal;

if (menu_height * ctx.rt.dpi_scale > ctx.screen.height - padding_horizontal * 2) {
if (menu_height * ctx.rt.dpi_scale >
ctx.screen.height - padding_horizontal * 2) {
y = padding_horizontal;
menu_wid->max_height = ctx.screen.height - padding_horizontal * 2;
} else if (top_overflow) {
Expand Down Expand Up @@ -717,6 +718,8 @@ void mb_shell::menu_item_parent_widget::update(ui::update_context &ctx) {
}
void mb_shell::menu_item_parent_widget::reset_appear_animation(float delay) {
y->set_easing(ui::easing_type::mutation);
for (auto &child : get_children<menu_item_widget>())
child->reset_appear_animation(delay);
x->reset_to(-20);
x->animate_to(0);
opacity->reset_to(0);
opacity->animate_to(255);
}

0 comments on commit ca761b7

Please sign in to comment.