mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-12-29 17:28:06 +01:00
Add Layout widget (#1041)
* Add width to panels * Add height to panels * Replace RenderContext with RenderOptions * Remove exclusivity from alternative buffer * Add Layout widget * Add Align widget
This commit is contained in:
@@ -27,19 +27,18 @@ public static partial class AnsiConsoleExtensions
|
||||
throw new NotSupportedException("Alternate buffers are not supported by your terminal.");
|
||||
}
|
||||
|
||||
console.ExclusivityMode.Run<object?>(() =>
|
||||
{
|
||||
// Switch to alternate screen
|
||||
console.Write(new ControlCode("\u001b[?1049h\u001b[H"));
|
||||
// Switch to alternate screen
|
||||
console.Write(new ControlCode("\u001b[?1049h\u001b[H"));
|
||||
|
||||
try
|
||||
{
|
||||
// Execute custom action
|
||||
action();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Switch back to primary screen
|
||||
console.Write(new ControlCode("\u001b[?1049l"));
|
||||
|
||||
// Dummy result
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user