-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Description
Does anyone aware of a proper way of making the title bar higher in Swift and window buttons (close, miniaturize and full-screen)?
I tried doing it like this:
DispatchQueue.main.async {
mainWindow?.standardWindowButton(.miniaturizeButton)?.frame.origin.y -= top
mainWindow?.standardWindowButton(.closeButton)?.frame.origin.y -= top
mainWindow?.standardWindowButton(.zoomButton)?.frame.origin.y -= top
mainWindow?.standardWindowButton(.miniaturizeButton)?.frame.origin.x += leading
mainWindow?.standardWindowButton(.closeButton)?.frame.origin.x += leading
mainWindow?.standardWindowButton(.zoomButton)?.frame.origin.x += leading
let buttonContainer = mainWindow?.standardWindowButton(.closeButton)?.superview
for subview in buttonContainer?.subviews ?? [] where subview is NSTextField {
subview.frame.origin.y -= top
}
}But whenever i swap View Controller to a one with different height, my window control buttons' positions get reset:
Here I made a demo repo:
https://github.com/kopyl/shifted-titlebar-buttons-failed-attempt
Metadata
Metadata
Assignees
Labels
No labels
