Skip to content

Commit ddc5c78

Browse files
committed
#2434 remove title bar line hiding view
1 parent b9d8d64 commit ddc5c78

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

Source/SPWindowController.m

-49
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ @interface SPWindowController ()
5252

5353
- (void)_setUpTabBar;
5454
- (void)_updateProgressIndicatorForItem:(NSTabViewItem *)theItem;
55-
- (void)_createTitleBarLineHidingView;
56-
- (void)_updateLineHidingViewState;
5755
- (void)_switchOutSelectedTableDocument:(SPDatabaseDocument *)newDoc;
5856
- (void)_selectedTableDocumentDeallocd:(NSNotification *)notification;
5957
@end
@@ -69,9 +67,6 @@ - (void)awakeFromNib
6967

7068
[[self window] setCollectionBehavior:[[self window] collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
7169

72-
// Add a line to the window to hide the line below the title bar when the toolbar is collapsed
73-
[self _createTitleBarLineHidingView];
74-
7570
// Disable automatic cascading - this occurs before the size is set, so let the app
7671
// controller apply cascading after frame autosaving.
7772
[self setShouldCascadeWindows:NO];
@@ -88,7 +83,6 @@ - (void)awakeFromNib
8883
// Register for drag start and stop notifications - used to show/hide tab bars
8984
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabDragStarted:) name:PSMTabDragDidBeginNotification object:nil];
9085
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabDragStopped:) name:PSMTabDragDidEndNotification object:nil];
91-
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateLineHidingViewState) name:SPWindowToolbarDidToggleNotification object:nil];
9286

9387
// Because we are a document-based app we automatically adopt window restoration on 10.7+.
9488
// However that causes a race condition with our own window setup code.
@@ -510,49 +504,6 @@ - (void)_updateProgressIndicatorForItem:(NSTabViewItem *)theItem
510504
[theDocument addObserver:self forKeyPath:@"isProcessing" options:0 context:nil];
511505
}
512506

513-
/**
514-
* Create a view which is used to hide the line underneath the window title bar when the
515-
* toolbar is hidden, improving appearance when tabs are visible (or collapsed!)
516-
*/
517-
- (void)_createTitleBarLineHidingView
518-
{
519-
float titleBarHeight = 21.f;
520-
NSSize windowSize = [self window].frame.size;
521-
522-
titleBarLineHidingView = [[[NSClipView alloc] init] autorelease];
523-
524-
// Set the original size and the autosizing mask to preserve it
525-
[titleBarLineHidingView setFrame:NSMakeRect(0, windowSize.height - titleBarHeight - 1, windowSize.width, 1)];
526-
[titleBarLineHidingView setAutoresizingMask:(NSViewWidthSizable | NSViewMinYMargin)];
527-
528-
[self _updateLineHidingViewState];
529-
530-
// Add the view to the window
531-
[[[[self window] contentView] superview] addSubview:titleBarLineHidingView];
532-
}
533-
534-
/**
535-
* Update the visibility and colour of the title bar line hiding view
536-
*/
537-
- (void)_updateLineHidingViewState
538-
{
539-
// Set the background colour to match the titlebar window state
540-
if ((([[self window] isMainWindow] || [[[self window] attachedSheet] isMainWindow]) && [NSApp isActive])) {
541-
[titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(isOSVersionAtLeast10_7_0) ? 0.66f : 0.63f alpha:1.0]];
542-
}
543-
else {
544-
[titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(isOSVersionAtLeast10_7_0) ? 0.87f : 0.84f alpha:1.0]];
545-
}
546-
547-
// If the window is fullscreen or the toolbar is showing, hide the view; otherwise show it
548-
if (([[self window] styleMask] & NSFullScreenWindowMask) || [[[self window] toolbar] isVisible] || ![[self window] toolbar]) {
549-
[titleBarLineHidingView setHidden:YES];
550-
}
551-
else {
552-
[titleBarLineHidingView setHidden:NO];
553-
}
554-
}
555-
556507

557508
- (void)_switchOutSelectedTableDocument:(SPDatabaseDocument *)newDoc
558509
{

0 commit comments

Comments
 (0)