Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/title_bar/src/title_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ impl TitleBar {
})
});

if cfg!(macos_sdk_26) {
if ui::utils::MACOS_SDK_26_OR_LATER {
// Make up for Tahoe's traffic light buttons having less spacing around them
Some(div().child(button).ml_0p5().into_any_element())
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/title_bar/build.rs → crates/ui/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(clippy::disallowed_methods, reason = "build scripts are exempt")]

fn main() {
println!("cargo::rustc-check-cfg=cfg(macos_sdk_26)");
println!("cargo::rustc-check-cfg=cfg(macos_sdk_26_or_later)");

#[cfg(target_os = "macos")]
{
Expand All @@ -22,7 +22,7 @@ fn main() {
if let Some(major) = major_version
&& major >= 26
{
println!("cargo:rustc-cfg=macos_sdk_26");
println!("cargo:rustc-cfg=macos_sdk_26_or_later");
}
}
}
8 changes: 3 additions & 5 deletions crates/ui/src/utils/constants.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use gpui::{Pixels, Window, px};

pub const MACOS_SDK_26_OR_LATER: bool = cfg!(macos_sdk_26_or_later);

// Use pixels here instead of a rem-based size because the macOS traffic
// lights are a static size, and don't scale with the rest of the UI.
//
// Magic number: There is one extra pixel of padding on the left side due to
// the 1px border around the window on macOS apps.
#[cfg(macos_sdk_26)]
pub const TRAFFIC_LIGHT_PADDING: f32 = 78.;

#[cfg(not(macos_sdk_26))]
pub const TRAFFIC_LIGHT_PADDING: f32 = 71.;
pub const TRAFFIC_LIGHT_PADDING: f32 = if MACOS_SDK_26_OR_LATER { 78. } else { 71. };

/// Returns the platform-appropriate title bar height.
///
Expand Down
Loading