Do not use ‘autorecalculatesKeyViewLoop’ for chooser windows

Instead we manually call recalculatesKeyViewLoop on the window. This is because the auto-recalculation messes up. First time the window is brought up, it works fine, but the second time, nextValidKeyView will return ‘nil’ for the last view (causing the key view loop to not be a loop).
This commit is contained in:
Allan Odgaard
2014-03-12 21:16:47 +07:00
parent 67e8c23b3b
commit 5aea3fb50a

View File

@@ -100,10 +100,9 @@ NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (std::string
[_window setContentBorderThickness:23 forEdge:NSMinYEdge];
[[_window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
[[_window standardWindowButton:NSWindowZoomButton] setHidden:YES];
_window.autorecalculatesKeyViewLoop = YES;
_window.delegate = self;
_window.level = NSFloatingWindowLevel;
_window.releasedWhenClosed = NO;
_window.delegate = self;
_window.level = NSFloatingWindowLevel;
_window.releasedWhenClosed = NO;
}
return self;
}
@@ -125,6 +124,7 @@ NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (std::string
- (void)showWindow:(id)sender
{
[_window recalculateKeyViewLoop];
[_window makeKeyAndOrderFront:self];
[_window makeFirstResponder:_searchField];
}