Skip to content

Commit

Permalink
Builds CollectionNavigator support into UI Catalog for TableView (gui…
Browse files Browse the repository at this point in the history
…-cs#2584)

* Builds collectionnav support into UI cat for TableView

* Fixes keyboard mapping

* MultiSelect = false for TableView

* MultiSelect = false doesn't unbind ctrl-a
  • Loading branch information
tig authored and BDisp committed May 2, 2023
1 parent 5ba31d3 commit 1325d51
Show file tree
Hide file tree
Showing 11 changed files with 258 additions and 249 deletions.
8 changes: 4 additions & 4 deletions Terminal.Gui/View/ViewKeyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public virtual Key HotKey {
var v = value == Key.Unknown ? Key.Null : value;
if (_hotKey != Key.Null && ContainsKeyBinding (Key.Space | _hotKey)) {
if (v == Key.Null) {
ClearKeybinding (Key.Space | _hotKey);
ClearKeyBinding (Key.Space | _hotKey);
} else {
ReplaceKeyBinding (Key.Space | _hotKey, Key.Space | v);
}
Expand Down Expand Up @@ -273,7 +273,7 @@ public bool ContainsKeyBinding (Key key)
/// <summary>
/// Removes all bound keys from the View and resets the default bindings.
/// </summary>
public void ClearKeybindings ()
public void ClearKeyBindings ()
{
KeyBindings.Clear ();
}
Expand All @@ -282,7 +282,7 @@ public void ClearKeybindings ()
/// Clears the existing keybinding (if any) for the given <paramref name="key"/>.
/// </summary>
/// <param name="key"></param>
public void ClearKeybinding (Key key)
public void ClearKeyBinding (Key key)
{
KeyBindings.Remove (key);
}
Expand All @@ -292,7 +292,7 @@ public void ClearKeybinding (Key key)
/// keys bound to the same command and this method will clear all of them.
/// </summary>
/// <param name="command"></param>
public void ClearKeybinding (params Command [] command)
public void ClearKeyBinding (params Command [] command)
{
foreach (var kvp in KeyBindings.Where (kvp => kvp.Value.SequenceEqual (command)).ToArray ()) {
KeyBindings.Remove (kvp.Key);
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public override Key HotKey {
var v = value == Key.Unknown ? Key.Null : value;
if (base.HotKey != Key.Null && ContainsKeyBinding (Key.Space | base.HotKey)) {
if (v == Key.Null) {
ClearKeybinding (Key.Space | base.HotKey);
ClearKeyBinding (Key.Space | base.HotKey);
} else {
ReplaceKeyBinding (Key.Space | base.HotKey, Key.Space | v);
}
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/ListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public bool AllowsMarking {
if (allowsMarking) {
AddKeyBinding (Key.Space, Command.ToggleChecked);
} else {
ClearKeybinding (Key.Space);
ClearKeyBinding (Key.Space);
}

SetNeedsDisplay ();
Expand Down
Loading

0 comments on commit 1325d51

Please sign in to comment.