Skip to content
This repository was archived by the owner on Nov 19, 2019. It is now read-only.

Commit 6f443e2

Browse files
author
Frank Dowsett
committed
AdiumTabStyle: adjust the icon in vertical tabs when the indicator is shown.
1 parent ddcbc6d commit 6f443e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Source/PSMAdiumTabStyle.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,13 @@ - (NSRect)iconRectForBounds:(NSRect)theRect ofTabCell:(PSMTabBarCell *)cell {
318318
if (orientation == PSMTabBarHorizontalOrientation) {
319319
result = NSMakeRect(drawingRect.origin.x, drawingRect.origin.y, scaledIconSize.width, scaledIconSize.height);
320320
} else {
321-
result = NSMakeRect(NSMaxX(drawingRect)-scaledIconSize.width, drawingRect.origin.y, scaledIconSize.width, scaledIconSize.height);
321+
NSRect constrainedDrawingRect = drawingRect;
322+
323+
NSRect indicatorRect = [cell indicatorRectForBounds:theRect];
324+
if (!NSEqualRects(indicatorRect, NSZeroRect))
325+
constrainedDrawingRect.size.width -= NSWidth(indicatorRect) + kPSMTabBarCellPadding;
326+
327+
result = NSMakeRect(NSMaxX(constrainedDrawingRect)-scaledIconSize.width, drawingRect.origin.y, scaledIconSize.width, scaledIconSize.height);
322328
}
323329

324330
// center in available space (in case icon image is smaller than kPSMTabBarIconWidth)

0 commit comments

Comments
 (0)