feat: impl dashboard & issue list
This commit is contained in:
@@ -8,6 +8,7 @@ pub(crate) struct Text {
|
||||
opacity: f32,
|
||||
text_align: gpui::TextAlign,
|
||||
text_size: Option<gpui::AbsoluteLength>,
|
||||
text_color: Option<gpui::Hsla>,
|
||||
line_height: gpui::DefiniteLength,
|
||||
styled: Option<Box<dyn Fn(gpui::Div) -> gpui::Div>>,
|
||||
}
|
||||
@@ -25,6 +26,7 @@ pub(crate) fn text(content: impl TextContent) -> Text {
|
||||
opacity: 1.,
|
||||
text_align: gpui::TextAlign::Left,
|
||||
text_size: None,
|
||||
text_color: None,
|
||||
line_height: gpui::relative(1.5),
|
||||
styled: None,
|
||||
}
|
||||
@@ -84,6 +86,11 @@ impl Text {
|
||||
self.text_size(gpui::rems(1.875))
|
||||
}
|
||||
|
||||
pub(crate) fn text_color(mut self, color: impl Into<gpui::Hsla>) -> Self {
|
||||
self.text_color = Some(color.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn line_height(mut self, line_height: impl Into<gpui::DefiniteLength>) -> Self {
|
||||
self.line_height = line_height.into();
|
||||
self
|
||||
@@ -160,7 +167,7 @@ impl gpui::RenderOnce for Text {
|
||||
fn render(self, _window: &mut gpui::Window, cx: &mut gpui::App) -> impl gpui::IntoElement {
|
||||
let theme = app::current_theme(cx);
|
||||
let mut div = div()
|
||||
.text_color(theme.colors.text)
|
||||
.text_color(self.text_color.unwrap_or(theme.colors.text.into()))
|
||||
.font_weight(self.font_weight)
|
||||
.opacity(self.opacity)
|
||||
.text_align(self.text_align)
|
||||
|
||||
Reference in New Issue
Block a user