Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit e775365

Browse files
committed
[Ide][AtkCocoa] Add support for Subroles and Value objects
1 parent 8af80e7 commit e775365

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public enum Roles
154154
public enum SubRoles
155155
{
156156
AXCloseButton,
157+
AXTabButton,
157158
};
158159

159160
public struct Range

main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelperMac.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,23 @@ public static void SetMainWindow (this Atk.Object o, Atk.Object mainWindow)
213213
}
214214

215215
public static void SetValue (this Atk.Object o, string stringValue)
216+
{
217+
SetValue (o, (NSObject) new NSString (stringValue));
218+
}
219+
220+
public static void SetValue (this Atk.Object o, object value)
221+
{
222+
SetValue (o, NSObject.FromObject (value));
223+
}
224+
225+
static void SetValue (this Atk.Object o, NSObject value)
216226
{
217227
var nsa = GetNSAccessibilityElement (o);
218228
if (nsa == null) {
219229
return;
220230
}
221231

222-
nsa.AccessibilityValue = new NSString (stringValue);
232+
nsa.AccessibilityValue = value;
223233
}
224234

225235
public static void SetUrl (this Atk.Object o, string url)
@@ -261,6 +271,11 @@ public static void SetSubRole (this Atk.Object o, string subrole)
261271
nsa.AccessibilitySubrole = subrole;
262272
}
263273

274+
public static void SetSubRole (this Atk.Object o, AtkCocoa.SubRoles subrole)
275+
{
276+
o.SetSubRole (subrole.ToString ());
277+
}
278+
264279
public static void SetTitleUIElement (this Atk.Object o, Atk.Object title)
265280
{
266281
var nsa = GetNSAccessibilityElement (o);

0 commit comments

Comments
 (0)