mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
menu_view: change voffset of button immediately
This patch changes the button widget to apply the vertical offset to its child widgets at draw time, not at the layout phase. This way, the visual feedback on button press/release changes is more direct because it sidesteps the geometry animation.
This commit is contained in:
parent
1af6bd1454
commit
5958fe0a69
@ -83,13 +83,10 @@ struct Menu_view::Button_widget : Widget, Animator::Item
|
||||
|
||||
_update_children(node);
|
||||
|
||||
bool const dy = selected ? 1 : 0;
|
||||
|
||||
_children.for_each([&] (Widget &child) {
|
||||
child.geometry(Rect(Point(margin.left + padding.left,
|
||||
margin.top + padding.top + dy),
|
||||
child.min_size()));
|
||||
});
|
||||
margin.top + padding.top),
|
||||
child.min_size())); });
|
||||
}
|
||||
|
||||
Area min_size() const override
|
||||
@ -137,6 +134,9 @@ struct Menu_view::Button_widget : Widget, Animator::Item
|
||||
Icon_painter::paint(alpha_surface, Rect(at, _animated_geometry.area()),
|
||||
scratch.texture(), 255);
|
||||
|
||||
if (selected)
|
||||
at = at + Point(0, 1);
|
||||
|
||||
_draw_children(pixel_surface, alpha_surface, at);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user