Revision: 13004
          http://sourceforge.net/p/skim-app/code/13004
Author:   hofman
Date:     2022-07-10 22:21:00 +0000 (Sun, 10 Jul 2022)
Log Message:
-----------
set custom subrole for line and font wells. Include start and end line style in 
value.

Modified Paths:
--------------
    trunk/SKFontWell.m
    trunk/SKLineWell.m
    trunk/de.lproj/Localizable.strings
    trunk/en.lproj/Localizable.strings
    trunk/es.lproj/Localizable.strings
    trunk/fr.lproj/Localizable.strings
    trunk/it.lproj/Localizable.strings
    trunk/ja.lproj/Localizable.strings
    trunk/nl.lproj/Localizable.strings
    trunk/pl.lproj/Localizable.strings
    trunk/ru.lproj/Localizable.strings
    trunk/zh_CN.lproj/Localizable.strings
    trunk/zh_TW.lproj/Localizable.strings

Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m  2022-07-10 16:28:10 UTC (rev 13003)
+++ trunk/SKFontWell.m  2022-07-10 22:21:00 UTC (rev 13004)
@@ -542,6 +542,10 @@
     }
 }
 
+- (NSString *)accessibilitySubrole {
+    return @"AXFontWell";
+}
+
 - (NSString *)accessibilityRoleDescription {
     return NSLocalizedString(@"font well", @"Accessibility description");
 }

Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m  2022-07-10 16:28:10 UTC (rev 13003)
+++ trunk/SKLineWell.m  2022-07-10 22:21:00 UTC (rev 13004)
@@ -622,6 +622,10 @@
     return NSAccessibilityButtonRole;
 }
 
+- (NSString *)accessibilitySubrole {
+    return @"AXLineWell";
+}
+
 - (NSString *)accessibilityRoleDescription {
     return NSLocalizedString(@"line well", @"Accessibility description");
 }
@@ -634,10 +638,40 @@
     return NSAccessibilityUnignoredAncestor([self superview]);
 }
 
+static inline NSString *lineStyleDescription(PDFLineStyle lineStyle) {
+    switch (lineStyle) {
+        case kPDFLineStyleSquare:
+            return NSLocalizedString(@"square", @"Accessibility description");
+        case kPDFLineStyleCircle:
+            return NSLocalizedString(@"circle", @"Accessibility description");
+        case kPDFLineStyleDiamond:
+            return NSLocalizedString(@"diamond", @"Accessibility description");
+        case kPDFLineStyleOpenArrow:
+            return NSLocalizedString(@"open arrow", @"Accessibility 
description");
+        case kPDFLineStyleClosedArrow:
+            return NSLocalizedString(@"closed arrow", @"Accessibility 
description");
+        default:
+            return @"";
+    }
+    return nil;
+}
+
 - (id)accessibilityValue {
-    if ([self style] == kPDFBorderStyleDashed)
+    /*
+     if ([self style] == kPDFBorderStyleDashed)
         return [NSString stringWithFormat:@"%@ %ld %@ %@", 
NSLocalizedString(@"line width", @"Accessibility description"), (long)[self 
lineWidth], NSLocalizedString(@"dashed", @"Accessibility description"), [[[self 
dashPattern] valueForKey:@"stringValue"] componentsJoinedByString:@" "]];
     return [NSString stringWithFormat:@"%@ %ld", NSLocalizedString(@"line 
width", @"Accessibility description"), (long)[self lineWidth]];
+    */
+    NSMutableString *value = [NSMutableString stringWithFormat:@"%@ %ld", 
NSLocalizedString(@"line width", @"Accessibility description"), (long)[self 
lineWidth]];
+    if ([self style] == kPDFBorderStyleDashed && [[self dashPattern] count])
+        [value appendFormat:@" %@ %@", NSLocalizedString(@"dashed", 
@"Accessibility description"), [[[self dashPattern] valueForKey:@"stringValue"] 
componentsJoinedByString:@" "]];
+    if ([self displayStyle] == SKLineWellDisplayStyleLine) {
+        if ([self startLineStyle] != kPDFLineStyleNone)
+            [value appendFormat:NSLocalizedString(@" from %@", @"Accessibility 
description"), lineStyleDescription([self startLineStyle])];
+        if ([self endLineStyle] != kPDFLineStyleNone)
+            [value appendFormat:NSLocalizedString(@" to %@", @"Accessibility 
description"), lineStyleDescription([self endLineStyle])];
+    }
+    return value;
 }
 
 - (NSString *)accessibilityLabel {

Modified: trunk/de.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/en.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/es.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/fr.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/it.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/ja.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/nl.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/pl.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/ru.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_CN.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_TW.lproj/Localizable.strings
===================================================================
(Binary files differ)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to