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:
Mitch Livingston
2024-12-27 23:21:35 -05:00
committed by GitHub
parent b969b0bae1
commit ba55b7cd7c
3 changed files with 6 additions and 11 deletions

View File

@@ -330,6 +330,7 @@
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="PriorityHighTemplate" id="LI6-cz-gYa"/>
</imageView>
</subviews>
<edgeInsets key="edgeInsets" left="0.0" right="4" top="0.0" bottom="0.0"/>
<visibilityPriorities>
<integer value="1000"/>
<integer value="1000"/>

View File

@@ -45,16 +45,14 @@
- (void)updateTrackingAreas
{
[super updateTrackingAreas];
if (self.fTrackingArea != nil)
{
[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;
rect.origin.x = maxX;
NSTrackingAreaOptions opts = (NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow);
self.fTrackingArea = [[NSTrackingArea alloc] initWithRect:rect options:opts owner:self userInfo:nil];

View File

@@ -8,8 +8,6 @@
#import "Torrent.h"
#import "NSImageAdditions.h"
static CGFloat const kPriorityIconWidth = 12.0;
@implementation TorrentCell
- (void)drawRect:(NSRect)dirtyRect
@@ -31,14 +29,12 @@ static CGFloat const kPriorityIconWidth = 12.0;
imageWithColor:priorityColor];
self.fTorrentPriorityView.image = priorityImage;
self.fStackView.spacing = 4;
self.fTorrentPriorityViewWidthConstraint.constant = kPriorityIconWidth;
[self.fStackView setVisibilityPriority:NSStackViewVisibilityPriorityMustHold forView:self.fTorrentPriorityView];
}
else
{
self.fTorrentPriorityView.image = nil;
self.fStackView.spacing = 0;
self.fTorrentPriorityViewWidthConstraint.constant = 0;
[self.fStackView setVisibilityPriority:NSStackViewVisibilityPriorityNotVisible forView:self.fTorrentPriorityView];
}
}