WIP
This commit is contained in:
parent
97d6e7f2f5
commit
dd434588ee
3 changed files with 19 additions and 15 deletions
|
@ -30,6 +30,7 @@ use std::{
|
|||
};
|
||||
use text::Selection;
|
||||
use theme::{ActiveTheme, Theme};
|
||||
use ui::{Label, LabelColor};
|
||||
use util::{paths::PathExt, ResultExt, TryFutureExt};
|
||||
use workspace::item::{BreadcrumbText, FollowEvent, FollowableEvents, FollowableItemHandle};
|
||||
use workspace::{
|
||||
|
@ -595,16 +596,19 @@ impl Item for Editor {
|
|||
.flex_row()
|
||||
.items_center()
|
||||
.gap_2()
|
||||
.child(self.title(cx).to_string())
|
||||
.child(Label::new(self.title(cx).to_string()))
|
||||
.children(detail.and_then(|detail| {
|
||||
let path = path_for_buffer(&self.buffer, detail, false, cx)?;
|
||||
let description = path.to_string_lossy();
|
||||
|
||||
Some(
|
||||
div()
|
||||
.text_color(theme.colors().text_muted)
|
||||
.text_xs()
|
||||
.child(util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN)),
|
||||
div().child(
|
||||
Label::new(util::truncate_and_trailoff(
|
||||
&description,
|
||||
MAX_TAB_TITLE_LEN,
|
||||
))
|
||||
.color(LabelColor::Muted),
|
||||
),
|
||||
)
|
||||
})),
|
||||
)
|
||||
|
|
|
@ -20,6 +20,7 @@ pub fn one_family() -> ThemeFamily {
|
|||
pub(crate) fn one_dark() -> Theme {
|
||||
let bg = hsla(215. / 360., 12. / 100., 15. / 100., 1.);
|
||||
let editor = hsla(220. / 360., 12. / 100., 18. / 100., 1.);
|
||||
let elevated_surface = hsla(220. / 360., 12. / 100., 18. / 100., 1.);
|
||||
|
||||
let blue = hsla(207.8 / 360., 81. / 100., 66. / 100., 1.0);
|
||||
let gray = hsla(218.8 / 360., 10. / 100., 40. / 100., 1.0);
|
||||
|
@ -43,10 +44,10 @@ pub(crate) fn one_dark() -> Theme {
|
|||
border_selected: hsla(222.6 / 360., 77.5 / 100., 65.1 / 100., 1.0),
|
||||
border_transparent: SystemColors::default().transparent,
|
||||
border_disabled: hsla(222.0 / 360., 11.6 / 100., 33.7 / 100., 1.0),
|
||||
elevated_surface_background: bg,
|
||||
elevated_surface_background: elevated_surface,
|
||||
surface_background: bg,
|
||||
background: bg,
|
||||
element_background: hsla(222.9 / 360., 11.1 / 100., 24.7 / 100., 1.0),
|
||||
element_background: elevated_surface,
|
||||
element_hover: hsla(225.0 / 360., 11.8 / 100., 26.7 / 100., 1.0),
|
||||
element_active: hsla(220.0 / 360., 11.8 / 100., 20.0 / 100., 1.0),
|
||||
element_selected: hsla(224.0 / 360., 11.3 / 100., 26.1 / 100., 1.0),
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
use gpui::{div, Div, ParentElement, Render, SharedString, Styled, ViewContext};
|
||||
use theme2::ActiveTheme;
|
||||
|
||||
use crate::StyledExt;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TextTooltip {
|
||||
title: SharedString,
|
||||
|
@ -16,16 +18,13 @@ impl Render for TextTooltip {
|
|||
type Element = Div<Self>;
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||
let theme = cx.theme();
|
||||
div()
|
||||
.bg(theme.colors().background)
|
||||
.rounded_lg()
|
||||
.border()
|
||||
.elevation_2(cx)
|
||||
.font("Zed Sans")
|
||||
.border_color(theme.colors().border)
|
||||
.text_color(theme.colors().text)
|
||||
.pl_2()
|
||||
.pr_2()
|
||||
.text_ui()
|
||||
.text_color(cx.theme().colors().text)
|
||||
.py_1()
|
||||
.px_2()
|
||||
.child(self.title.clone())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue