Tig 10 月之前
父節點
當前提交
8fbbba750b
共有 3 個文件被更改,包括 33 次插入6 次删除
  1. 3 1
      Terminal.Gui/Views/ListView.cs
  2. 4 4
      UICatalog/Scenarios/Sliders.cs
  3. 26 1
      docfx/docs/navigation.md

+ 3 - 1
Terminal.Gui/Views/ListView.cs

@@ -471,7 +471,7 @@ public class ListView : View, IDesignable
 
         if (me.Flags == MouseFlags.Button1DoubleClicked)
         {
-            OnOpenSelectedItem ();
+            return OnOpenSelectedItem ();
         }
 
         return true;
@@ -766,6 +766,8 @@ public class ListView : View, IDesignable
         }
 
         OpenSelectedItem?.Invoke (this, new ListViewItemEventArgs (_selected, value));
+
+        // BUGBUG: this should not blindly return true.
         return true;
     }
 

+ 4 - 4
UICatalog/Scenarios/Sliders.cs

@@ -78,7 +78,7 @@ public class Sliders : Scenario
 
         var single = new Slider (singleOptions)
         {
-            Title = "Continuous",
+            Title = "_Continuous",
             X = 0,
             Y = prev == null ? 0 : Pos.Bottom (prev),
             Type = SliderType.Single,
@@ -106,14 +106,14 @@ public class Sliders : Scenario
 
         single.OptionsChanged += (s, e) =>
                                  {
-                                     single.Title = $"Continuous {e.Options.FirstOrDefault ().Key}";
+                                     single.Title = $"_Continuous {e.Options.FirstOrDefault ().Key}";
                                  };
 
         List<object> oneOption = new () { "The Only Option" };
 
         var one = new Slider (oneOption)
         {
-            Title = "One Option",
+            Title = "_One Option",
             X = 0,
             Y = prev == null ? 0 : Pos.Bottom (single),
             Type = SliderType.Single,
@@ -151,7 +151,7 @@ public class Sliders : Scenario
 
         var configView = new FrameView
         {
-            Title = "Configuration",
+            Title = "Confi_guration",
             X = Pos.Percent (50),
             Y = 0,
             Width = Dim.Fill (),

+ 26 - 1
docfx/docs/navigation.md

@@ -634,4 +634,29 @@ In v2_develop it's all kinds of confused. Here's what it SHOULD do:
 
 Like `Checkbox` the right thing to do is for Hotkey to NOT set focus. Why? If the user is in a TextField and wants to change a setting via a RadioGroup, they should be able to use the hotkey and NOT have to then re-focus back on the TextView. The `TextView` in `Text Input Controls` Scenario is a good example of this.
 
-## `Slider` - Should operate just like RadioGroup
+## `Slider` - Should operate just like RadioGroup
+
+- BUGBUG: Slider should support Hotkey w/in Legends
+
+## `NumericUpDown`
+
+## `ListView`
+
+### `!HasFocus`
+
+* `Enter` - n/a because no focus
+* `Space` - n/a because no focus
+* `Title.Hotkey` - `Command.Hotkey` -> Set focus. Do NOT advance state.
+* `Click` - `Command.Select` -> If `CanFocus`, sets focus and advances state to clicked ListItem.
+* `Double Click` - Sets focus and advances state to clicked ListItem and then raises `Accept`.
+
+### `HasFocus`
+
+* `Enter` - `Command.Accept` -> Advances state to selected RadioItem and Raises `Accept` 
+* `Space` - `Command.Select` -> Advances state
+* `Title.Hotkey` - `Command.Hotkey` -> does nothing
+* `RadioItem.Hotkey` - `Command.Select` -> Advance State to RadioItem with hotkey.
+* `Click` - `Command.Select` -> If `CanFocus`, sets focus and advances state to clicked ListItem.
+* `Double Click` - Sets focus and advances state to clicked ListItem and then raises `Accept`.
+
+What about `ListView.MultiSelect` and `ListViews.AllowsMarking`?