mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-29 03:55:48 +08:00
Add link support for supported terminals
Also refactors the code quite a bit, to make it a bit more easier to add features like this in the future. Closes #75
This commit is contained in:
committed by
Patrik Svensson
parent
1601ef24b3
commit
504746c5dc
@@ -16,12 +16,13 @@ namespace Spectre.Console
|
||||
ColorSystem = ColorSystemSupport.Detect,
|
||||
Out = System.Console.Out,
|
||||
});
|
||||
Initialize(System.Console.Out);
|
||||
Created = true;
|
||||
return console;
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current renderer.
|
||||
/// Gets the underlying <see cref="IAnsiConsole"/>.
|
||||
/// </summary>
|
||||
public static IAnsiConsole Console => _console.Value;
|
||||
|
||||
@@ -30,8 +31,6 @@ namespace Spectre.Console
|
||||
/// </summary>
|
||||
public static Capabilities Capabilities => Console.Capabilities;
|
||||
|
||||
internal static bool Created { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the buffer width of the console.
|
||||
/// </summary>
|
||||
@@ -48,33 +47,6 @@ namespace Spectre.Console
|
||||
get => Console.Height;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the foreground color.
|
||||
/// </summary>
|
||||
public static Color Foreground
|
||||
{
|
||||
get => Console.Foreground;
|
||||
set => Console.SetColor(value, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color.
|
||||
/// </summary>
|
||||
public static Color Background
|
||||
{
|
||||
get => Console.Background;
|
||||
set => Console.SetColor(value, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text decoration.
|
||||
/// </summary>
|
||||
public static Decoration Decoration
|
||||
{
|
||||
get => Console.Decoration;
|
||||
set => Console.Decoration = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="IAnsiConsole"/> instance
|
||||
/// from the provided settings.
|
||||
@@ -85,29 +57,5 @@ namespace Spectre.Console
|
||||
{
|
||||
return ConsoleBuilder.Build(settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets colors and text decorations.
|
||||
/// </summary>
|
||||
public static void Reset()
|
||||
{
|
||||
Console.Reset();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the current applied text decorations.
|
||||
/// </summary>
|
||||
public static void ResetDecoration()
|
||||
{
|
||||
Console.ResetDecoration();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the current applied foreground and background colors.
|
||||
/// </summary>
|
||||
public static void ResetColors()
|
||||
{
|
||||
Console.ResetColors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user