From: Jean-Philippe Bruyère Date: Mon, 19 Feb 2018 09:23:56 +0000 (+0100) Subject: update tabview with new mouse is in test X-Git-Tag: v0.9.5-beta~162 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=b5310f4458fe089b3df2667e90f9eb925d59a762;p=jp%2Fcrow.git update tabview with new mouse is in test --- diff --git a/Templates/TabItem.template b/Templates/TabItem.template index f82b79c9..2fa0e36e 100644 --- a/Templates/TabItem.template +++ b/Templates/TabItem.template @@ -1,8 +1,8 @@  + MouseEnter="{/caption.Foreground=White}" + MouseLeave="{/caption.Foreground=Gray}"> + MouseEnter="{/caption.Foreground=White}" + MouseLeave="{/caption.Foreground=Gray}"> - - + + diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 65f8ed26..9857d198 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -1527,6 +1527,12 @@ namespace Crow #endregion #region Mouse handling + /// + /// Recursive local coordinate point test. + /// After test on parent, point m is in local coord system. + /// + /// return true, if point is in the bounds of this control + /// by ref point to test, init value is not kept public virtual bool PointIsIn(ref Point m) { if (!(Visible & isEnabled)||IsDragged) diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs index d811ea54..8364aace 100644 --- a/src/GraphicObjects/TabItem.cs +++ b/src/GraphicObjects/TabItem.cs @@ -157,18 +157,15 @@ namespace Crow #region Mouse Handling public bool HoldCursor = false; - - public override bool MouseIsIn (Point m) + public override bool PointIsIn (ref Point m) { - if (!(Visible & IsEnabled) || IsDragged) - return false; - - bool mouseIsInTitle = TabTitle.ScreenCoordinates (TabTitle.Slot).ContainsOrIsEqual (m); - if (!IsSelected) - return mouseIsInTitle; + TabView tv = Parent as TabView; + bool tmp = base.PointIsIn (ref m); - return _contentContainer.ScreenCoordinates (_contentContainer.Slot).ContainsOrIsEqual (m) - || mouseIsInTitle; + if (m.Y < tabThickness) + return TabTitle.Slot.ContainsOrIsEqual (m); + else + return this.isSelected && tmp; } public override void onMouseDown (object sender, MouseButtonEventArgs e) {