mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
Accessibility description for images (#4149)
This commit is contained in:
parent
67e992ddf0
commit
855b782604
2 changed files with 39 additions and 17 deletions
|
@ -3546,11 +3546,24 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
}
|
||||
else if ([ident isEqualToString:@"DL Image"])
|
||||
{
|
||||
return [NSImage imageNamed:@"DownArrowGroupTemplate"];
|
||||
NSImage* image = [NSImage imageNamed:@"DownArrowGroupTemplate"];
|
||||
image.accessibilityDescription = NSLocalizedString(@"DL", "Torrent -> status image");
|
||||
return image;
|
||||
}
|
||||
else if ([ident isEqualToString:@"UL Image"])
|
||||
{
|
||||
return [NSImage imageNamed:[self.fDefaults boolForKey:@"DisplayGroupRowRatio"] ? @"YingYangGroupTemplate" : @"UpArrowGroupTemplate"];
|
||||
if ([self.fDefaults boolForKey:@"DisplayGroupRowRatio"])
|
||||
{
|
||||
NSImage* image = [NSImage imageNamed:@"YingYangGroupTemplate"];
|
||||
image.accessibilityDescription = NSLocalizedString(@"Ratio", "Torrent -> status image");
|
||||
return image;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSImage* image = [NSImage imageNamed:@"UpArrowGroupTemplate"];
|
||||
image.accessibilityDescription = NSLocalizedString(@"UL", "Torrent -> status image");
|
||||
return image;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -94,21 +94,30 @@ typedef NS_ENUM(unsigned int, tabTag) {
|
|||
//https://github.com/transmission/transmission/issues/3486
|
||||
[[window standardWindowButton:NSWindowZoomButton] setEnabled:NO];
|
||||
|
||||
//set tab tooltips
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"General Info", "Inspector -> tab") forSegment:TAB_GENERAL_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Activity", "Inspector -> tab") forSegment:TAB_ACTIVITY_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Trackers", "Inspector -> tab") forSegment:TAB_TRACKERS_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Peers", "Inspector -> tab") forSegment:TAB_PEERS_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Files", "Inspector -> tab") forSegment:TAB_FILE_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Options", "Inspector -> tab") forSegment:TAB_OPTIONS_TAG];
|
||||
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"info.circle" withFallback:@"InfoGeneral"] forSegment:TAB_GENERAL_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"square.grid.3x3.fill.square" withFallback:@"InfoActivity"] forSegment:TAB_ACTIVITY_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"antenna.radiowaves.left.and.right" withFallback:@"InfoTracker"]
|
||||
forSegment:TAB_TRACKERS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"person.2" withFallback:@"InfoPeers"] forSegment:TAB_PEERS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"doc.on.doc" withFallback:@"InfoFiles"] forSegment:TAB_FILE_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"gearshape" withFallback:@"InfoOptions"] forSegment:TAB_OPTIONS_TAG];
|
||||
//set tab images and tooltips
|
||||
void (^setImageAndToolTipForSegment)(NSImage*, NSString*, NSInteger) = ^(NSImage* image, NSString* toolTip, NSInteger segment) {
|
||||
image.accessibilityDescription = toolTip;
|
||||
[self.fTabs setImage:image forSegment:segment];
|
||||
[self.fTabs.cell setToolTip:toolTip forSegment:segment];
|
||||
};
|
||||
setImageAndToolTipForSegment(
|
||||
[NSImage systemSymbol:@"info.circle" withFallback:@"InfoGeneral"],
|
||||
NSLocalizedString(@"General Info", "Inspector -> tab"),
|
||||
TAB_GENERAL_TAG);
|
||||
setImageAndToolTipForSegment(
|
||||
[NSImage systemSymbol:@"square.grid.3x3.fill.square" withFallback:@"InfoActivity"],
|
||||
NSLocalizedString(@"Activity", "Inspector -> tab"),
|
||||
TAB_ACTIVITY_TAG);
|
||||
setImageAndToolTipForSegment(
|
||||
[NSImage systemSymbol:@"antenna.radiowaves.left.and.right" withFallback:@"InfoTracker"],
|
||||
NSLocalizedString(@"Trackers", "Inspector -> tab"),
|
||||
TAB_TRACKERS_TAG);
|
||||
setImageAndToolTipForSegment([NSImage systemSymbol:@"person.2" withFallback:@"InfoPeers"], NSLocalizedString(@"Peers", "Inspector -> tab"), TAB_PEERS_TAG);
|
||||
setImageAndToolTipForSegment([NSImage systemSymbol:@"doc.on.doc" withFallback:@"InfoFiles"], NSLocalizedString(@"Files", "Inspector -> tab"), TAB_FILE_TAG);
|
||||
setImageAndToolTipForSegment(
|
||||
[NSImage systemSymbol:@"gearshape" withFallback:@"InfoOptions"],
|
||||
NSLocalizedString(@"Options", "Inspector -> tab"),
|
||||
TAB_OPTIONS_TAG);
|
||||
|
||||
//set selected tab
|
||||
self.fCurrentTabTag = kInvalidTag;
|
||||
|
|
Loading…
Reference in a new issue