mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
add OS version info to UI Catalog
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<InformationalVersion>1.9</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
|
||||
<PackageReference Include="NStack.Core" Version="1.0.7" />
|
||||
<InternalsVisibleTo Include="UnitTests" />
|
||||
|
||||
@@ -160,6 +160,7 @@ namespace UICatalog {
|
||||
public StatusItem Numlock;
|
||||
public StatusItem Scrolllock;
|
||||
public StatusItem DriverName;
|
||||
public StatusItem OS;
|
||||
|
||||
public UICatalogTopLevel ()
|
||||
{
|
||||
@@ -177,19 +178,17 @@ namespace UICatalog {
|
||||
"About UI Catalog", () => MessageBox.Query ("About UI Catalog", _aboutMessage.ToString(), "_Ok"), null, null, Key.CtrlMask | Key.A),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Capslock = new StatusItem (Key.CharMask, "Caps", null);
|
||||
Numlock = new StatusItem (Key.CharMask, "Num", null);
|
||||
Scrolllock = new StatusItem (Key.CharMask, "Scroll", null);
|
||||
DriverName = new StatusItem (Key.CharMask, "Driver:", null);
|
||||
OS = new StatusItem (Key.CharMask, "OS:", null);
|
||||
|
||||
StatusBar = new StatusBar () {
|
||||
Visible = true,
|
||||
};
|
||||
StatusBar.Items = new StatusItem [] {
|
||||
Capslock,
|
||||
Numlock,
|
||||
Scrolllock,
|
||||
new StatusItem(Key.Q | Key.CtrlMask, "~CTRL-Q~ Quit", () => {
|
||||
if (_selectedScenario is null){
|
||||
// This causes GetScenarioToRun to return null
|
||||
@@ -199,7 +198,7 @@ namespace UICatalog {
|
||||
_selectedScenario.RequestStop();
|
||||
}
|
||||
}),
|
||||
new StatusItem(Key.F10, "~F10~ Hide/Show Status Bar", () => {
|
||||
new StatusItem(Key.F10, "~F10~ Status Bar", () => {
|
||||
StatusBar.Visible = !StatusBar.Visible;
|
||||
LeftPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
|
||||
RightPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
|
||||
@@ -207,6 +206,10 @@ namespace UICatalog {
|
||||
SetChildNeedsDisplay();
|
||||
}),
|
||||
DriverName,
|
||||
OS,
|
||||
Capslock,
|
||||
Numlock,
|
||||
Scrolllock,
|
||||
};
|
||||
|
||||
LeftPane = new FrameView ("Categories") {
|
||||
@@ -281,6 +284,7 @@ namespace UICatalog {
|
||||
miIsMouseDisabled.Checked = Application.IsMouseDisabled;
|
||||
miHeightAsBuffer.Checked = Application.HeightAsBuffer;
|
||||
DriverName.Title = $"Driver: {Driver.GetType ().Name}";
|
||||
OS.Title = $"OS: {Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem} {Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion}";
|
||||
|
||||
if (_selectedScenario != null) {
|
||||
_selectedScenario = null;
|
||||
|
||||
Reference in New Issue
Block a user