浏览代码

If Parent isn't movable, border now cancels Highlight event

Tig 1 年之前
父节点
当前提交
b7547c43e1
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 2 0
      Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs
  2. 1 0
      Terminal.Gui/View/Adornment/Border.cs

+ 2 - 0
Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs

@@ -311,6 +311,7 @@ public abstract class ConsoleDriver
     /// <summary>Clears the <see cref="Contents"/> of the driver.</summary>
     /// <summary>Clears the <see cref="Contents"/> of the driver.</summary>
     public void ClearContents ()
     public void ClearContents ()
     {
     {
+        Debug.WriteLine ("ClearContents");
         // TODO: This method is really "Clear Contents" now and should not be abstract (or virtual)
         // TODO: This method is really "Clear Contents" now and should not be abstract (or virtual)
         Contents = new Cell [Rows, Cols];
         Contents = new Cell [Rows, Cols];
         //CONCURRENCY: Unsynchronized access to Clip isn't safe.
         //CONCURRENCY: Unsynchronized access to Clip isn't safe.
@@ -346,6 +347,7 @@ public abstract class ConsoleDriver
     /// <param name="rune">The Rune used to fill the rectangle</param>
     /// <param name="rune">The Rune used to fill the rectangle</param>
     public void FillRect (Rectangle rect, Rune rune = default)
     public void FillRect (Rectangle rect, Rune rune = default)
     {
     {
+        Debug.WriteLine ("FillRect");
         rect = Rectangle.Intersect (rect, Clip);
         rect = Rectangle.Intersect (rect, Clip);
         lock (Contents)
         lock (Contents)
         {
         {

+ 1 - 0
Terminal.Gui/View/Adornment/Border.cs

@@ -204,6 +204,7 @@ public class Border : Adornment
     {
     {
         if (!Parent.Arrangement.HasFlag (ViewArrangement.Movable))
         if (!Parent.Arrangement.HasFlag (ViewArrangement.Movable))
         {
         {
+            e.Cancel = true;
             return;
             return;
         }
         }