diff options
author | Vsevolod Kukol <sevoku@microsoft.com> | 2019-10-16 23:27:24 +0300 |
---|---|---|
committer | Vsevolod Kukol <sevoku@microsoft.com> | 2019-10-16 23:31:41 +0300 |
commit | a1c22f197e67160372a1093f0b28f273d88e3e05 (patch) | |
tree | 01b886c6181eac8bf23546cf1301d4f12b5b7c2b /Xwt.Gtk | |
parent | eaec2d69ef742357e2d4c41b1b91a8591b507557 (diff) |
Revert "[Gtk][a11y] Use toggle button in comboboxes for setting a11y."
This fix is not required with latest AtkCocoa
This reverts commit 2abba7b56283ec27cd1632b5e4f10dd1dfc56ae1.
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs index 771b1710..85561588 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/AccessibleBackend.cs @@ -61,27 +61,12 @@ namespace Xwt.GtkBackend public void Initialize (IWidgetBackend parentWidget, IAccessibleEventSink eventSink) { var backend = parentWidget as WidgetBackend; - Gtk.Widget nativeWidget = null; - - // Needed only for AtkCocoa. - if (Platform.IsMac) { - // Gtk.ComboBox and Gtk.ComboBoxEntry a11y doesn't work with Gtk/AtkCocoa. - // Workaround: - // Set a11y properties to their children. - // For Gtk.ComboBoxEntry use its Gtk.Entry, for Gtk.ComboBox -- Gtk.ToggleButton. - if (backend is IComboBoxEntryBackend) { - nativeWidget = (backend?.Widget as Gtk.Bin)?.Child; - } else if (backend is IComboBoxBackend) { - foreach (var child in ((Gtk.Container)backend.Widget).AllChildren) { - if (child is Gtk.ToggleButton) { - nativeWidget = (Gtk.Widget)child; - break; - } - } - } - } - - Initialize (nativeWidget ?? backend?.Widget, eventSink); + if (Platform.IsMac && backend is IComboBoxEntryBackend) { + // Gtk.ComboBoxEntry a11y doesn't work with Gtk/AtkCocoa. + // Workaround: Set a11y properties to its Gtk.Entry + Initialize ((backend?.Widget as Gtk.Bin)?.Child, eventSink); + } else + Initialize (backend?.Widget, eventSink); } public void Initialize (IPopoverBackend parentPopover, IAccessibleEventSink eventSink) |