Tig 9 mesi fa
parent
commit
58c1d59b6f

+ 0 - 1
Terminal.Gui/Input/Command.cs

@@ -6,7 +6,6 @@ namespace Terminal.Gui;
 /// <summary>
 ///     Actions which can be performed by a <see cref="View"/>. Commands are typically invoked via
 ///     <see cref="View.KeyBindings"/> and mouse events.
-///     See also <see cref="View.InvokeCommand"/>.
 /// </summary>
 public enum Command
 {

+ 1 - 7
Terminal.Gui/View/View.Drawing.cs

@@ -376,13 +376,7 @@ public partial class View // Drawing APIs
     /// </returns>
     public virtual Attribute GetHotFocusColor ()
     {
-        ColorScheme cs = ColorScheme;
-
-
-        if (cs is null)
-        {
-            cs = new ();
-        }
+        ColorScheme? cs = ColorScheme ?? new ();
 
         return Enabled ? GetColor (cs.HotFocus) : cs.Disabled;
     }

+ 1 - 1
Terminal.Gui/View/View.Mouse.cs

@@ -57,7 +57,7 @@ public partial class View // Mouse APIs
                 return args.Cancel;
             }
 
-            ColorScheme cs = ColorScheme;
+            ColorScheme? cs = ColorScheme;
 
             if (cs is null)
             {

+ 4 - 4
Terminal.Gui/Views/ComboBox.cs

@@ -35,14 +35,14 @@ public class ComboBox : View, IDesignable
         _search.TextChanged += Search_Changed;
 
         _listview.Y = Pos.Bottom (_search);
-        _listview.OpenSelectedItem += (sender, a) => Selected ();
+        _listview.OpenSelectedItem += (sender, a) => SelectText ();
         _listview.Accepted += (sender, args) =>
                               {
                                   // This prevents Accepted from bubbling up to the combobox
                                   args.Handled = true;
 
                                   // But OpenSelectedItem won't be fired because of that. So do it here.
-                                  Selected ();
+                                  SelectText ();
                               };
         _listview.SelectedItemChanged += (sender, e) =>
                                          {
@@ -396,7 +396,7 @@ public class ComboBox : View, IDesignable
     {
         if (HasItems ())
         {
-            if (Selected ())
+            if (SelectText ())
             {
                 return false;
             }
@@ -728,7 +728,7 @@ public class ComboBox : View, IDesignable
         }
     }
 
-    private bool Selected ()
+    private bool SelectText ()
     {
         IsShow = false;
         _listview.TabStop = TabBehavior.NoStop;

+ 3 - 5
Terminal.Gui/Views/Label.cs

@@ -8,13 +8,10 @@
 /// </summary>
 /// <remarks>
 ///     <para>
-///         <see cref="Label.Title"/> and <see cref="Label.Text"/> are the same property. When <see cref="Label.Title"/> is
-///         set
-///         <see cref="Label.Text"/> is also set. When <see cref="Label.Text"/> is set <see cref="Label.Title"/> is also
-///         set.
+///         Title and Text are the same property. When Title is set Text s also set. When Text is set Title is also set.
 ///     </para>
 ///     <para>
-///         If <see cref="Label.CanFocus"/> is <see langword="false"/> and the use clicks on the Label,
+///         If <see cref="View.CanFocus"/> is <see langword="false"/> and the use clicks on the Label,
 ///         the <see cref="Command.HotKey"/> will be invoked on the next <see cref="View"/> in
 ///         <see cref="View.Subviews"/>."
 ///     </para>
@@ -91,6 +88,7 @@ public class Label : View, IDesignable
     bool IDesignable.EnableForDesign ()
     {
         Text = "_Label";
+
         return true;
     }
 }

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

@@ -385,7 +385,7 @@ internal sealed class Menu : View
             return GetFocusColor ();
         }
 
-        return !item.IsEnabled () ? ColorScheme.Disabled : GetNormalColor ();
+        return !item.IsEnabled () ? ColorScheme!.Disabled : GetNormalColor ();
     }
 
     public override void OnDrawContent (Rectangle viewport)