From 40e6a6dd58b7fe5422c9811a81c236ecb14b26b3 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Sun, 11 Jan 2026 13:51:48 -0800 Subject: [PATCH] Refine spacing and header usage This is 4pt header space, 12pt clickable frame height --- .../Ghostty/Surface View/SurfaceGrabHandle.swift | 2 +- src/Surface.zig | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceGrabHandle.swift b/macos/Sources/Ghostty/Surface View/SurfaceGrabHandle.swift index b30acc066..a8555e938 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceGrabHandle.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceGrabHandle.swift @@ -26,7 +26,7 @@ extension Ghostty { Image(systemName: "ellipsis") .font(.system(size: 10, weight: .semibold)) .foregroundColor(.primary.opacity(isHovering ? 0.8 : 0.3)) - .offset(y: -2) + .offset(y: -3) .allowsHitTesting(false) .transition(.opacity) } diff --git a/src/Surface.zig b/src/Surface.zig index 02fe75718..ddcb3a4f3 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -427,14 +427,18 @@ const DerivedConfig = struct { } fn scaledPadding(self: *const DerivedConfig, x_dpi: f32, y_dpi: f32) rendererpkg.Padding { - // Add 6pt header height for macOS overlay elements (tight fit around ellipsis) - const header_height_pt: f32 = 6.0; - const header_height_px: u32 = @intFromFloat(@floor(header_height_pt * y_dpi / 72)); - const padding_top: u32 = padding_top: { const padding_top: f32 = @floatFromInt(self.window_padding_top); const scaled_padding: u32 = @intFromFloat(@floor(padding_top * y_dpi / 72)); - break :padding_top scaled_padding + header_height_px; + + // Add 6pt header height for macOS surface grab overlay elements + if (comptime builtin.os.tag == .macos) { + const header_height_pt: f32 = 4.0; + const header_height_px: u32 = @intFromFloat(@floor(header_height_pt * y_dpi / 72)); + break :padding_top scaled_padding + header_height_px; + } + + break :padding_top scaled_padding; }; const padding_bottom: u32 = padding_bottom: { const padding_bottom: f32 = @floatFromInt(self.window_padding_bottom);