mirror of
https://github.com/transmission/transmission
synced 2025-01-03 05:25:52 +00:00
#5109 Show expansion tooltip for abbreviated file names in the File table
This commit is contained in:
parent
8e0a157531
commit
a5971d289a
1 changed files with 26 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
||||||
#define PADDING_ABOVE_TITLE_FILE 2.0
|
#define PADDING_ABOVE_TITLE_FILE 2.0
|
||||||
#define PADDING_BELOW_STATUS_FILE 2.0
|
#define PADDING_BELOW_STATUS_FILE 2.0
|
||||||
#define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0
|
#define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0
|
||||||
|
#define PADDING_EXPANSION_FRAME 2.0
|
||||||
|
|
||||||
@interface FileNameCell (Private)
|
@interface FileNameCell (Private)
|
||||||
|
|
||||||
|
@ -142,6 +143,31 @@
|
||||||
[statusString drawInRect: statusRect];
|
[statusString drawInRect: statusRect];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSRect) expansionFrameWithFrame: (NSRect) cellFrame inView: (NSView *) view
|
||||||
|
{
|
||||||
|
NSAttributedString * titleString = [self attributedTitle];
|
||||||
|
NSRect realRect = [self rectForTitleWithString: titleString inBounds: cellFrame];
|
||||||
|
|
||||||
|
if ([titleString size].width > NSWidth(realRect)
|
||||||
|
&& NSMouseInRect([view convertPoint: [[view window] convertScreenToBase: [NSEvent mouseLocation]] fromView: nil], realRect, [view isFlipped]))
|
||||||
|
{
|
||||||
|
realRect.size.width = [titleString size].width;
|
||||||
|
return NSInsetRect(realRect, -PADDING_EXPANSION_FRAME, -PADDING_EXPANSION_FRAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NSZeroRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) drawWithExpansionFrame: (NSRect) cellFrame inView: (NSView *)view
|
||||||
|
{
|
||||||
|
cellFrame.origin.x += PADDING_EXPANSION_FRAME;
|
||||||
|
cellFrame.origin.y += PADDING_EXPANSION_FRAME;
|
||||||
|
|
||||||
|
[fTitleAttributes setObject: [NSColor controlTextColor] forKey: NSForegroundColorAttributeName];
|
||||||
|
NSAttributedString * titleString = [self attributedTitle];
|
||||||
|
[titleString drawInRect: cellFrame];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation FileNameCell (Private)
|
@implementation FileNameCell (Private)
|
||||||
|
|
Loading…
Reference in a new issue