mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Fixes #2222. RadioGroup first upper case and ProcessColdKey is not working well.
This commit is contained in:
@@ -172,5 +172,20 @@ namespace Terminal.Gui.Views {
|
||||
Assert.True (rg.ProcessKey (new KeyEvent (Key.Space, new KeyModifiers ())));
|
||||
Assert.Equal (1, rg.SelectedItem);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ProcessColdKey_HotKey ()
|
||||
{
|
||||
var rg = new RadioGroup (new NStack.ustring [] { "Left", "Right", "Cen_tered", "Justified" });
|
||||
|
||||
Assert.True (rg.ProcessColdKey (new KeyEvent (Key.t, new KeyModifiers ())));
|
||||
Assert.Equal (2, rg.SelectedItem);
|
||||
Assert.True (rg.ProcessColdKey (new KeyEvent (Key.L, new KeyModifiers ())));
|
||||
Assert.Equal (0, rg.SelectedItem);
|
||||
Assert.True (rg.ProcessColdKey (new KeyEvent (Key.J, new KeyModifiers ())));
|
||||
Assert.Equal (3, rg.SelectedItem);
|
||||
Assert.True (rg.ProcessColdKey (new KeyEvent (Key.R, new KeyModifiers ())));
|
||||
Assert.Equal (1, rg.SelectedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4062,5 +4062,27 @@ This is a tes
|
||||
Assert.False (view.IsKeyPress);
|
||||
Assert.True (view.IsKeyUp);
|
||||
}
|
||||
|
||||
[Fact, AutoInitShutdown]
|
||||
public void GetNormalColor_ColorScheme ()
|
||||
{
|
||||
var view = new View { ColorScheme = Colors.Base };
|
||||
|
||||
Assert.Equal (view.ColorScheme.Normal, view.GetNormalColor ());
|
||||
|
||||
view.Enabled = false;
|
||||
Assert.Equal (view.ColorScheme.Disabled, view.GetNormalColor ());
|
||||
}
|
||||
|
||||
[Fact, AutoInitShutdown]
|
||||
public void GetHotNormalColor_ColorScheme ()
|
||||
{
|
||||
var view = new View { ColorScheme = Colors.Base };
|
||||
|
||||
Assert.Equal (view.ColorScheme.HotNormal, view.GetHotNormalColor ());
|
||||
|
||||
view.Enabled = false;
|
||||
Assert.Equal (view.ColorScheme.Disabled, view.GetHotNormalColor ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user