Misc · Time: clocks and a stopwatch

misc::Clock shows the time in a zone, the system's unless told, as an
analog face with hour marks and three hands over its digits and a
label; it wakes its view at each whole second of the wall clock, and
only while the owner passes no moment. misc::WorldClock lays places in
rows: a small face, the place, how its day and hour stand against home,
and its time. misc::Stopwatch runs on the executor's clock in tenths,
holds while paused, marks laps while running and clears once paused;
Start and Pause share one button and its focus.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 23:51:58 -04:00
1 parent 4777cd666b
commit 45ae161c18
11 files changed
+790 -2

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
use gpui::Rems;
use super::{Theme, tokens::px_to_rems};
/// The misc chapter's measures.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MiscSizes {
/// A clock's face.
pub face: Rems,
/// A world clock row's face.
pub small_face: Rems,
}
impl Theme {
pub fn misc(&self) -> MiscSizes {
MiscSizes {
face: px_to_rems(112.0),
small_face: px_to_rems(32.0),
}
}
}
+2
View File
@@ -8,6 +8,7 @@ mod interaction;
mod maps;
mod media;
mod messaging;
mod misc;
mod onboarding;
mod palette;
mod platform;
@@ -33,6 +34,7 @@ pub use interaction::InteractionSizes;
pub use maps::MapSizes;
pub use media::MediaSizes;
pub use messaging::MessagingSizes;
pub use misc::MiscSizes;
pub use onboarding::OnboardingSizes;
pub use palette::{HUE_NAMES, Mix, Palette, Syntax};
pub use platform::Platform;