Update usages of text_size_* to text_ui in ui components

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Nate Butler 2023-11-08 15:28:38 -05:00
parent 9bdfc7a2e5
commit 9cc3ee9674
8 changed files with 15 additions and 11 deletions

View file

@ -1,9 +1,11 @@
use std::sync::Arc; use std::sync::Arc;
use gpui::{div, rems, DefiniteLength, Hsla, MouseButton, WindowContext}; use gpui::{div, DefiniteLength, Hsla, MouseButton, WindowContext};
use crate::{h_stack, Icon, IconColor, IconElement, Label, LabelColor, LineHeightStyle}; use crate::{
use crate::{prelude::*, IconButton}; h_stack, prelude::*, Icon, IconButton, IconColor, IconElement, Label, LabelColor,
LineHeightStyle,
};
/// Provides the flexibility to use either a standard /// Provides the flexibility to use either a standard
/// button or an icon button in a given context. /// button or an icon button in a given context.
@ -167,10 +169,10 @@ impl<V: 'static> Button<V> {
let icon_color = self.icon_color(); let icon_color = self.icon_color();
let mut button = h_stack() let mut button = h_stack()
.relative()
.id(SharedString::from(format!("{}", self.label))) .id(SharedString::from(format!("{}", self.label)))
.relative()
.p_1() .p_1()
.text_size(rems(1.)) .text_ui()
.rounded_md() .rounded_md()
.bg(self.variant.bg_color(cx)) .bg(self.variant.bg_color(cx))
.hover(|style| style.bg(self.variant.bg_color_hover(cx))) .hover(|style| style.bg(self.variant.bg_color_hover(cx)))
@ -217,7 +219,7 @@ impl<V: 'static> ButtonGroup<V> {
} }
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> { fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let mut el = h_stack().text_size(rems(1.)); let mut el = h_stack().text_ui();
for button in self.buttons { for button in self.buttons {
el = el.child(button.render(_view, cx)); el = el.child(button.render(_view, cx));

View file

@ -31,7 +31,7 @@ impl<V: 'static> Details<V> {
v_stack() v_stack()
.p_1() .p_1()
.gap_0p5() .gap_0p5()
.text_xs() .text_ui_sm()
.text_color(cx.theme().colors().text) .text_color(cx.theme().colors().text)
.size_full() .size_full()
.child(self.text) .child(self.text)

View file

@ -88,6 +88,7 @@ impl<V: 'static> IconButton<V> {
.id(self.id.clone()) .id(self.id.clone())
.justify_center() .justify_center()
.rounded_md() .rounded_md()
// todo!("Where do these numbers come from?")
.py(rems(0.21875)) .py(rems(0.21875))
.px(rems(0.375)) .px(rems(0.375))
.bg(bg_color) .bg(bg_color)

View file

@ -94,7 +94,7 @@ impl Input {
.active(|style| style.bg(input_active_bg)) .active(|style| style.bg(input_active_bg))
.flex() .flex()
.items_center() .items_center()
.child(div().flex().items_center().text_sm().map(|this| { .child(div().flex().items_center().text_ui_sm().map(|this| {
if self.value.is_empty() { if self.value.is_empty() {
this.child(placeholder_label) this.child(placeholder_label)
} else { } else {

View file

@ -64,7 +64,7 @@ impl Key {
.px_2() .px_2()
.py_0() .py_0()
.rounded_md() .rounded_md()
.text_sm() .text_ui_sm()
.text_color(cx.theme().colors().text) .text_color(cx.theme().colors().text)
.bg(cx.theme().colors().element_background) .bg(cx.theme().colors().element_background)
.child(self.key.clone()) .child(self.key.clone())

View file

@ -7,6 +7,7 @@ pub use gpui::{
pub use crate::elevation::*; pub use crate::elevation::*;
pub use crate::ButtonVariant; pub use crate::ButtonVariant;
pub use crate::StyledExt;
pub use theme2::ActiveTheme; pub use theme2::ActiveTheme;
use gpui::Hsla; use gpui::Hsla;

View file

@ -30,7 +30,7 @@ impl Breadcrumb {
h_stack() h_stack()
.id("breadcrumb") .id("breadcrumb")
.px_1() .px_1()
.text_sm() .text_ui_sm()
.text_color(cx.theme().colors().text_muted) .text_color(cx.theme().colors().text_muted)
.rounded_md() .rounded_md()
.hover(|style| style.bg(cx.theme().colors().ghost_element_hover)) .hover(|style| style.bg(cx.theme().colors().ghost_element_hover))

View file

@ -77,7 +77,7 @@ impl CollabPanel {
.items_center() .items_center()
.child( .child(
div() div()
.text_sm() .text_ui_sm()
.text_color(cx.theme().colors().text_placeholder) .text_color(cx.theme().colors().text_placeholder)
.child("Find..."), .child("Find..."),
), ),