mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Add support for selection prompt highlighting
This commit is contained in:
@ -35,6 +35,11 @@ namespace Spectre.Console
|
||||
/// </summary>
|
||||
public int PageSize { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the highlight style of the selected choice.
|
||||
/// </summary>
|
||||
public Style? HighlightStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not
|
||||
/// at least one selection is required.
|
||||
@ -68,7 +73,7 @@ namespace Spectre.Console
|
||||
|
||||
var converter = Converter ?? TypeConverterHelper.ConvertToString;
|
||||
|
||||
var list = new RenderableMultiSelectionList<T>(console, Title, PageSize, Choices, converter);
|
||||
var list = new RenderableMultiSelectionList<T>(console, Title, PageSize, Choices, converter, HighlightStyle);
|
||||
using (new RenderHookScope(console, list))
|
||||
{
|
||||
console.Cursor.Hide();
|
||||
|
Reference in New Issue
Block a user