Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ui: Fix scrollbar animation timing on web (#61786)

Gaauwe Rombouts97961c2a5f1e
diff --git a/Cargo.lock b/Cargo.lock
index 00c4a0d9bbd..3ae2da68989 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19868,6 +19868,7 @@ dependencies = [
"theme",
"theme_settings",
"ui_macros",
+ "web-time",
"windows 0.61.3",
]
diff --git a/crates/ui/Cargo.toml b/crates/ui/Cargo.toml
index ac9a2bbc60c..656b068d3e0 100644
--- a/crates/ui/Cargo.toml
+++ b/crates/ui/Cargo.toml
@@ -29,6 +29,7 @@ smallvec.workspace = true
strum.workspace = true
theme.workspace = true
ui_macros.workspace = true
+web-time.workspace = true
gpui_util.workspace = true
[target.'cfg(windows)'.dependencies]
diff --git a/crates/ui/src/components/scrollbar.rs b/crates/ui/src/components/scrollbar.rs
index dde9312334d..a142c439f48 100644
--- a/crates/ui/src/components/scrollbar.rs
+++ b/crates/ui/src/components/scrollbar.rs
@@ -1,9 +1,5 @@
-use std::{
- any::Any,
- fmt::Debug,
- ops::Not,
- time::{Duration, Instant},
-};
+use std::{any::Any, fmt::Debug, ops::Not, time::Duration};
+use web_time::Instant;
use gpui::{
Along, Anchor, App, AppContext as _, Axis as ScrollbarAxis, BorderStyle, Bounds, ContentMask,