Skip to content

Fix alignment of main window search field #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2019
Merged
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
10 changes: 10 additions & 0 deletions GitUp/Application/Document.m
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController {
_titleView.wantsLayer = YES;
_rightView.wantsLayer = YES;

if (@available(macOS 10.11, *)) {
// Fields have different alignment rects from their bounds starting in 10.11
// and will appear slightly small when laid out just by autoresizing.
// Manually make it its preferred height to align with the snapshots button.
CGRect searchFieldFrame = _searchField.frame;
searchFieldFrame.size.height = [_searchField sizeThatFits:searchFieldFrame.size].height;
searchFieldFrame.origin.y = floor(NSMidY(_snapshotsButton.frame) - (searchFieldFrame.size.height / 2));
_searchField.frame = searchFieldFrame;
}

// Text fields must be drawn on an opaque background to avoid subpixel antialiasing issues during animation.
for (NSTextField* field in @[ _infoTextField1, _infoTextField2, _progressTextField ]) {
field.drawsBackground = YES;
Expand Down