chore: audit components
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
//! The progress bar: determinate fill or an indeterminate sweep.
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
Animation, AnimationExt as _, App, ElementId, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, RenderOnce, Role, SharedString, StatefulInteractiveElement as _,
|
||||
Styled as _, Window, div, relative,
|
||||
};
|
||||
use gpui_native_theme::{ActiveTheme as _, Size};
|
||||
use gpui_native_theme::{ActiveTheme as _, PROGRESS_ANIMATION_PERIOD, Size};
|
||||
|
||||
use crate::common::Sizable;
|
||||
|
||||
/// A progress bar. With a `value` in `0..=1` it paints a determinate fill.
|
||||
#[derive(IntoElement)]
|
||||
#[must_use]
|
||||
pub struct Progress {
|
||||
id: ElementId,
|
||||
value: f32,
|
||||
@@ -97,7 +96,7 @@ impl RenderOnce for Progress {
|
||||
.bg(ramps.primary.base)
|
||||
.with_animation(
|
||||
"indeterminate",
|
||||
Animation::new(Duration::from_millis(1500))
|
||||
Animation::new(PROGRESS_ANIMATION_PERIOD)
|
||||
.repeat()
|
||||
.with_max_fps(30.),
|
||||
|pill, delta| pill.ml(relative(delta * 0.7)),
|
||||
|
||||
Reference in New Issue
Block a user