macos: workaround for `TabTitleEditor` alignment issue (#11052)

Fixes #10993



https://github.com/user-attachments/assets/666803f9-05aa-4c86-ab4a-7a183d471e33
pull/11058/head
Mitchell Hashimoto 2026-02-27 07:11:54 -08:00 committed by GitHub
commit 6074e8b1fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -226,7 +226,9 @@ final class TabTitleEditor: NSObject, NSTextFieldDelegate {
if let sourceLabel {
let labelFrame = tabButton.convert(sourceLabel.bounds, from: sourceLabel)
frame.origin.y = labelFrame.minY
/// The `labelFrame.minY` value changes unexpectedly after the first use,
/// I don't know exactly why, but `tabButton.bounds` appears stable enough to calculate the correct position reliably.
frame.origin.y = bounds.midY - labelFrame.height * 0.5
frame.size.height = labelFrame.height
}