diff options
author | rowanbeentje <rowan@beent.je> | 2012-12-13 00:14:06 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-12-13 00:14:06 +0000 |
commit | 3b5642c68f57865888b60a1f846fed3810333dae (patch) | |
tree | 8d76fa2dda27594b369421cb5099b5b8dd8726c6 /Frameworks/PSMTabBar/PSMTabBarControl.m | |
parent | 9c0184ce97a1e158d926afb8e4be034c61999563 (diff) | |
download | sequelpro-3b5642c68f57865888b60a1f846fed3810333dae.tar.gz sequelpro-3b5642c68f57865888b60a1f846fed3810333dae.tar.bz2 sequelpro-3b5642c68f57865888b60a1f846fed3810333dae.zip |
- Add Retina versions of the tab close buttons
- Recompress other PSMTabBar images where necessary
- Improve drawing of the tab bar in response to window state change, allowing better colour display in edge cases and particularly when sheets are open
Diffstat (limited to 'Frameworks/PSMTabBar/PSMTabBarControl.m')
-rw-r--r-- | Frameworks/PSMTabBar/PSMTabBarControl.m | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 2a92a2b1..6a062efe 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -244,8 +244,8 @@ - (void)viewWillMoveToWindow:(NSWindow *)aWindow { NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil]; - [center removeObserver:self name:NSWindowDidResignKeyNotification object:nil]; + [center removeObserver:self name:NSWindowDidBecomeMainNotification object:nil]; + [center removeObserver:self name:NSWindowDidResignMainNotification object:nil]; [center removeObserver:self name:NSWindowDidUpdateNotification object:nil]; [center removeObserver:self name:NSWindowDidMoveNotification object:nil]; @@ -262,6 +262,9 @@ } } +/** + * Allow a window to be redrawn in response to changes in position or focus level. + */ - (void)windowStatusDidChange:(NSNotification *)notification { [self setNeedsDisplay:YES]; @@ -1747,7 +1750,8 @@ { // hide? must readjust things if I'm not supposed to be showing // this block of code only runs when the app launches - if ([self hideForSingleTab] && ([_cells count] <= 1) && !_awakenedFromNib) { + if (!_awakenedFromNib && [self hideForSingleTab] && ([_cells count] <= 1)) { + // must adjust frames now before display NSRect myFrame = [self frame]; if ([self orientation] == PSMTabBarHorizontalOrientation) { @@ -1801,12 +1805,12 @@ [[self delegate] tabView:[self tabView] tabBarDidHide:self]; } } - + + // The above tasks only needs to be run once, so set a flag to ensure that _awakenedFromNib = YES; + + // Allow the tab bar to redraw itself in result to window ordering/sheet/etc changes [self setNeedsDisplay:YES]; - - //we only need to do this once - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidUpdateNotification object:nil]; } #pragma mark - |