Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ThirdParty/PSMTabBarControl/source/PSMTabBarCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@
@property(nonatomic) PSMProgress progress;
@property(nonatomic) BOOL isProcessing;
@property(nonatomic, assign) BOOL isPinned;
@property(nonatomic, assign) BOOL isGroupHeader;
@property(nonatomic, assign) BOOL isGroupMember;
@property(nonatomic, assign) BOOL isGroupCollapsed;
@property(nonatomic, assign) BOOL isGroupActive;
@property(nonatomic, assign) BOOL isMultiSelected;
@property(nonatomic, assign) CGFloat cellAlpha;
@property(nonatomic, assign) BOOL isAnimatingCollapse;
@property(nonatomic, copy) NSString *groupName;
@property(nonatomic, retain) NSColor *groupColor;
@property(nonatomic, assign) NSInteger groupMemberCount;

// creation/destruction
- (id)initWithControlView:(PSMTabBarControl *)controlView;
Expand Down
30 changes: 29 additions & 1 deletion ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,26 @@ @implementation PSMTabBarCell {
NSMutableArray<PSMCachedTitle *> *_subtitleCache;
NSTrackingArea *_cellTrackingArea;
NSTrackingArea *_closeButtonTrackingArea;
}
BOOL _isGroupHeader;
BOOL _isGroupMember;
BOOL _isGroupCollapsed;
BOOL _isGroupActive;
BOOL _isMultiSelected;
CGFloat _cellAlpha;
NSString *_groupName;
NSColor *_groupColor;
NSInteger _groupMemberCount;
}

@synthesize isGroupHeader = _isGroupHeader;
@synthesize isGroupMember = _isGroupMember;
@synthesize isGroupCollapsed = _isGroupCollapsed;
@synthesize isGroupActive = _isGroupActive;
@synthesize isMultiSelected = _isMultiSelected;
@synthesize cellAlpha = _cellAlpha;
@synthesize groupName = _groupName;
@synthesize groupColor = _groupColor;
@synthesize groupMemberCount = _groupMemberCount;

#pragma mark - Creation/Destruction

Expand All @@ -203,6 +222,15 @@ - (id)initWithControlView:(PSMTabBarControl *)controlView {
_hasCloseButton = YES;
_modifierString = [@"" copy];
_truncationStyle = NSLineBreakByTruncatingTail;
_isGroupHeader = NO;
_isGroupMember = NO;
_isGroupCollapsed = NO;
_isGroupActive = NO;
_isMultiSelected = NO;
_cellAlpha = 1.0;
_groupName = nil;
_groupColor = nil;
_groupMemberCount = 0;
[self setUpAccessibilityElement];
}
return self;
Expand Down
16 changes: 16 additions & 0 deletions ThirdParty/PSMTabBarControl/source/PSMTabBarControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ extern PSMTabBarControlOptionKey PSMTabBarControlOptionPUAFontProvider; // id<P
- (BOOL)tabViewShouldDragWindow:(NSTabView *)tabView event:(NSEvent *)event;
- (BOOL)tabViewShouldAllowDragOnAddTabButton:(NSTabView *)tabView;
- (CGFloat)tabViewDesiredTabBarHeight:(NSTabView *)tabView;
- (void)tabView:(NSTabView *)tabView didClickGroupHeaderTabViewItem:(NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)tabView doubleClickGroupHeaderTabViewItem:(NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)tabView willBeginDraggingGroupHeaderTabViewItem:(NSTabViewItem *)tabViewItem;
- (NSMenu *)tabView:(NSTabView *)tabView menuForGroupHeaderTabViewItem:(NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)tabView groupTabViewItems:(NSArray<NSTabViewItem *> *)tabViewItems;

@end

Expand Down Expand Up @@ -230,12 +235,22 @@ extern const CGFloat PSMTabBarProgressBarHeight;

// tab information
- (NSMutableArray *)representedTabViewItems;
- (NSMutableArray<PSMTabBarCell *> *)cells;
- (int)numberOfVisibleTabs;

// special effects
- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate;
- (void)update;
- (void)update:(BOOL)animate;
- (void)markNextInsertionsAsAnimated:(NSInteger)count;
- (void)beginCollapseAnimationForTabViewItems:(NSArray<NSTabViewItem *> *)items completion:(void (^)(void))completion;
- (void)cancelCollapseAnimation;
- (BOOL)isTabBarHidden;

// Frame of the cell displaying the given tab view item, in the receiver's
// coordinate system. Returns NSZeroRect if no cell currently shows the item.
- (NSRect)frameOfCellForTabViewItem:(NSTabViewItem *)item;

// internal bindings methods also used by the tab drag assistant
- (void)bindPropertiesForCell:(PSMTabBarCell *)cell andTabViewItem:(NSTabViewItem *)item;
- (void)removeTabForCell:(PSMTabBarCell *)cell;
Expand All @@ -245,6 +260,7 @@ extern const CGFloat PSMTabBarProgressBarHeight;
// Internal inset. Ensures nothing but background is drawn in this are.
@property(nonatomic, assign) NSEdgeInsets insets;
@property(nonatomic) CGFloat height;
@property(nonatomic, assign) BOOL lastDragWasGroupHeader;

- (void)setTabColor:(nullable NSColor *)aColor forTabViewItem:(NSTabViewItem *) tabViewItem;
- (nullable NSColor*)tabColorForTabViewItem:(NSTabViewItem*)tabViewItem;
Expand Down
Loading