refactor: removing menu icons on older Macs (#7994)

This commit is contained in:
Cœur
2025-12-25 20:59:11 +01:00
committed by GitHub
parent a1184061a0
commit 3da2a2543e
2 changed files with 20 additions and 1 deletions

View File

@@ -813,8 +813,17 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
[self updateMainWindow];
if (@available(macOS 26.0, *))
;
else
{
// <#7908> Keep older macOS clean of visual noise
for (NSMenuItem* item in _fWindow.menu.itemArray)
for (NSMenuItem* subItem in item.submenu.itemArray)
subItem.image = nil;
}
//timer to update the interface every second
[self updateUI];
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:kUpdateUISeconds target:self selector:@selector(updateUI) userInfo:nil
repeats:YES];
[NSRunLoop.currentRunLoop addTimer:self.fTimer forMode:NSModalPanelRunLoopMode];

View File

@@ -91,6 +91,16 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
- (void)awakeFromNib
{
[super awakeFromNib];
if (@available(macOS 26.0, *))
;
else
{
// <#7908> Keep older macOS clean of visual noise
for (NSMenuItem* item in _fContextRow.itemArray)
item.image = nil;
for (NSMenuItem* item in _fContextNoRow.itemArray)
item.image = nil;
}
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable"
object:nil];
}