mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
In the small view, show the action buttons when hovering anywhere over the cell (#7342)
* In the small view, show the action buttons when hovering anywhere over the cell This matches the previous behavior. * Explicitly hide/show the priority icon in the stack view * Restore right padding on the compact view's stack view * style fixes
This commit is contained in:
@@ -330,6 +330,7 @@
|
|||||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="PriorityHighTemplate" id="LI6-cz-gYa"/>
|
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="PriorityHighTemplate" id="LI6-cz-gYa"/>
|
||||||
</imageView>
|
</imageView>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
<edgeInsets key="edgeInsets" left="0.0" right="4" top="0.0" bottom="0.0"/>
|
||||||
<visibilityPriorities>
|
<visibilityPriorities>
|
||||||
<integer value="1000"/>
|
<integer value="1000"/>
|
||||||
<integer value="1000"/>
|
<integer value="1000"/>
|
||||||
|
|||||||
@@ -45,16 +45,14 @@
|
|||||||
|
|
||||||
- (void)updateTrackingAreas
|
- (void)updateTrackingAreas
|
||||||
{
|
{
|
||||||
|
[super updateTrackingAreas];
|
||||||
|
|
||||||
if (self.fTrackingArea != nil)
|
if (self.fTrackingArea != nil)
|
||||||
{
|
{
|
||||||
[self removeTrackingArea:self.fTrackingArea];
|
[self removeTrackingArea:self.fTrackingArea];
|
||||||
}
|
}
|
||||||
|
|
||||||
//tracking rect should not be entire row, but start at fGroupDownloadView
|
|
||||||
NSRect titleRect = self.fTorrentTitleField.frame;
|
|
||||||
CGFloat maxX = NSMaxX(titleRect);
|
|
||||||
NSRect rect = self.bounds;
|
NSRect rect = self.bounds;
|
||||||
rect.origin.x = maxX;
|
|
||||||
|
|
||||||
NSTrackingAreaOptions opts = (NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow);
|
NSTrackingAreaOptions opts = (NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow);
|
||||||
self.fTrackingArea = [[NSTrackingArea alloc] initWithRect:rect options:opts owner:self userInfo:nil];
|
self.fTrackingArea = [[NSTrackingArea alloc] initWithRect:rect options:opts owner:self userInfo:nil];
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
#import "Torrent.h"
|
#import "Torrent.h"
|
||||||
#import "NSImageAdditions.h"
|
#import "NSImageAdditions.h"
|
||||||
|
|
||||||
static CGFloat const kPriorityIconWidth = 12.0;
|
|
||||||
|
|
||||||
@implementation TorrentCell
|
@implementation TorrentCell
|
||||||
|
|
||||||
- (void)drawRect:(NSRect)dirtyRect
|
- (void)drawRect:(NSRect)dirtyRect
|
||||||
@@ -31,14 +29,12 @@ static CGFloat const kPriorityIconWidth = 12.0;
|
|||||||
imageWithColor:priorityColor];
|
imageWithColor:priorityColor];
|
||||||
|
|
||||||
self.fTorrentPriorityView.image = priorityImage;
|
self.fTorrentPriorityView.image = priorityImage;
|
||||||
self.fStackView.spacing = 4;
|
|
||||||
self.fTorrentPriorityViewWidthConstraint.constant = kPriorityIconWidth;
|
[self.fStackView setVisibilityPriority:NSStackViewVisibilityPriorityMustHold forView:self.fTorrentPriorityView];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self.fTorrentPriorityView.image = nil;
|
[self.fStackView setVisibilityPriority:NSStackViewVisibilityPriorityNotVisible forView:self.fTorrentPriorityView];
|
||||||
self.fStackView.spacing = 0;
|
|
||||||
self.fTorrentPriorityViewWidthConstraint.constant = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user