Fixed failing test, now to make breadcrumbs scrollable...
This commit is contained in:
parent
1f161b9aa1
commit
f473eadf2d
3 changed files with 8 additions and 5 deletions
|
@ -42,10 +42,12 @@ impl View for Breadcrumbs {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|item| item.breadcrumbs(&theme, cx))
|
.and_then(|item| item.breadcrumbs(&theme, cx))
|
||||||
{
|
{
|
||||||
|
enum BreadcrumbTag {}
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_children(Itertools::intersperse_with(breadcrumbs.into_iter(), || {
|
.with_children(Itertools::intersperse_with(breadcrumbs.into_iter(), || {
|
||||||
Label::new(" 〉 ".to_string(), theme.breadcrumbs.text.clone()).boxed()
|
Label::new(" 〉 ".to_string(), theme.breadcrumbs.text.clone()).boxed()
|
||||||
}))
|
}))
|
||||||
|
.scrollable::<BreadcrumbTag, _>(1, None, cx)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(theme.breadcrumbs.container)
|
.with_style(theme.breadcrumbs.container)
|
||||||
.aligned()
|
.aligned()
|
||||||
|
|
|
@ -1843,12 +1843,10 @@ impl language::File for File {
|
||||||
if worktree.is_visible() {
|
if worktree.is_visible() {
|
||||||
full_path.push(worktree.root_name());
|
full_path.push(worktree.root_name());
|
||||||
} else {
|
} else {
|
||||||
let home_dir = cx.global::<HomeDir>();
|
if let Some(path) = worktree.as_local().map(|local| local.abs_path.clone()) {
|
||||||
let local_path = worktree.as_local().map(|local| local.abs_path.clone());
|
if let Ok(trimmed_path) = path.strip_prefix(cx.global::<HomeDir>().0.as_path()) {
|
||||||
if let Some(path) = local_path {
|
|
||||||
if let Ok(path) = path.strip_prefix(home_dir.0.as_path()) {
|
|
||||||
full_path.push("~");
|
full_path.push("~");
|
||||||
full_path.push(path);
|
full_path.push(trimmed_path);
|
||||||
} else {
|
} else {
|
||||||
full_path.push(path)
|
full_path.push(path)
|
||||||
}
|
}
|
||||||
|
|
|
@ -927,6 +927,9 @@ impl From<&dyn NotificationHandle> for AnyViewHandle {
|
||||||
impl AppState {
|
impl AppState {
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
pub fn test(cx: &mut MutableAppContext) -> Arc<Self> {
|
pub fn test(cx: &mut MutableAppContext) -> Arc<Self> {
|
||||||
|
use fs::HomeDir;
|
||||||
|
|
||||||
|
cx.set_global(HomeDir(Path::new("/tmp/").to_path_buf()));
|
||||||
let settings = Settings::test(cx);
|
let settings = Settings::test(cx);
|
||||||
cx.set_global(settings);
|
cx.set_global(settings);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue