Add tab tooltips

This commit is contained in:
Joseph Lyons 2023-04-14 17:46:53 -04:00
parent e655a6c767
commit ebe57254e0
10 changed files with 119 additions and 39 deletions

View file

@ -13,7 +13,10 @@ use gpui::{
};
use settings::Settings;
use smallvec::SmallVec;
use std::sync::{Arc, Weak};
use std::{
borrow::Cow,
sync::{Arc, Weak},
};
pub enum Event {
Close,
@ -92,6 +95,9 @@ impl View for SharedScreen {
}
impl Item for SharedScreen {
fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option<Cow<'a, str>> {
Some(format!("{}'s screen", self.user.github_login).into())
}
fn deactivated(&mut self, cx: &mut ViewContext<Self>) {
if let Some(nav_history) = self.nav_history.as_ref() {
nav_history.push::<()>(None, cx);