diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-07-25 13:24:09 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-07-25 13:24:35 +0400 |
commit | 12c23a1b64afb160b158a102097f4ba9a2e4f632 (patch) | |
tree | 02b8a7ce53db04abfc82e26f48bdc2808ac0760f /main | |
parent | e65944d1f7d81e4adbc25a84dba2b552115ddc84 (diff) |
Fixed 'Bug 6 - Pin icon only appears when I hover too close to one
end, should be there always'.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs | 7 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs | 97 |
2 files changed, 55 insertions, 49 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index d1c54628f5..be3af29e1f 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -347,6 +347,8 @@ namespace MonoDevelop.Debugger set { pinCol.Visible = value; } } + public bool RootPinAlwaysVisible { get; set; } + public bool AllowExpanding { get { return this.allowExpanding; } set { this.allowExpanding = value; } @@ -701,6 +703,8 @@ namespace MonoDevelop.Debugger else store.SetValue (it, LiveUpdateIconCol, noLiveIcon); } + if (RootPinAlwaysVisible && (!hasParent && PinnedWatch ==null && AllowPinning)) + store.SetValue (it, PinIconCol, "md-pin-up"); if (val.HasChildren) { // Add dummy node @@ -936,7 +940,8 @@ namespace MonoDevelop.Debugger if (!it.Equals (lastPinIter)) { store.SetValue (it, PinIconCol, "md-pin-up"); CleanPinIcon (); - lastPinIter = it; + if (path.Depth > 1 || !RootPinAlwaysVisible) + lastPinIter = it; } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs index c3007e4c73..c1b7f245ee 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs @@ -89,7 +89,8 @@ namespace MonoDevelop.SourceEditor tree.AllowAdding = false; tree.AllowEditing = true; tree.HeadersVisible = false; - tree.AllowPinning = false; + tree.AllowPinning = true; + tree.RootPinAlwaysVisible = true; tree.PinnedWatch = watch; DocumentLocation location = editor.Document.OffsetToLocation (offset); tree.PinnedWatchLine = location.Line + 1; @@ -102,13 +103,13 @@ namespace MonoDevelop.SourceEditor Destroy (); }; - tree.MotionNotifyEvent += HandleTreeMotionNotifyEvent; +// tree.MotionNotifyEvent += HandleTreeMotionNotifyEvent; sw.ShowAll (); - pinWindow = new PinWindow (this); - pinWindow.SetPinned (false); - pinWindow.ButtonPressEvent += HandlePinWindowButtonPressEvent; +// pinWindow = new PinWindow (this); +// pinWindow.SetPinned (false); +// pinWindow.ButtonPressEvent += HandlePinWindowButtonPressEvent; tree.StartEditing += delegate { Modal = true; @@ -124,49 +125,49 @@ namespace MonoDevelop.SourceEditor tree.CreatePinnedWatch (currentPinIter); } - [GLib.ConnectBefore] - void HandleTreeMotionNotifyEvent (object o, MotionNotifyEventArgs args) - { - PlacePinWindow (); - } - - protected override void OnSizeAllocated (Rectangle allocation) - { - base.OnSizeAllocated (allocation); - PlacePinWindow (); - } - - void PlacePinWindow () - { - int mx, my; - ModifierType mm; - if (tree.BinWindow == null) - return; - tree.BinWindow.GetPointer (out mx, out my, out mm); - - int cx, cy; - TreePath path; - TreeViewColumn col; - if (!tree.GetPathAtPos (mx, my, out path, out col, out cx, out cy)) - return; - - tree.Model.GetIter (out currentPinIter, path); - Rectangle cr = tree.GetCellArea (path, tree.Columns [1]); - - int ox, oy; - tree.BinWindow.GetOrigin (out ox, out oy); - - if (mx < cr.Right - 30) { - pinWindow.Hide (); - return; - } - - int x, y, w, h; - GetPosition (out x, out y); - GetSize (out w, out h); - pinWindow.Move (x + w, oy + cr.Y); - pinWindow.Show (); - } +// [GLib.ConnectBefore] +// void HandleTreeMotionNotifyEvent (object o, MotionNotifyEventArgs args) +// { +// PlacePinWindow (); +// } +// +// protected override void OnSizeAllocated (Rectangle allocation) +// { +// base.OnSizeAllocated (allocation); +// PlacePinWindow (); +// } +// +// void PlacePinWindow () +// { +// int mx, my; +// ModifierType mm; +// if (tree.BinWindow == null) +// return; +// tree.BinWindow.GetPointer (out mx, out my, out mm); +// +// int cx, cy; +// TreePath path; +// TreeViewColumn col; +// if (!tree.GetPathAtPos (mx, my, out path, out col, out cx, out cy)) +// return; +// +// tree.Model.GetIter (out currentPinIter, path); +// Rectangle cr = tree.GetCellArea (path, tree.Columns [1]); +// +// int ox, oy; +// tree.BinWindow.GetOrigin (out ox, out oy); +// +// if (mx < cr.Right - 30) { +// pinWindow.Hide (); +// return; +// } +// +// int x, y, w, h; +// GetPosition (out x, out y); +// GetSize (out w, out h); +// pinWindow.Move (x + w, oy + cr.Y); +// pinWindow.Show (); +// } protected override bool OnEnterNotifyEvent (EventCrossing evnt) { |