mirror of
https://github.com/transmission/transmission
synced 2025-02-23 06:30:38 +00:00
allow transfers to be dragged when status fields are hit; trivial efficiency improvements when drawing torrent cells
This commit is contained in:
parent
9f3a13f1b4
commit
131a79c702
1 changed files with 10 additions and 12 deletions
|
@ -163,12 +163,18 @@
|
||||||
|
|
||||||
- (NSRect) minimalStatusRectForBounds: (NSRect) bounds
|
- (NSRect) minimalStatusRectForBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
|
if (![fDefaults boolForKey: @"SmallView"])
|
||||||
|
return NSZeroRect;
|
||||||
|
|
||||||
return [self rectForMinimalStatusWithString: [self attributedStatusString: [self minimalStatusString] withColor: nil]
|
return [self rectForMinimalStatusWithString: [self attributedStatusString: [self minimalStatusString] withColor: nil]
|
||||||
inBounds: bounds];
|
inBounds: bounds];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRect) progressRectForBounds: (NSRect) bounds
|
- (NSRect) progressRectForBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
|
if ([fDefaults boolForKey: @"SmallView"])
|
||||||
|
return NSZeroRect;
|
||||||
|
|
||||||
return [self rectForProgressWithString: [self attributedStatusString: [[self representedObject] progressString] withColor: nil]
|
return [self rectForProgressWithString: [self attributedStatusString: [[self representedObject] progressString] withColor: nil]
|
||||||
inBounds: bounds];
|
inBounds: bounds];
|
||||||
}
|
}
|
||||||
|
@ -194,6 +200,9 @@
|
||||||
|
|
||||||
- (NSRect) statusRectForBounds: (NSRect) bounds
|
- (NSRect) statusRectForBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
|
if ([fDefaults boolForKey: @"SmallView"])
|
||||||
|
return NSZeroRect;
|
||||||
|
|
||||||
return [self rectForStatusWithString: [self attributedStatusString: [self statusString] withColor: nil] inBounds: bounds];
|
return [self rectForStatusWithString: [self attributedStatusString: [self statusString] withColor: nil] inBounds: bounds];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,9 +257,7 @@
|
||||||
NSPoint point = [controlView convertPoint: [event locationInWindow] fromView: nil];
|
NSPoint point = [controlView convertPoint: [event locationInWindow] fromView: nil];
|
||||||
|
|
||||||
if (NSMouseInRect(point, [self controlButtonRectForBounds: cellFrame], [controlView isFlipped])
|
if (NSMouseInRect(point, [self controlButtonRectForBounds: cellFrame], [controlView isFlipped])
|
||||||
|| NSMouseInRect(point, [self revealButtonRectForBounds: cellFrame], [controlView isFlipped])
|
|| NSMouseInRect(point, [self revealButtonRectForBounds: cellFrame], [controlView isFlipped]))
|
||||||
|| (NSMouseInRect(point, [self progressRectForBounds: cellFrame], [controlView isFlipped]) && [[self representedObject] folder])
|
|
||||||
|| NSMouseInRect(point, [self minimalStatusRectForBounds: cellFrame], [controlView isFlipped]))
|
|
||||||
return NSCellHitContentArea | NSCellHitTrackableArea;
|
return NSCellHitContentArea | NSCellHitTrackableArea;
|
||||||
|
|
||||||
return NSCellHitContentArea;
|
return NSCellHitContentArea;
|
||||||
|
@ -778,9 +785,6 @@
|
||||||
|
|
||||||
- (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
- (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
if (![fDefaults boolForKey: @"SmallView"])
|
|
||||||
return NSZeroRect;
|
|
||||||
|
|
||||||
NSRect result = bounds;
|
NSRect result = bounds;
|
||||||
result.size = [string size];
|
result.size = [string size];
|
||||||
|
|
||||||
|
@ -808,9 +812,6 @@
|
||||||
|
|
||||||
- (NSRect) rectForProgressWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
- (NSRect) rectForProgressWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
if ([fDefaults boolForKey: @"SmallView"])
|
|
||||||
return NSZeroRect;
|
|
||||||
|
|
||||||
NSRect result = bounds;
|
NSRect result = bounds;
|
||||||
result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS;
|
result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS;
|
||||||
result.origin.x += PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
|
result.origin.x += PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
|
||||||
|
@ -823,9 +824,6 @@
|
||||||
|
|
||||||
- (NSRect) rectForStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
- (NSRect) rectForStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
||||||
{
|
{
|
||||||
if ([fDefaults boolForKey: @"SmallView"])
|
|
||||||
return NSZeroRect;
|
|
||||||
|
|
||||||
NSRect result = bounds;
|
NSRect result = bounds;
|
||||||
result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS
|
result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS
|
||||||
+ PADDING_BETWEEN_PROGRESS_AND_BAR + BAR_HEIGHT + PADDING_BETWEEN_BAR_AND_STATUS;
|
+ PADDING_BETWEEN_PROGRESS_AND_BAR + BAR_HEIGHT + PADDING_BETWEEN_BAR_AND_STATUS;
|
||||||
|
|
Loading…
Reference in a new issue