Skip to content

Commit 524be85

Browse files
committed
add OS version info to UI Catalog
1 parent c65c575 commit 524be85

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Terminal.Gui/Terminal.Gui.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<InformationalVersion>1.9</InformationalVersion>
1616
</PropertyGroup>
1717
<ItemGroup>
18+
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
1819
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
1920
<PackageReference Include="NStack.Core" Version="1.0.7" />
2021
<InternalsVisibleTo Include="UnitTests" />

UICatalog/UICatalog.cs

+9-5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ class UICatalogTopLevel : Toplevel {
160160
public StatusItem Numlock;
161161
public StatusItem Scrolllock;
162162
public StatusItem DriverName;
163+
public StatusItem OS;
163164

164165
public UICatalogTopLevel ()
165166
{
@@ -177,19 +178,17 @@ public UICatalogTopLevel ()
177178
"About UI Catalog", () => MessageBox.Query ("About UI Catalog", _aboutMessage.ToString(), "_Ok"), null, null, Key.CtrlMask | Key.A),
178179
}),
179180
});
180-
181+
181182
Capslock = new StatusItem (Key.CharMask, "Caps", null);
182183
Numlock = new StatusItem (Key.CharMask, "Num", null);
183184
Scrolllock = new StatusItem (Key.CharMask, "Scroll", null);
184185
DriverName = new StatusItem (Key.CharMask, "Driver:", null);
186+
OS = new StatusItem (Key.CharMask, "OS:", null);
185187

186188
StatusBar = new StatusBar () {
187189
Visible = true,
188190
};
189191
StatusBar.Items = new StatusItem [] {
190-
Capslock,
191-
Numlock,
192-
Scrolllock,
193192
new StatusItem(Key.Q | Key.CtrlMask, "~CTRL-Q~ Quit", () => {
194193
if (_selectedScenario is null){
195194
// This causes GetScenarioToRun to return null
@@ -199,14 +198,18 @@ public UICatalogTopLevel ()
199198
_selectedScenario.RequestStop();
200199
}
201200
}),
202-
new StatusItem(Key.F10, "~F10~ Hide/Show Status Bar", () => {
201+
new StatusItem(Key.F10, "~F10~ Status Bar", () => {
203202
StatusBar.Visible = !StatusBar.Visible;
204203
LeftPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
205204
RightPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
206205
LayoutSubviews();
207206
SetChildNeedsDisplay();
208207
}),
209208
DriverName,
209+
OS,
210+
Capslock,
211+
Numlock,
212+
Scrolllock,
210213
};
211214

212215
LeftPane = new FrameView ("Categories") {
@@ -281,6 +284,7 @@ void LoadedHandler ()
281284
miIsMouseDisabled.Checked = Application.IsMouseDisabled;
282285
miHeightAsBuffer.Checked = Application.HeightAsBuffer;
283286
DriverName.Title = $"Driver: {Driver.GetType ().Name}";
287+
OS.Title = $"OS: {Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem} {Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion}";
284288

285289
if (_selectedScenario != null) {
286290
_selectedScenario = null;

0 commit comments

Comments
 (0)