Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
add `ui_text_size` functions
Nate Butler6e11044e9ef6
diff --git a/crates/ui2/src/components/label.rs b/crates/ui2/src/components/label.rsindex dd078d23313..3346d7835a2 100644--- a/crates/ui2/src/components/label.rs+++ b/crates/ui2/src/components/label.rs@@ -1,4 +1,4 @@-use gpui::{relative, rems, Hsla, WindowContext};+use gpui::{relative, Hsla, WindowContext};use smallvec::SmallVec;use crate::prelude::*;@@ -85,7 +85,7 @@ impl Label {.bg(LabelColor::Hidden.hsla(cx)),)})- .text_size(rems(1.))+ .text_size(ui_text_default()).when(self.line_height_style == LineHeightStyle::UILabel, |this| {this.line_height(relative(1.))})diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rsindex 3f179210eb3..fc0adadb9cd 100644--- a/crates/ui2/src/prelude.rs+++ b/crates/ui2/src/prelude.rs@@ -1,3 +1,5 @@+use gpui::rems;+use gpui::Rems;pub use gpui::{div, Component, Element, ElementId, ParentElement, SharedString, StatefulInteractive,StatelessInteractive, Styled, ViewContext, WindowContext,@@ -73,6 +75,24 @@ impl std::fmt::Display for GitStatus {}}+/// The default text size for UI text+///+/// At a default 16px per rem, this is 14px.+///+/// Use [`ui_text_sm`] for smaller text.+pub fn ui_text_default() -> Rems {+ rems(0.875)+}++/// The small text size for UI text+///+/// At a default 16px per rem, this is 12px.+///+/// Use [`ui_text_default`] for regular-sized text.+pub fn ui_text_sm() -> Rems {+ rems(0.75)+}+#[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, EnumIter)]pub enum DiagnosticStatus {#[default]