From 342152ea71b3ec1349d60a58bf447a1a738b88a8 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 30 Jan 2013 18:54:37 +0100 Subject: [PATCH] Remove light gray line above tabs --- .../DocumentWindow/src/ProjectLayoutView.mm | 26 +++---- Frameworks/OakAppKit/resources/TabBar.plist | 72 +++++++++---------- Frameworks/OakAppKit/src/OakTabBarView.mm | 2 +- 3 files changed, 46 insertions(+), 54 deletions(-) diff --git a/Frameworks/DocumentWindow/src/ProjectLayoutView.mm b/Frameworks/DocumentWindow/src/ProjectLayoutView.mm index 1a74a5a7..71196119 100644 --- a/Frameworks/DocumentWindow/src/ProjectLayoutView.mm +++ b/Frameworks/DocumentWindow/src/ProjectLayoutView.mm @@ -11,8 +11,7 @@ NSString* const kUserDefaultsHTMLOutputSizeKey = @"htmlOutputSize"; @interface ProjectLayoutView () @property (nonatomic, retain) NSView* fileBrowserDivider; @property (nonatomic, retain) NSView* htmlOutputDivider; -@property (nonatomic, retain) NSView* fileBrowserTopLightDivider; -@property (nonatomic, retain) NSView* fileBrowserTopDarkDivider; +@property (nonatomic, retain) NSView* fileBrowserTopDivider; @property (nonatomic, retain) NSLayoutConstraint* fileBrowserWidthConstraint; @property (nonatomic, retain) NSLayoutConstraint* htmlOutputSizeConstraint; @property (nonatomic, retain) NSMutableArray* myConstraints; @@ -113,8 +112,7 @@ NSString* const kUserDefaultsHTMLOutputSizeKey = @"htmlOutputSize"; if(_tabsAboveDocument != flag) { _tabsAboveDocument = flag; - _fileBrowserTopLightDivider = [self replaceView:_fileBrowserTopLightDivider withView:flag ? OakCreateHorizontalLine([NSColor colorWithString:@"#AEAEAE"], [NSColor colorWithString:@"#C9C9C9"]) : nil]; - _fileBrowserTopDarkDivider = [self replaceView:_fileBrowserTopDarkDivider withView:flag ? OakCreateHorizontalLine([NSColor colorWithString:@"#3F3F3F"], [NSColor colorWithString:@"#878787"]) : nil]; + _fileBrowserTopDivider = [self replaceView:_fileBrowserTopDivider withView:flag ? OakCreateHorizontalLine([NSColor colorWithString:@"#3F3F3F"], [NSColor colorWithString:@"#878787"]) : nil]; [self setNeedsUpdateConstraints:YES]; } } @@ -134,8 +132,7 @@ NSString* const kUserDefaultsHTMLOutputSizeKey = @"htmlOutputSize"; @"documentView" : _documentView, @"fileBrowserView" : _fileBrowserView ?: [NSNull null], @"fileBrowserDivider" : _fileBrowserDivider ?: [NSNull null], - @"fileBrowserTopDarkDivider" : _fileBrowserTopDarkDivider ?: [NSNull null], - @"fileBrowserTopLightDivider" : _fileBrowserTopLightDivider ?: [NSNull null], + @"fileBrowserTopDivider" : _fileBrowserTopDivider ?: [NSNull null], @"htmlOutputView" : _htmlOutputView ?: [NSNull null], @"htmlOutputDivider" : _htmlOutputDivider ?: [NSNull null], }; @@ -196,34 +193,31 @@ NSString* const kUserDefaultsHTMLOutputSizeKey = @"htmlOutputSize"; // top if(_tabsAboveDocument) { - CONSTRAINT(@"V:|[fileBrowserTopLightDivider][fileBrowserTopDarkDivider][fileBrowserView]", 0); - CONSTRAINT(@"V:|[fileBrowserTopLightDivider][fileBrowserTopDarkDivider][fileBrowserDivider]", 0); + CONSTRAINT(@"V:|[fileBrowserTopDivider][fileBrowserView]", 0); + CONSTRAINT(@"V:|[fileBrowserTopDivider][fileBrowserDivider]", 0); // left if(_fileBrowserOnRight && _htmlOutputView && _htmlOutputOnRight) { - CONSTRAINT(@"H:[htmlOutputView][fileBrowserTopLightDivider]", 0); - CONSTRAINT(@"H:[htmlOutputView][fileBrowserTopDarkDivider]", 0); + CONSTRAINT(@"H:[htmlOutputView][fileBrowserTopDivider]", 0); } else if(_fileBrowserOnRight) { - CONSTRAINT(@"H:[documentView][fileBrowserTopLightDivider]", 0); - CONSTRAINT(@"H:[documentView][fileBrowserTopDarkDivider]", 0); + CONSTRAINT(@"H:[documentView][fileBrowserTopDivider]", 0); } else { - CONSTRAINT(@"H:|[fileBrowserTopLightDivider]", 0); - CONSTRAINT(@"H:|[fileBrowserTopDarkDivider]", 0); + CONSTRAINT(@"H:|[fileBrowserTopDivider]", 0); } // right if(_fileBrowserOnRight) { - CONSTRAINT(@"H:[fileBrowserTopLightDivider(==fileBrowserTopDarkDivider)]|", 0); + CONSTRAINT(@"H:[fileBrowserTopDivider]|", 0); } else { - CONSTRAINT(@"H:[fileBrowserTopLightDivider(==fileBrowserTopDarkDivider)][documentView]", 0); + CONSTRAINT(@"H:[fileBrowserTopDivider][documentView]", 0); } } else diff --git a/Frameworks/OakAppKit/resources/TabBar.plist b/Frameworks/OakAppKit/resources/TabBar.plist index 17de3d40..84b2123e 100644 --- a/Frameworks/OakAppKit/resources/TabBar.plist +++ b/Frameworks/OakAppKit/resources/TabBar.plist @@ -12,53 +12,51 @@ background = ( { rect = ( 0, W-1, 0, 0 ); color = '#3F3F3F'; requisite = window_main_or_key; }, { rect = ( 0, W-1, 1, 1 ); color = '#999999'; requisite = window_main_or_key; }, - { rect = ( 0, W-1, 2, H-3 ); color = '#777777'; requisite = window_main_or_key; }, - { rect = ( 0, W-1, H-2, H-2 ); color = '#3F3F3F'; requisite = window_main_or_key; }, - { rect = ( 0, W-1, H-1, H-1 ); color = '#AEAEAE'; requisite = window_main_or_key; }, + { rect = ( 0, W-1, 2, H-2 ); color = '#777777'; requisite = window_main_or_key; }, + { rect = ( 0, W-1, H-1, H-1 ); color = '#3F3F3F'; requisite = window_main_or_key; }, { rect = ( 0, W-1, 0, 0 ); color = '#878787'; requisiteMask = window_main_or_key; }, { rect = ( 0, W-1, 1, 1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; }, - { rect = ( 0, W-1, 2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, - { rect = ( 0, W-1, H-2, H-2 ); color = '#878787'; requisiteMask = window_main_or_key; }, - { rect = ( 0, W-1, H-1, H-1 ); color = '#C9C9C9'; requisiteMask = window_main_or_key; }, + { rect = ( 0, W-1, 2, H-2 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, + { rect = ( 0, W-1, H-1, H-1 ); color = '#878787'; requisiteMask = window_main_or_key; }, - { rect = ( 0, W, 2, H-3 ); action = 'didDoubleClickTabBar:'; requisite = mouse_double_clicked; }, + { rect = ( 0, W, 2, H-2 ); action = 'didDoubleClickTabBar:'; requisite = mouse_double_clicked; }, ); tab = ( // Right border - { rect = ( W-1, W-1, 2, H-3 ); color = '#8C8C8C'; requisite = window_main_or_key; }, + { rect = ( W-1, W-1, 2, H-2 ); color = '#8C8C8C'; requisite = window_main_or_key; }, { rect = ( W-1, W-1, 1, 1 ); color = '#A8A8A8'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|dragged'; }, - { rect = ( W-1, W-1, 2, H-3 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key'; }, + { rect = ( W-1, W-1, 2, H-2 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key'; }, { rect = ( W-1, W-1, 1, 1 ); color = '#C5C5C5'; requisiteMask = 'window_main_or_key|dragged'; }, // Splitter between tabs (1 px to the right of our current) - { rect = ( W, W, 2, H-3 ); color = '#3B3B3B'; requisite = window_main_or_key; }, + { rect = ( W, W, 2, H-2 ); color = '#3B3B3B'; requisite = window_main_or_key; }, { rect = ( W, W, 1, 1 ); color = '#4B4B4B'; requisite = window_main_or_key; }, - { rect = ( W, W, 2, H-3 ); color = '#525252'; requisiteMask = window_main_or_key; }, + { rect = ( W, W, 2, H-2 ); color = '#525252'; requisiteMask = window_main_or_key; }, { rect = ( W, W, 1, 1 ); color = '#5D5D5D'; requisiteMask = window_main_or_key; }, // Background – first tab - { rect = ("-${firstTabOffset}", W-2, 2, H-3 ); color = '#777777'; requisite = 'window_main_or_key|first'; requisiteMask = 'window_main_or_key|first'; }, - { rect = ("-${firstTabOffset}", W-2, 2, H-3 ); color = '#A5A5A5'; requisite = 'first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, - { rect = ("-${firstTabOffset}", W-2, 2, H-3 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, - { rect = ("-${firstTabOffset}", W-2, 2, H-3 ); color = '#979797'; requisite = 'mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("-${firstTabOffset}", W-2, 2, H-2 ); color = '#777777'; requisite = 'window_main_or_key|first'; requisiteMask = 'window_main_or_key|first'; }, + { rect = ("-${firstTabOffset}", W-2, 2, H-2 ); color = '#A5A5A5'; requisite = 'first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("-${firstTabOffset}", W-2, 2, H-2 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("-${firstTabOffset}", W-2, 2, H-2 ); color = '#979797'; requisite = 'mouse_inside|first'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, // Background – other tabs - { rect = ("1", W-2, 2, H-3 ); color = '#777777'; requisite = 'window_main_or_key'; requisiteMask = 'window_main_or_key|first'; }, - { rect = ("1", W-2, 2, H-3 ); color = '#A5A5A5'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, - { rect = ("1", W-2, 2, H-3 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, - { rect = ("1", W-2, 2, H-3 ); color = '#979797'; requisite = 'mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("1", W-2, 2, H-2 ); color = '#777777'; requisite = 'window_main_or_key'; requisiteMask = 'window_main_or_key|first'; }, + { rect = ("1", W-2, 2, H-2 ); color = '#A5A5A5'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("1", W-2, 2, H-2 ); color = '#6E6E6E'; requisite = 'window_main_or_key|mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, + { rect = ("1", W-2, 2, H-2 ); color = '#979797'; requisite = 'mouse_inside'; requisiteMask = 'window_main_or_key|mouse_inside|first'; }, // Left border — first tab should not have this - { rect = ( 0, 0, 2, H-3 ); color = '#8C8C8C'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; }, + { rect = ( 0, 0, 2, H-2 ); color = '#8C8C8C'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; }, { rect = ( 0, 0, 1, 1 ); color = '#A8A8A8'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first|dragged'; }, - { rect = ( 0, 0, 2, H-3 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key|first'; }, + { rect = ( 0, 0, 2, H-2 ); color = '#B2B2B2'; requisiteMask = 'window_main_or_key|first'; }, { rect = ( 0, 0, 1, 1 ); color = '#C5C5C5'; requisiteMask = 'window_main_or_key|first|dragged'; }, // Splitter between tabs (1 px to the left of our current) - { rect = ( -1, -1, 2, H-3 ); color = '#3B3B3B'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; }, + { rect = ( -1, -1, 2, H-2 ); color = '#3B3B3B'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; }, { rect = ( -1, -1, 1, 1 ); color = '#4B4B4B'; requisite = window_main_or_key; requisiteMask = 'window_main_or_key|first'; }, - { rect = ( -1, -1, 2, H-3 ); color = '#525252'; requisiteMask = 'window_main_or_key|first'; }, + { rect = ( -1, -1, 2, H-2 ); color = '#525252'; requisiteMask = 'window_main_or_key|first'; }, { rect = ( -1, -1, 1, 1 ); color = '#5D5D5D'; requisiteMask = 'window_main_or_key|first'; }, { include = tabMain; }, @@ -69,18 +67,18 @@ { rect = ( W, "W+1", 1, 1 ); color = '#999999'; requisite = window_main_or_key; }, { rect = ( -2, -1, 1, 1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; }, { rect = ( W, "W+1", 1, 1 ); color = '#BBBBBB'; requisiteMask = window_main_or_key; }, - { rect = ( -1, W, 2, H-1 ); color = 'windowBackgroundColor'; requisite = window_main_or_key; }, - { rect = ( -1, W, 2, H-1 ); color = 'windowBackgroundColor'; requisiteMask = window_main_or_key; }, + { rect = ( -1, W, 2, H ); color = 'windowBackgroundColor'; requisite = window_main_or_key; }, + { rect = ( -1, W, 2, H ); color = 'windowBackgroundColor'; requisiteMask = window_main_or_key; }, - { rect = ( -2, -2, 2, H-3 ); color = '#777777'; requisite = window_main_or_key; }, - { rect = ( -2, -2, 2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, - { rect = ( -1, -1, 2, H-2 ); color = '#575757'; requisite = window_main_or_key; }, - { rect = ( -1, -1, 2, H-2 ); color = '#797979'; requisiteMask = window_main_or_key; }, + { rect = ( -2, -2, 2, H-2 ); color = '#777777'; requisite = window_main_or_key; }, + { rect = ( -2, -2, 2, H-2 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, + { rect = ( -1, -1, 2, H-1 ); color = '#575757'; requisite = window_main_or_key; }, + { rect = ( -1, -1, 2, H-1 ); color = '#797979'; requisiteMask = window_main_or_key; }, - { rect = ( "W+1", "W+1", 2, H-3 ); color = '#777777'; requisite = window_main_or_key; }, - { rect = ( "W+1", "W+1", 2, H-3 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, - { rect = ( W, W, 2, H-2 ); color = '#575757'; requisite = window_main_or_key; }, - { rect = ( W, W, 2, H-2 ); color = '#797979'; requisiteMask = window_main_or_key; }, + { rect = ( "W+1", "W+1", 2, H-2 ); color = '#777777'; requisite = window_main_or_key; }, + { rect = ( "W+1", "W+1", 2, H-2 ); color = '#A5A5A5'; requisiteMask = window_main_or_key; }, + { rect = ( W, W, 2, H-1 ); color = '#575757'; requisite = window_main_or_key; }, + { rect = ( W, W, 2, H-1 ); color = '#797979'; requisiteMask = window_main_or_key; }, { rect = ( 0, W, 2, 2 ); color = '#575757'; requisite = window_main_or_key; }, { rect = ( 0, W, 2, 2 ); color = '#797979'; requisiteMask = window_main_or_key; }, @@ -142,10 +140,10 @@ // ============ tabMain = ( - { rect = ( 1, W-2, 2, H-3 ); action = 'selectTab:'; requisite = mouse_clicked; toolTip = 1; }, - { rect = ( 1, W-2, 2, H-3 ); action = 'dragTab:'; requisite = mouse_dragged; }, - { rect = ( 1, W-2, 2, H-3 ); action = 'didDoubleClickTab:'; requisite = mouse_double_clicked; }, - { rect = ( 23, W-8, 4, H-6 ); text = { shadow = 1; }; }, + { rect = ( 1, W-2, 2, H-2 ); action = 'selectTab:'; requisite = mouse_clicked; toolTip = 1; }, + { rect = ( 1, W-2, 2, H-2 ); action = 'dragTab:'; requisite = mouse_dragged; }, + { rect = ( 1, W-2, 2, H-2 ); action = 'didDoubleClickTab:'; requisite = mouse_double_clicked; }, + { rect = ( 23, W-8, 4, H-5 ); text = { shadow = 1; }; }, { rect = ( 3, 14, 4, 16 ); requisiteMask = 'mouse_inside|modified'; requisite = ''; image = "TabClose"; }, { rect = ( 3, 14, 4, 16 ); requisiteMask = 'mouse_inside|modified'; requisite = 'modified'; image = "TabClose_Modified"; }, diff --git a/Frameworks/OakAppKit/src/OakTabBarView.mm b/Frameworks/OakAppKit/src/OakTabBarView.mm index c9bf6d69..80c9b61b 100644 --- a/Frameworks/OakAppKit/src/OakTabBarView.mm +++ b/Frameworks/OakAppKit/src/OakTabBarView.mm @@ -685,7 +685,7 @@ static id SafeObjectAtIndex (NSArray* array, NSUInteger index) - (NSSize)intrinsicContentSize { - return NSMakeSize(NSViewNoInstrinsicMetric, self.isExpanded ? 23 : 1); + return NSMakeSize(NSViewNoInstrinsicMetric, self.isExpanded ? 22 : 1); } - (void)viewFrameChanged:(NSNotification*)aNotification