Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings_ui: Fix settings window doesn't inherit Zed icon (#41031)

Smit Barmaseb6a18671dca3
diff --git a/Cargo.lock b/Cargo.lock
index 152dbd8e603..863f8d62bcd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -15334,6 +15334,7 @@ dependencies = [
"picker",
"pretty_assertions",
"project",
+ "release_channel",
"schemars 1.0.4",
"search",
"serde",
diff --git a/crates/settings_ui/Cargo.toml b/crates/settings_ui/Cargo.toml
index b2b40bf250c..bbb1cb397b5 100644
--- a/crates/settings_ui/Cargo.toml
+++ b/crates/settings_ui/Cargo.toml
@@ -28,6 +28,7 @@ menu.workspace = true
paths.workspace = true
picker.workspace = true
project.workspace = true
+release_channel.workspace = true
schemars.workspace = true
search.workspace = true
serde.workspace = true
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index c08e00ffbe4..48d0bfc5c86 100644
--- a/crates/settings_ui/src/settings_ui.rs
+++ b/crates/settings_ui/src/settings_ui.rs
@@ -13,6 +13,7 @@ use gpui::{
};
use heck::ToTitleCase as _;
use project::{Project, WorktreeId};
+use release_channel::ReleaseChannel;
use schemars::JsonSchema;
use serde::Deserialize;
use settings::{Settings, SettingsContent, SettingsStore};
@@ -579,6 +580,7 @@ pub fn open_settings_editor(
let scale_factor = current_rem_size / default_rem_size;
let scaled_bounds: gpui::Size<Pixels> = default_bounds.map(|axis| axis * scale_factor);
+ let app_id = ReleaseChannel::global(cx).app_id();
let window_decorations = match std::env::var("ZED_WINDOW_DECORATIONS") {
Ok(val) if val == "server" => gpui::WindowDecorations::Server,
Ok(val) if val == "client" => gpui::WindowDecorations::Client,
@@ -597,6 +599,7 @@ pub fn open_settings_editor(
is_movable: true,
kind: gpui::WindowKind::Floating,
window_background: cx.theme().window_background_appearance(),
+ app_id: Some(app_id.to_owned()),
window_decorations: Some(window_decorations),
window_min_size: Some(scaled_bounds),
window_bounds: Some(WindowBounds::centered(scaled_bounds, cx)),