Detailed changes
@@ -0,0 +1,11 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_3010_383)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M3.71141 7.06133C3.76141 6.47267 3.78341 5.88133 3.81608 5.29133C4.10416 0.190201 11.896 0.190202 12.1841 5.29133C12.2174 5.898 12.2441 6.50333 12.3067 7.10733C12.6951 7.94202 14.3637 11.6214 13.4134 12.006C13.1894 12.096 12.8041 11.7227 12.3694 11.052C12.207 11.9614 11.7273 12.8132 11.0587 13.4467C11.7441 13.68 12.3334 13.998 12.3334 14.3333C12.3334 14.9176 3.66675 14.9257 3.66675 14.3333C3.66675 13.998 4.25608 13.68 4.94141 13.4467C4.26191 12.803 3.82279 11.9657 3.62408 11.056C3.19075 11.724 2.80608 12.096 2.58341 12.006C1.626 11.6185 3.31478 7.90684 3.71141 7.06133Z" stroke="#7B7B7B" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M6.11822 6.6L7.68822 7.89C7.85822 8.03 8.12822 8.03 8.29822 7.89L9.86822 6.6C10.1382 6.38 9.94822 6 9.56822 6H6.42822C6.04822 6 5.85822 6.38 6.12822 6.6H6.11822Z" fill="#7B7B7B"/>
+</g>
+<defs>
+<clipPath id="clip0_3010_383">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>
@@ -263,6 +263,7 @@ pub enum IconName {
ZedPredictError,
ZedPredictUp,
ZedXCopilot,
+ Linux,
}
impl IconName {
@@ -417,10 +417,13 @@ impl PickerDelegate for RecentProjectsDelegate {
SerializedWorkspaceLocation::Local => Icon::new(IconName::Screen)
.color(Color::Muted)
.into_any_element(),
- SerializedWorkspaceLocation::Remote(_) => {
- Icon::new(IconName::Server)
- .color(Color::Muted)
- .into_any_element()
+ SerializedWorkspaceLocation::Remote(options) => {
+ Icon::new(match options {
+ RemoteConnectionOptions::Ssh { .. } => IconName::Server,
+ RemoteConnectionOptions::Wsl { .. } => IconName::Linux,
+ })
+ .color(Color::Muted)
+ .into_any_element()
}
})
})
@@ -192,6 +192,7 @@ impl Settings for SshSettings {
pub struct RemoteConnectionPrompt {
connection_string: SharedString,
nickname: Option<SharedString>,
+ is_wsl: bool,
status_message: Option<SharedString>,
prompt: Option<(Entity<Markdown>, oneshot::Sender<String>)>,
cancellation: Option<oneshot::Sender<()>>,
@@ -216,12 +217,14 @@ impl RemoteConnectionPrompt {
pub(crate) fn new(
connection_string: String,
nickname: Option<String>,
+ is_wsl: bool,
window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
Self {
connection_string: connection_string.into(),
nickname: nickname.map(|nickname| nickname.into()),
+ is_wsl,
editor: cx.new(|cx| Editor::single_line(window, cx)),
status_message: None,
cancellation: None,
@@ -350,15 +353,16 @@ impl RemoteConnectionModal {
window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
- let (connection_string, nickname) = match connection_options {
+ let (connection_string, nickname, is_wsl) = match connection_options {
RemoteConnectionOptions::Ssh(options) => {
- (options.connection_string(), options.nickname.clone())
+ (options.connection_string(), options.nickname.clone(), false)
}
- RemoteConnectionOptions::Wsl(options) => (options.distro_name.clone(), None),
+ RemoteConnectionOptions::Wsl(options) => (options.distro_name.clone(), None, true),
};
Self {
- prompt: cx
- .new(|cx| RemoteConnectionPrompt::new(connection_string, nickname, window, cx)),
+ prompt: cx.new(|cx| {
+ RemoteConnectionPrompt::new(connection_string, nickname, is_wsl, window, cx)
+ }),
finished: false,
paths,
}
@@ -389,6 +393,7 @@ pub(crate) struct SshConnectionHeader {
pub(crate) connection_string: SharedString,
pub(crate) paths: Vec<PathBuf>,
pub(crate) nickname: Option<SharedString>,
+ pub(crate) is_wsl: bool,
}
impl RenderOnce for SshConnectionHeader {
@@ -404,6 +409,11 @@ impl RenderOnce for SshConnectionHeader {
(self.connection_string, None)
};
+ let icon = match self.is_wsl {
+ true => IconName::Linux,
+ false => IconName::Server,
+ };
+
h_flex()
.px(DynamicSpacing::Base12.rems(cx))
.pt(DynamicSpacing::Base08.rems(cx))
@@ -411,7 +421,7 @@ impl RenderOnce for SshConnectionHeader {
.rounded_t_sm()
.w_full()
.gap_1p5()
- .child(Icon::new(IconName::Server).size(IconSize::Small))
+ .child(Icon::new(icon).size(IconSize::Small))
.child(
h_flex()
.gap_1()
@@ -443,6 +453,7 @@ impl Render for RemoteConnectionModal {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl ui::IntoElement {
let nickname = self.prompt.read(cx).nickname.clone();
let connection_string = self.prompt.read(cx).connection_string.clone();
+ let is_wsl = self.prompt.read(cx).is_wsl;
let theme = cx.theme().clone();
let body_color = theme.colors().editor_background;
@@ -461,6 +472,7 @@ impl Render for RemoteConnectionModal {
paths: self.paths.clone(),
connection_string,
nickname,
+ is_wsl,
}
.render(window, cx),
)
@@ -288,7 +288,7 @@ impl picker::PickerDelegate for WslPickerDelegate {
h_flex()
.flex_grow()
.gap_3()
- .child(Icon::new(IconName::Server))
+ .child(Icon::new(IconName::Linux))
.child(v_flex().child(HighlightedLabel::new(
matched.string.clone(),
matched.positions.clone(),
@@ -483,12 +483,14 @@ impl gpui::Render for ProjectPicker {
connection_string: connection_string.clone(),
paths: Default::default(),
nickname: nickname.clone(),
+ is_wsl: false,
}
.render(window, cx),
ProjectPickerData::Wsl { distro_name } => SshConnectionHeader {
connection_string: distro_name.clone(),
paths: Default::default(),
nickname: None,
+ is_wsl: true,
}
.render(window, cx),
})
@@ -799,6 +801,7 @@ impl RemoteServerProjects {
RemoteConnectionPrompt::new(
connection_options.connection_string(),
connection_options.nickname.clone(),
+ false,
window,
cx,
)
@@ -870,7 +873,13 @@ impl RemoteServerProjects {
};
let prompt = cx.new(|cx| {
- RemoteConnectionPrompt::new(connection_options.distro_name.clone(), None, window, cx)
+ RemoteConnectionPrompt::new(
+ connection_options.distro_name.clone(),
+ None,
+ true,
+ window,
+ cx,
+ )
});
let connection = connect(
ConnectionIdentifier::setup(),
@@ -1644,6 +1653,7 @@ impl RemoteServerProjects {
connection_string: connection.host.clone().into(),
paths: Default::default(),
nickname: connection.nickname.clone().map(|s| s.into()),
+ is_wsl: false,
}
.render(window, cx)
.into_any_element(),
@@ -1651,6 +1661,7 @@ impl RemoteServerProjects {
connection_string: connection.distro_name.clone().into(),
paths: Default::default(),
nickname: None,
+ is_wsl: true,
}
.render(window, cx)
.into_any_element(),
@@ -1988,6 +1999,7 @@ impl RemoteServerProjects {
connection_string,
paths: Default::default(),
nickname,
+ is_wsl: false,
}
.render(window, cx),
)
@@ -349,10 +349,11 @@ impl TitleBar {
let options = self.project.read(cx).remote_connection_options(cx)?;
let host: SharedString = options.display_name().into();
- let nickname = if let RemoteConnectionOptions::Ssh(options) = options {
- options.nickname.map(|nick| nick.into())
- } else {
- None
+ let (nickname, icon) = match options {
+ RemoteConnectionOptions::Ssh(options) => {
+ (options.nickname.map(|nick| nick.into()), IconName::Server)
+ }
+ RemoteConnectionOptions::Wsl(_) => (None, IconName::Linux),
};
let nickname = nickname.unwrap_or_else(|| host.clone());
@@ -390,9 +391,7 @@ impl TitleBar {
.max_w_32()
.child(
IconWithIndicator::new(
- Icon::new(IconName::Server)
- .size(IconSize::Small)
- .color(icon_color),
+ Icon::new(icon).size(IconSize::Small).color(icon_color),
Some(Indicator::dot().color(indicator_color)),
)
.indicator_border_color(Some(cx.theme().colors().title_bar_background))