T11b loading: progress bars and rings that glide, loading overlay, lazy load, suspense and async view, refresh and typing indicators, upload list; draw-time notifies ask for a frame
This commit is contained in:
38 files changed
+1646
-91
No files matched your search
+2
-1
@@ -240,9 +240,10 @@ pub(super) fn measure(
|
||||
write: impl Fn(&mut Open, Bounds<Pixels>) -> bool + 'static,
|
||||
) -> impl IntoElement {
|
||||
canvas(
|
||||
move |bounds, _, cx| {
|
||||
move |bounds, window, cx| {
|
||||
if state.update(cx, |open, _| write(open, bounds)) {
|
||||
state.update(cx, |_, cx| cx.notify());
|
||||
window.request_animation_frame();
|
||||
}
|
||||
},
|
||||
|_, _, _, _| {},
|
||||
|
||||
+2
-1
@@ -218,12 +218,13 @@ impl RenderOnce for PieMenu {
|
||||
.children(bubbles)
|
||||
.child(
|
||||
canvas(
|
||||
move |bounds: Bounds<Pixels>, _, cx| {
|
||||
move |bounds: Bounds<Pixels>, window, cx| {
|
||||
let center = bounds.center();
|
||||
if measure.read(cx).center != center {
|
||||
measure.update(cx, |pie, cx| {
|
||||
pie.center = center;
|
||||
cx.notify();
|
||||
window.request_animation_frame();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user