Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriain holmes <iain@xamarin.com>2017-03-10 15:46:06 +0300
committeriain holmes <iain@xamarin.com>2017-03-10 15:46:06 +0300
commit4f63cdecda84a9cad0172b5a57f482cf1720bec5 (patch)
tree78957974a8156ad2d353dc10c69bed6106f06415 /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking
parent7b1317b0b4ef680872f42dbe03ca19b18d917914 (diff)
[A11y] Improve the way ActionDelegates are handled.
No more having to add them to the Accessible No more having to destroy them It's all handled automatically!
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs14
2 files changed, 2 insertions, 27 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
index 618a1e13d9..e633ab017c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
@@ -133,14 +133,11 @@ namespace MonoDevelop.Components.Docking
CrossfadeIcon crossfade;
double hoverProgress;
- ActionDelegate actionHandler;
public DockBarItem (DockBar bar, DockItem it, int size)
{
- actionHandler = new AtkCocoaHelper.ActionDelegate ();
+ var actionHandler = new ActionDelegate (this);
actionHandler.PerformPress += OnPerformPress;
- Accessible.SetActionDelegate (actionHandler);
-
Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
this.size = size;
this.bar = bar;
@@ -169,16 +166,6 @@ namespace MonoDevelop.Components.Docking
Accessible.Name = "DockbarItem";
}
- public override void Destroy ()
- {
- if (actionHandler != null) {
- actionHandler.Dispose ();
- actionHandler = null;
- }
-
- base.Destroy ();
- }
-
void IAnimatable.BatchBegin () { }
void IAnimatable.BatchCommit () { QueueDraw (); }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
index 116dd5f20b..6836185999 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
@@ -58,7 +58,6 @@ namespace MonoDevelop.Components.Docking
DockItem item;
bool allowPlaceholderDocking;
bool mouseOver;
- ActionDelegate actionHandler;
IDisposable subscribedLeaveEvent;
@@ -97,11 +96,10 @@ namespace MonoDevelop.Components.Docking
public DockItemTitleTab (DockItem item, DockFrame frame)
{
- actionHandler = new AtkCocoaHelper.ActionDelegate ();
+ var actionHandler = new ActionDelegate (this);
actionHandler.PerformPress += HandlePress;
actionHandler.PerformShowMenu += HandleShowMenu;
- Accessible.SetActionDelegate (actionHandler);
Accessible.SetRole (AtkCocoa.Roles.AXGroup, "pad header");
Accessible.SetSubRole ("XAPadHeader");
@@ -119,16 +117,6 @@ namespace MonoDevelop.Components.Docking
subscribedLeaveEvent = this.SubscribeLeaveEvent (OnLeave);
}
- public override void Destroy ()
- {
- if (actionHandler != null) {
- actionHandler.Dispose ();
- actionHandler = null;
- }
-
- base.Destroy ();
- }
-
public DockVisualStyle VisualStyle {
get { return visualStyle; }
set {