Skip to content

Commit

Permalink
Lightened titlebar separator and made it adjust its color when window…
Browse files Browse the repository at this point in the history
… is in background.
  • Loading branch information
fjolnir committed Jul 23, 2015
1 parent 5a1f451 commit cc590d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions sources/PseudoTerminal.m
Original file line number Diff line number Diff line change
Expand Up @@ -2321,6 +2321,8 @@ - (void)windowDidBecomeKey:(NSNotification *)aNotification {
[self editSession:self.currentSession makeKey:NO];
}
[self notifyTmuxOfTabChange];

[_contentView updateDivisionView];
}

- (void)makeCurrentSessionFirstResponder
Expand Down Expand Up @@ -2583,6 +2585,8 @@ - (void)windowDidResignKey:(NSNotification *)aNotification {
for (PTYSession* aSession in [self allSessions]) {
[aSession setFocused:NO];
}

[_contentView updateDivisionView];
}

// Returns the hotkey window that should be hidden or nil if the hotkey window
Expand Down
6 changes: 6 additions & 0 deletions sources/SolidColorView.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ - (void)setColor:(NSColor*)color
{
[color_ autorelease];
color_ = [color retain];
[self setNeedsDisplay:YES];
}

- (NSColor*)color
Expand All @@ -50,4 +51,9 @@ - (void)setFlipped:(BOOL)value
isFlipped_ = value;
}

- (void)dealloc
{
[color_ release];
[super dealloc];
}
@end
2 changes: 1 addition & 1 deletion sources/iTermRootTerminalView.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern const CGFloat kLeftTabsWidth;
// Gray line dividing tab/title bar from content. Will be nil if a division
// view isn't needed such as for fullscreen windows or windows without a
// title bar (e.g., top-of-screen).
@property(nonatomic, readonly) NSView *divisionView;
@property(nonatomic, readonly) SolidColorView *divisionView;

// Toolbelt view. Goes on the right side of the terminal window, if visible.
@property(nonatomic, readonly) iTermToolbeltView *toolbelt;
Expand Down
9 changes: 5 additions & 4 deletions sources/iTermRootTerminalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ @interface iTermRootTerminalView()

@property(nonatomic, retain) PTYTabView *tabView;
@property(nonatomic, retain) iTermTabBarControlView *tabBarControl;
@property(nonatomic, retain) NSView *divisionView;
@property(nonatomic, retain) SolidColorView *divisionView;
@property(nonatomic, retain) iTermToolbeltView *toolbelt;

@end


Expand Down Expand Up @@ -126,11 +125,13 @@ - (void)updateDivisionView {
self.bounds.size.width,
kDivisionViewHeight);
if (!_divisionView) {
_divisionView = [[SolidColorView alloc] initWithFrame:divisionViewFrame
color:[NSColor darkGrayColor]];
_divisionView = [[SolidColorView alloc] initWithFrame:divisionViewFrame];
_divisionView.autoresizingMask = (NSViewWidthSizable | NSViewMinYMargin);
[self addSubview:_divisionView];
}
_divisionView.color = self.window.isKeyWindow
? [NSColor colorWithCalibratedHue:1 saturation:0 brightness:0.49 alpha:1]
: [NSColor colorWithCalibratedHue:1 saturation:0 brightness:0.65 alpha:1];
_divisionView.frame = divisionViewFrame;
} else if (_divisionView) {
// Remove existing division
Expand Down

0 comments on commit cc590d5

Please sign in to comment.