feat: add shadow highlight to issue list
This commit is contained in:
@@ -2,7 +2,7 @@ use std::ops::Deref;
|
||||
|
||||
use gpui::{
|
||||
InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled, div, list,
|
||||
prelude::FluentBuilder, px,
|
||||
point, prelude::FluentBuilder, px,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@@ -135,8 +135,8 @@ impl gpui::RenderOnce for IssueListItem {
|
||||
let theme = app::current_theme(cx);
|
||||
|
||||
let repo_name_text = match self.repo_name {
|
||||
Some(name) => text(name),
|
||||
None => text("Unknown repo"),
|
||||
| Some(name) => text(name),
|
||||
| None => text("Unknown repo"),
|
||||
}
|
||||
.text_xs()
|
||||
.opacity(0.5);
|
||||
@@ -147,24 +147,25 @@ impl gpui::RenderOnce for IssueListItem {
|
||||
.opacity(0.5)
|
||||
} else {
|
||||
match self.status {
|
||||
api::issues::PullRequestState::Closed => {
|
||||
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.danger)
|
||||
}
|
||||
api::issues::PullRequestState::Merged => {
|
||||
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.success)
|
||||
}
|
||||
_ => font_icon(FontIcon::PullRequestArrow).text_color(theme.colors.success),
|
||||
| api::issues::PullRequestState::Closed => {
|
||||
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.danger)
|
||||
}
|
||||
| api::issues::PullRequestState::Merged => {
|
||||
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.success)
|
||||
}
|
||||
| _ => font_icon(FontIcon::PullRequestArrow).text_color(theme.colors.success),
|
||||
}
|
||||
}
|
||||
.flex_shrink_0()
|
||||
.size_4();
|
||||
|
||||
let description_text = match self.description {
|
||||
Some(description) => text(description).text_xs(),
|
||||
None => text("No description provided").opacity(0.5).text_xs(),
|
||||
| Some(description) => text(description).text_xs(),
|
||||
| None => text("No description provided").opacity(0.5).text_xs(),
|
||||
};
|
||||
|
||||
div()
|
||||
.relative()
|
||||
.w_full()
|
||||
.px_1p5()
|
||||
.py_1()
|
||||
@@ -196,11 +197,27 @@ impl gpui::RenderOnce for IssueListItem {
|
||||
it.border_b_1().border_color(theme.colors.border)
|
||||
})
|
||||
.when(self.is_selected, |it| {
|
||||
it.bg(theme.colors.surface_elevated)
|
||||
.border_r_1()
|
||||
.border_b_0()
|
||||
.border_color(theme.colors.accent)
|
||||
.pb(px(5.))
|
||||
it.bg(gpui::Rgba {
|
||||
a: 0.05,
|
||||
..theme.colors.accent
|
||||
})
|
||||
.overflow_hidden()
|
||||
.border_r_1()
|
||||
.child(
|
||||
div()
|
||||
.absolute()
|
||||
.right_0()
|
||||
.top_0()
|
||||
.bottom_0()
|
||||
.w_px()
|
||||
.bg(theme.colors.accent)
|
||||
.shadow(vec![gpui::BoxShadow {
|
||||
blur_radius: px(16.),
|
||||
spread_radius: px(2.),
|
||||
color: gpui::Hsla::from(theme.colors.accent).alpha(0.8),
|
||||
offset: point(px(-2.), px(0.)),
|
||||
}]),
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user