Display warning in titlebar when Zed is out-of-date

This commit is contained in:
Antonio Scandurra
2021-09-23 15:36:32 +02:00
parent 511cbaa2bd
commit 374b05a379
3 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -54,6 +54,7 @@ pub struct Titlebar {
pub offline_icon: OfflineIcon,
pub icon_color: Color,
pub avatar: ImageStyle,
pub outdated_warning: ContainedText,
}
#[derive(Clone, Deserialize)]
@@ -169,7 +170,7 @@ pub struct Selector {
pub active_item: ContainedLabel,
}
#[derive(Debug, Deserialize)]
#[derive(Clone, Debug, Deserialize)]
pub struct ContainedText {
#[serde(flatten)]
pub container: ContainerStyle,
+10
View File
@@ -1041,6 +1041,16 @@ impl Workspace {
.with_style(theme.workspace.titlebar.offline_icon.container)
.boxed(),
),
rpc::Status::UpgradeRequired => Some(
Label::new(
"Please update Zed to collaborate".to_string(),
theme.workspace.titlebar.outdated_warning.text.clone(),
)
.contained()
.with_style(theme.workspace.titlebar.outdated_warning.container)
.aligned()
.boxed(),
),
_ => None,
}
}