Fix TitleBar

This commit is contained in:
Jason Lee 2024-07-04 10:14:44 +08:00
parent f78d50b5e9
commit 24348ec874
2 changed files with 26 additions and 14 deletions

34
Cargo.lock generated
View file

@ -917,7 +917,7 @@ dependencies = [
[[package]]
name = "collections"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"rustc-hash",
]
@ -1230,7 +1230,7 @@ dependencies = [
[[package]]
name = "derive_refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"proc-macro2",
"quote",
@ -2181,7 +2181,7 @@ dependencies = [
[[package]]
name = "gpui"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"anyhow",
"as-raw-xcb-connection",
@ -2222,6 +2222,7 @@ dependencies = [
"log",
"media",
"metal",
"mio",
"num_cpus",
"objc",
"oo7",
@ -2268,7 +2269,7 @@ dependencies = [
[[package]]
name = "gpui_macros"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"proc-macro2",
"quote",
@ -2453,7 +2454,7 @@ dependencies = [
[[package]]
name = "http"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"anyhow",
"futures",
@ -3127,7 +3128,7 @@ dependencies = [
[[package]]
name = "media"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"anyhow",
"bindgen",
@ -3213,6 +3214,19 @@ version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff"
[[package]]
name = "mio"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4929e1f84c5e54c3ec6141cd5d8b5a5c055f031f80cf78f2072920173cb4d880"
dependencies = [
"hermit-abi 0.3.9",
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.52.0",
]
[[package]]
name = "naga"
version = "0.14.2"
@ -4244,7 +4258,7 @@ dependencies = [
[[package]]
name = "refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"derive_refineable",
]
@ -4519,7 +4533,7 @@ checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a"
[[package]]
name = "semantic_version"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"anyhow",
"serde",
@ -4932,7 +4946,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "sum_tree"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"arrayvec",
"log",
@ -5590,7 +5604,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "util"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#5c7a8f779adbaf07b74799cf743bc3a122666f24"
source = "git+https://github.com/zed-industries/zed.git#ed09bb949c2be7972234fe9cbb06def686182860"
dependencies = [
"anyhow",
"async-fs 1.6.0",

View file

@ -123,9 +123,7 @@ impl RenderOnce for TitleBar {
|title_bar| title_bar.child(WindowsWindowControls::new(height)),
)
.when(
self.platform_style == PlatformStyle::Linux
&& !cx.is_fullscreen()
&& cx.should_render_window_controls(),
self.platform_style == PlatformStyle::Linux && !cx.is_fullscreen(),
|title_bar| {
title_bar
.child(LinuxWindowControls::new(height, self.close_window_action))
@ -134,7 +132,7 @@ impl RenderOnce for TitleBar {
})
.on_mouse_move(move |ev, cx| {
if ev.dragging() {
cx.start_system_move();
cx.start_window_move();
}
})
},