@@ -52,8 +52,6 @@ @interface SPWindowController ()
52
52
53
53
- (void )_setUpTabBar ;
54
54
- (void )_updateProgressIndicatorForItem : (NSTabViewItem *)theItem ;
55
- - (void )_createTitleBarLineHidingView ;
56
- - (void )_updateLineHidingViewState ;
57
55
- (void )_switchOutSelectedTableDocument : (SPDatabaseDocument *)newDoc ;
58
56
- (void )_selectedTableDocumentDeallocd : (NSNotification *)notification ;
59
57
@end
@@ -69,9 +67,6 @@ - (void)awakeFromNib
69
67
70
68
[[self window ] setCollectionBehavior: [[self window ] collectionBehavior ] | NSWindowCollectionBehaviorFullScreenPrimary];
71
69
72
- // Add a line to the window to hide the line below the title bar when the toolbar is collapsed
73
- [self _createTitleBarLineHidingView ];
74
-
75
70
// Disable automatic cascading - this occurs before the size is set, so let the app
76
71
// controller apply cascading after frame autosaving.
77
72
[self setShouldCascadeWindows: NO ];
@@ -88,7 +83,6 @@ - (void)awakeFromNib
88
83
// Register for drag start and stop notifications - used to show/hide tab bars
89
84
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (tabDragStarted: ) name: PSMTabDragDidBeginNotification object: nil ];
90
85
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (tabDragStopped: ) name: PSMTabDragDidEndNotification object: nil ];
91
- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (_updateLineHidingViewState ) name: SPWindowToolbarDidToggleNotification object: nil ];
92
86
93
87
// Because we are a document-based app we automatically adopt window restoration on 10.7+.
94
88
// However that causes a race condition with our own window setup code.
@@ -510,49 +504,6 @@ - (void)_updateProgressIndicatorForItem:(NSTabViewItem *)theItem
510
504
[theDocument addObserver: self forKeyPath: @" isProcessing" options: 0 context: nil ];
511
505
}
512
506
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
-
556
507
557
508
- (void )_switchOutSelectedTableDocument : (SPDatabaseDocument *)newDoc
558
509
{
0 commit comments