]> O.S.I.I.S - jp/crow.git/commitdiff
correct popper mouse leave bug
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Mar 2016 22:42:01 +0000 (23:42 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Mar 2016 22:42:01 +0000 (23:42 +0100)
src/GraphicObjects/Popper.cs

index 7c068085b8631ea84998456ef88e681fcb5739c5..746e334bb38ca562ac8cadc682a276e060ab083f 100644 (file)
@@ -29,6 +29,7 @@ namespace Crow
                                if (_content != null) {
                                        _content.LogicalParent = null;
                                        _content.LayoutChanged -= _content_LayoutChanged;
+                                       _content.MouseLeave -= onMouseLeave;
                                }
                                
                                _content = value; 
@@ -38,6 +39,7 @@ namespace Crow
 
                                _content.LogicalParent = this;
                                _content.LayoutChanged += _content_LayoutChanged;
+                               _content.MouseLeave += onMouseLeave;
                        }
                }
 
@@ -111,8 +113,14 @@ namespace Crow
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
-                       IsPopped = false;
                        base.onMouseLeave (sender, e);
+                       if (MouseIsIn (e.Position))
+                               return;
+                       if (_content == null)
+                               return;
+                       if (_content.MouseIsIn (e.Position))
+                               return;
+                       IsPopped = false;
                }
                #endregion