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 util::ResultExt;
|
||||||
use workspace::{FollowNextCollaborator, Workspace};
|
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!(
|
actions!(
|
||||||
collab,
|
collab,
|
||||||
|
@ -210,11 +211,16 @@ impl CollabTitlebarItem {
|
||||||
names_and_branches.next().unwrap_or(("", None))
|
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
|
let branch_prepended = entry
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(RepositoryEntry::branch)
|
.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 text_style = theme.titlebar.title.clone();
|
||||||
let item_spacing = theme.titlebar.item_spacing;
|
let item_spacing = theme.titlebar.item_spacing;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue