diff options
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index a3bd9fd4..eb4caefa 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -1133,6 +1133,19 @@ namespace Crow ctxMenuContainer = Load ("#Crow.ContextMenu.template") as MenuItem; } + void CtxMenuContainer_LayoutChanged (object sender, LayoutingEventArgs e) + { + Rectangle r = ctxMenuContainer.ScreenCoordinates (ctxMenuContainer.Slot); + if (e.LayoutType == LayoutingType.Width) { + if (r.Right > this.clientRectangle.Right) + ctxMenuContainer.Left = this.clientRectangle.Right - ctxMenuContainer.Slot.Width; + }else if (e.LayoutType == LayoutingType.Width) { + if (r.Bottom > this.clientRectangle.Bottom) + ctxMenuContainer.Top = this.clientRectangle.Bottom - ctxMenuContainer.Slot.Height; + } + + } + public void ShowContextMenu (GraphicObject go) { lock (UpdateMutex) { |