1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

macOS fix quicklook toolbar icon status (#3345)

Fixes #3235
This commit is contained in:
SweetPPro 2022-06-29 01:19:06 +02:00 committed by GitHub
parent b80e9bd8c2
commit e678f7c5f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3875,6 +3875,7 @@ static void removeKeRangerRansomware()
- (void)endPreviewPanelControl:(QLPreviewPanel*)panel - (void)endPreviewPanelControl:(QLPreviewPanel*)panel
{ {
self.fPreviewPanel = nil; self.fPreviewPanel = nil;
[self.fWindow.toolbar validateVisibleItems];
} }
- (NSArray*)quickLookableTorrents - (NSArray*)quickLookableTorrents
@ -4365,8 +4366,8 @@ static void removeKeRangerRansomware()
//set quick look item //set quick look item
if ([ident isEqualToString:TOOLBAR_QUICKLOOK]) if ([ident isEqualToString:TOOLBAR_QUICKLOOK])
{ {
((NSButton*)toolbarItem.view).state = [QLPreviewPanel sharedPreviewPanelExists] && [QLPreviewPanel sharedPreviewPanel].visible; ((NSButton*)toolbarItem.view).state = self.fPreviewPanel != nil;
return YES; return self.fTableView.numberOfSelectedRows > 0;
} }
//enable share item //enable share item
@ -4780,7 +4781,7 @@ static void removeKeRangerRansomware()
NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look"); NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look");
menuItem.title = title; menuItem.title = title;
return YES; return self.fTableView.numberOfSelectedRows > 0;
} }
return YES; return YES;