This commit is contained in:
Tig
2024-09-29 16:58:42 -06:00
parent 3b256f20dc
commit 8fbbba750b
3 changed files with 33 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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 (),

View File

@@ -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`?