23 instantiations of TextCommand
Aspire.Tray.Tests (23)
src\Aspire.Tray\Common\TrayPanel.cs (23)
989
sink.Add(new
TextCommand
(headerBounds, general ? "GENERAL" : "ABOUT", PanelFontRole.Section, palette.TextTertiary));
1179
commands.Add(new
TextCommand
(title, "Aspire", PanelFontRole.Title, palette.TextPrimary));
1188
commands.Add(new
TextCommand
(statusBounds, status, PanelFontRole.Body, palette.TextSecondary, ExplicitBaseline: HeaderBaseline));
1214
? new
TextCommand
(text, notice, PanelFontRole.Body, palette.BannerText)
1215
: new
TextCommand
(text, notice, PanelFontRole.Body, palette.BannerText, MaxLines: 2));
1237
commands.Add(new
TextCommand
(titleBounds, title, PanelFontRole.Name, palette.TextPrimary, PanelTextAlignment.Center));
1238
commands.Add(new
TextCommand
(hintBounds, hint, PanelFontRole.Body, palette.TextSecondary,
1256
commands.Add(new
TextCommand
(labelBounds, label, PanelFontRole.Section, palette.TextTertiary));
1266
commands.Add(new
TextCommand
(labelBounds, label, PanelFontRole.Section, palette.TextTertiary));
1277
commands.Add(new
TextCommand
(clear, "Clear", PanelFontRole.Body, palette.Accent, PanelTextAlignment.Center));
1306
commands.Add(new
TextCommand
(new(TextLeft, top + 8, textRight - TextLeft, 18), host.DisplayName, PanelFontRole.Name, palette.TextPrimary));
1307
commands.Add(new
TextCommand
(new(TextLeft, top + 27, textRight - TextLeft, 16), detail, PanelFontRole.Body,
1421
commands.Add(new
TextCommand
(new(NestedTextLeft, item.Y, item.Right - 8 - NestedTextLeft, item.Height), label,
1436
commands.Add(new
TextCommand
(new(TextLeft, item.Y, labelRight - TextLeft, item.Height), label, PanelFontRole.Body, palette.TextPrimary));
1489
commands.Add(new
TextCommand
(questionBounds, question, PanelFontRole.Name, palette.TextPrimary));
1490
commands.Add(new
TextCommand
(detailBounds, detail, PanelFontRole.Body, palette.TextSecondary,
1509
commands.Add(new
TextCommand
(cancelBounds, "Cancel", PanelFontRole.Button, palette.TextPrimary, PanelTextAlignment.Center));
1523
commands.Add(new
TextCommand
(acceptBounds, accept, PanelFontRole.Button, palette.OnColor, PanelTextAlignment.Center));
1536
commands.Add(new
TextCommand
(title, TraySettingsText.PanelTitle, PanelFontRole.Title, palette.TextPrimary));
1559
commands.Add(new
TextCommand
(new(20, top + 8, textWidth, 20), title, PanelFontRole.Name,
1561
commands.Add(new
TextCommand
(new(20, top + 28, textWidth, 30), description, PanelFontRole.Body,
1570
commands.Add(new
TextCommand
(name, "Aspire Tray", PanelFontRole.Name, palette.TextPrimary));
1580
commands.Add(new
TextCommand
(bounds, line, PanelFontRole.Body, palette.TextSecondary, Truncation: PanelTruncation.Middle));
39 references to TextCommand
Aspire.Tray.Tests (39)
Helpers\TrayPanelSvgRenderer.cs (4)
60
case
TextCommand
text:
148
foreach (
var
text in scene.Commands.OfType<
TextCommand
>().Where(text => text.MaxLines == 1))
170
private static XElement RenderText(
TextCommand
text)
src\Aspire.Tray\Common\TrayPanelSceneJson.cs (2)
49
foreach (
var
text in scene.Commands.OfType<
TextCommand
>())
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (2)
650
case
TextCommand
text:
679
private void RenderText(nint context,
TextCommand
text)
TrayPanelTests.cs (31)
139
var
nameText = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == host.DisplayName);
140
var
detailText = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == detail);
146
nameText = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == host.DisplayName);
147
detailText = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == detail);
154
nameText = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == host.DisplayName);
176
Assert.Contains(scene.Commands.OfType<
TextCommand
>(), text => text.Text == "RECENT · 2");
200
Assert.Contains(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == "No AppHosts running");
246
panel.Scene.Commands.OfType<
TextCommand
>().Where(text => text.Bounds.Y >= items[0].Bounds.Y && text.Bounds.Bottom <= items[^1].Bounds.Bottom)
278
Assert.Contains(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == "Show in File Explorer");
740
var texts = panel.Scene.Commands.OfType<
TextCommand
>().Select(text => text.Text).ToList();
761
Assert.Contains(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == missing.Id.AppHostPath);
787
var texts = panel.Scene.Commands.OfType<
TextCommand
>().Select(text => text.Text).ToList();
805
Assert.Contains(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Text == TraySettingsText.StableNativeInstallationRequired);
817
Assert.Contains(panel.Scene.Commands.OfType<
TextCommand
>(),
935
Assert.Contains(scene.Commands.OfType<
TextCommand
>(), text => text.Text == $"Unhealthy · {location} · PID 48213");
968
foreach (
var
text in scene.Commands.OfType<
TextCommand
>().Where(text => text.MaxLines == 1))
1048
var
title = scene.Commands.OfType<
TextCommand
>().Single(text => text.Text == "Aspire");
1049
var
status = scene.Commands.OfType<
TextCommand
>().Single(text => text.ExplicitBaseline is not null);
1089
var header = scene.Commands.OfType<
TextCommand
>().Where(text => text.Bounds.Bottom <= TrayPanel.HeaderHeight).ToList();
1119
Assert.Contains(withNotice.Scene.Commands.OfType<
TextCommand
>(), text => text.Text.StartsWith("Unable to save", StringComparison.Ordinal));
1145
var
noticeText = scene.Commands.OfType<
TextCommand
>().Single(text => text.Text == state.Notice);
1262
var
label = Assert.Single(panel.Scene.Commands.OfType<
TextCommand
>(), text => text.Bounds == accept.Bounds);
1370
Assert.All(scene.Commands.OfType<
TextCommand
>().Where(text => text.Color != palette.Accent),
1585
Assert.DoesNotContain(scene.Commands.OfType<
TextCommand
>(), text => text.Text == "Documentation");