mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
Trail off project/branch name
This commit is contained in:
parent
e57364ede6
commit
98f71a7fa3
1 changed files with 9 additions and 3 deletions
|
@ -28,7 +28,8 @@ use theme::{AvatarStyle, Theme};
|
|||
use util::ResultExt;
|
||||
use workspace::{FollowNextCollaborator, Workspace};
|
||||
|
||||
// const MAX_TITLE_LENGTH: usize = 75;
|
||||
const MAX_PROJECT_NAME_LENGTH: usize = 40;
|
||||
const MAX_BRANCH_NAME_LENGTH: usize = 40;
|
||||
|
||||
actions!(
|
||||
collab,
|
||||
|
@ -210,11 +211,16 @@ impl CollabTitlebarItem {
|
|||
names_and_branches.next().unwrap_or(("", None))
|
||||
};
|
||||
|
||||
let name = name.to_owned();
|
||||
let name = util::truncate_and_trailoff(name, MAX_PROJECT_NAME_LENGTH);
|
||||
let branch_prepended = entry
|
||||
.as_ref()
|
||||
.and_then(RepositoryEntry::branch)
|
||||
.map(|branch| format!("/{branch}"));
|
||||
.map(|branch| {
|
||||
format!(
|
||||
"/{}",
|
||||
util::truncate_and_trailoff(&branch, MAX_BRANCH_NAME_LENGTH)
|
||||
)
|
||||
});
|
||||
let text_style = theme.titlebar.title.clone();
|
||||
let item_spacing = theme.titlebar.item_spacing;
|
||||
|
||||
|
|
Loading…
Reference in a new issue