Tig 10 月之前
父節點
當前提交
4826704da8
共有 2 個文件被更改,包括 11 次插入10 次删除
  1. 10 9
      Terminal.Gui/View/View.cs
  2. 1 1
      Terminal.Gui/Views/TextView.cs

+ 10 - 9
Terminal.Gui/View/View.cs

@@ -7,7 +7,7 @@ namespace Terminal.Gui;
 #region API Docs
 #region API Docs
 
 
 /// <summary>
 /// <summary>
-///     View is the base class for all views on the screen and represents a visible element that can render itself and
+///     View is the base class all visible elements. View can render itself and
 ///     contains zero or more nested views, called SubViews. View provides basic functionality for layout, positioning, and
 ///     contains zero or more nested views, called SubViews. View provides basic functionality for layout, positioning, and
 ///     drawing. In addition, View provides keyboard and mouse event handling.
 ///     drawing. In addition, View provides keyboard and mouse event handling.
 /// </summary>
 /// </summary>
@@ -100,8 +100,7 @@ namespace Terminal.Gui;
 ///         <see cref="View"/> inheritance hierarchies to override base class layout code optimally by doing so only on
 ///         <see cref="View"/> inheritance hierarchies to override base class layout code optimally by doing so only on
 ///         first run, instead of on every run.
 ///         first run, instead of on every run.
 ///     </para>
 ///     </para>
-///     <para>See <see href="../docs/keyboard.md">for an overview of View keyboard handling.</see></para>
-///     ///
+///     <para>See <see href="../docs/keyboard.md"> for an overview of View keyboard handling.</see></para>
 /// </remarks>
 /// </remarks>
 
 
 #endregion API Docs
 #endregion API Docs
@@ -135,6 +134,7 @@ public partial class View : Responder, ISupportInitializeNotification
     public View ()
     public View ()
     {
     {
         SetupAdornments ();
         SetupAdornments ();
+
         SetupCommands ();
         SetupCommands ();
 
 
         SetupKeyboard ();
         SetupKeyboard ();
@@ -146,7 +146,7 @@ public partial class View : Responder, ISupportInitializeNotification
     }
     }
 
 
     /// <summary>
     /// <summary>
-    ///     Event called only once when the <see cref="View"/> is being initialized for the first time. Allows
+    ///     Raised once when the <see cref="View"/> is being initialized for the first time. Allows
     ///     configurations and assignments to be performed before the <see cref="View"/> being shown.
     ///     configurations and assignments to be performed before the <see cref="View"/> being shown.
     ///     View implements <see cref="ISupportInitializeNotification"/> to allow for more sophisticated initialization.
     ///     View implements <see cref="ISupportInitializeNotification"/> to allow for more sophisticated initialization.
     /// </summary>
     /// </summary>
@@ -307,10 +307,11 @@ public partial class View : Responder, ISupportInitializeNotification
         }
         }
     }
     }
 
 
-    /// <summary>Event fired when the <see cref="Enabled"/> value is being changed.</summary>
+    /// <summary>Raised when the <see cref="Enabled"/> value is being changed.</summary>
     public event EventHandler? EnabledChanged;
     public event EventHandler? EnabledChanged;
 
 
-    /// <summary>Method invoked when the <see cref="Enabled"/> property from a view is changed.</summary>
+    // TODO: Change this event to match the standard TG event model.
+    /// <summary>Invoked when the <see cref="Enabled"/> property from a view is changed.</summary>
     public virtual void OnEnabledChanged () { EnabledChanged?.Invoke (this, EventArgs.Empty); }
     public virtual void OnEnabledChanged () { EnabledChanged?.Invoke (this, EventArgs.Empty); }
 
 
     private bool _visible = true;
     private bool _visible = true;
@@ -381,7 +382,6 @@ public partial class View : Responder, ISupportInitializeNotification
     /// <summary>Raised when <see cref="Visible"/> has changed.</summary>
     /// <summary>Raised when <see cref="Visible"/> has changed.</summary>
     public event EventHandler? VisibleChanged;
     public event EventHandler? VisibleChanged;
 
 
-    // TODO: This API is a hack. We should make Visible propogate automatically, no? See https://github.com/gui-cs/Terminal.Gui/issues/3703
     /// <summary>
     /// <summary>
     ///     INTERNAL Indicates whether all views up the Superview hierarchy are visible.
     ///     INTERNAL Indicates whether all views up the Superview hierarchy are visible.
     /// </summary>
     /// </summary>
@@ -491,6 +491,7 @@ public partial class View : Responder, ISupportInitializeNotification
                                                   1);
                                                   1);
     }
     }
 
 
+    // TODO: Change this event to match the standard TG event model.
     /// <summary>Called when the <see cref="View.Title"/> has been changed. Invokes the <see cref="TitleChanged"/> event.</summary>
     /// <summary>Called when the <see cref="View.Title"/> has been changed. Invokes the <see cref="TitleChanged"/> event.</summary>
     protected void OnTitleChanged () { TitleChanged?.Invoke (this, new (in _title)); }
     protected void OnTitleChanged () { TitleChanged?.Invoke (this, new (in _title)); }
 
 
@@ -508,11 +509,11 @@ public partial class View : Responder, ISupportInitializeNotification
         return args.Cancel;
         return args.Cancel;
     }
     }
 
 
-    /// <summary>Event fired after the <see cref="View.Title"/> has been changed.</summary>
+    /// <summary>Raised after the <see cref="View.Title"/> has been changed.</summary>
     public event EventHandler<EventArgs<string>>? TitleChanged;
     public event EventHandler<EventArgs<string>>? TitleChanged;
 
 
     /// <summary>
     /// <summary>
-    ///     Event fired when the <see cref="View.Title"/> is changing. Set <see cref="CancelEventArgs.Cancel"/> to `true`
+    ///     Raised when the <see cref="View.Title"/> is changing. Set <see cref="CancelEventArgs.Cancel"/> to `true`
     ///     to cancel the Title change.
     ///     to cancel the Title change.
     /// </summary>
     /// </summary>
     public event EventHandler<CancelEventArgs<string>>? TitleChanging;
     public event EventHandler<CancelEventArgs<string>>? TitleChanging;

+ 1 - 1
Terminal.Gui/Views/TextView.cs

@@ -2470,7 +2470,6 @@ public class TextView : View
         KeyBindings.Add (Key.CursorLeft.WithCtrl.WithShift, Command.WordLeftExtend);
         KeyBindings.Add (Key.CursorLeft.WithCtrl.WithShift, Command.WordLeftExtend);
 
 
         KeyBindings.Add (Key.CursorRight.WithCtrl, Command.WordRight);
         KeyBindings.Add (Key.CursorRight.WithCtrl, Command.WordRight);
-        KeyBindings.Add (Key.F.WithAlt, Command.WordRight);
 
 
         KeyBindings.Add (Key.CursorRight.WithCtrl.WithShift, Command.WordRightExtend);
         KeyBindings.Add (Key.CursorRight.WithCtrl.WithShift, Command.WordRightExtend);
         KeyBindings.Add (Key.Delete.WithCtrl, Command.KillWordForwards); // kill-word-forwards
         KeyBindings.Add (Key.Delete.WithCtrl, Command.KillWordForwards); // kill-word-forwards
@@ -2496,6 +2495,7 @@ public class TextView : View
         KeyBindings.Add (Key.B.WithAlt, Command.WordLeft);
         KeyBindings.Add (Key.B.WithAlt, Command.WordLeft);
         KeyBindings.Add (Key.W.WithAlt, Command.Cut);
         KeyBindings.Add (Key.W.WithAlt, Command.Cut);
         KeyBindings.Add (Key.V.WithAlt, Command.PageUp);
         KeyBindings.Add (Key.V.WithAlt, Command.PageUp);
+        KeyBindings.Add (Key.F.WithAlt, Command.WordRight);
 #endif
 #endif
 
 
         _currentCulture = Thread.CurrentThread.CurrentUICulture;
         _currentCulture = Thread.CurrentThread.CurrentUICulture;