14 lines
379 B
Rust
14 lines
379 B
Rust
|
|
use crate::app;
|
||
|
|
use gpui::{ParentElement, Styled, div};
|
||
|
|
|
||
|
|
pub trait Text: gpui::IntoElement {}
|
||
|
|
|
||
|
|
impl Text for &'static str {}
|
||
|
|
impl Text for String {}
|
||
|
|
impl Text for gpui::SharedString {}
|
||
|
|
|
||
|
|
pub fn text<'a, Content: Text, T>(s: Content, cx: &gpui::Context<T>) -> gpui::Div {
|
||
|
|
let theme = cx.global::<app::Global>().current_theme;
|
||
|
|
div().text_color(theme.colors.text).child(s)
|
||
|
|
}
|