70 instantiations of PanelRect
Aspire.Tray.Tests (70)
src\Aspire.Tray\Common\TrayPanel.cs (49)
807_viewport = new(0, HeaderHeight + noticeHeight, Width, Math.Max(0, height - chrome)); 813var panel = new PanelRect(0, 0, Width, height); 814var footer = new PanelRect(0, height - FooterHeight, Width, FooterHeight); 817commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, footer.Y, Width, 1)), palette.Separator)); 820commands.Add(new FillPathCommand(PanelPath.RoundedRect(new(0, 0, Width, HeaderHeight), CornerRadius, CornerRadius, 0, 0), palette.Gutter)); 821commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, HeaderHeight - 1, Width, 1)), palette.Separator)); 839commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, _viewport.Y, Width, 1)), palette.Separator)); 859var headerBounds = new PanelRect(20, top + 4, 200, 24); 892commands.Add(new FillPathCommand(PanelPath.RoundedRect(new(Width - 7, thumbY, 4, thumb), 2), palette.TextTertiary.WithAlpha(0.4))); 930commands.Add(new LogoCommand(new(20, middle - 10, 20, 20))); 931var title = new PanelRect(TextLeft, middle - 10, HeaderTitleWidth, 20); 937var statusBounds = new PanelRect(statusLeft, middle - 8, Width - statusLeft - 16, 16); 944var banner = new PanelRect(12, HeaderHeight + 8, Width - 24, height); 951TrayPanelGlyphs.AddIcon(commands, PanelIcon.Alert, new(banner.X + 10, banner.Y + 9, 16, 16), palette.BannerText); 952var text = new PanelRect(banner.X + 34, banner.Y + 8, NoticeTextWidth, height - 16); 966var art = new PanelRect(Width / 2 - 16, top + 20, 32, 32); 975var titleBounds = new PanelRect(20, top + 62, Width - 40, 20); 976var hintBounds = new PanelRect(44, top + 84, Width - 88, 34); 993var labelBounds = new PanelRect(20, top + 4, 200, 24); 1003var toggle = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, 24); 1008new(RowContentRight - 22, top + 8, 16, 16), palette.TextTertiary); 1014var clear = new PanelRect(RowContentRight - 30 - 52, top + 6, 52, 20); 1026var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4); 1037TrayPanelGlyphs.AddStatus(commands, GetStatusGlyph(host, live), new(20, top + 16, 20, 20), palette); 1044commands.Add(new TextCommand(new(TextLeft, top + 8, textRight - TextLeft, 18), host.DisplayName, PanelFontRole.Name, palette.TextPrimary)); 1045commands.Add(new TextCommand(new(TextLeft, top + 27, textRight - TextLeft, 16), detail, PanelFontRole.Body, 1052var bounds = new PanelRect(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1143var card = new PanelRect(RowInset, top, Width - 2 * RowInset, height - ActionListGap); 1149var item = new PanelRect(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight); 1158TrayPanelGlyphs.AddIcon(fallback, PanelIcon.AppWindow, new(TextLeft, item.Y + 7, 16, 16), iconColor); 1159commands.Add(new AppIconCommand(new(TextLeft, item.Y + 7, 16, 16), _openInApplications[index], fallback)); 1160commands.Add(new TextCommand(new(TextLeft + 26, item.Y, item.Right - 8 - TextLeft - 26, item.Height), label, 1166TrayPanelGlyphs.AddIcon(commands, icon, new(22, item.Y + 7, 16, 16), iconColor); 1173new(item.Right - 8 - 16, item.Y + 7, 16, 16), palette.TextTertiary); 1175commands.Add(new TextCommand(new(TextLeft, item.Y, labelRight - TextLeft, item.Height), label, PanelFontRole.Body, palette.TextPrimary)); 1215var card = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8); 1226var questionBounds = new PanelRect(card.X + 12, card.Y + 9, textWidth, 18); 1227var detailBounds = new PanelRect(card.X + 12, card.Y + 28, textWidth, 16); 1238var acceptBounds = new PanelRect(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1239var cancelBounds = new PanelRect(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1268var back = new PanelRect(12, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1273var title = new PanelRect(back.Right + 8, (HeaderHeight - 20) / 2, Width - back.Right - 24, 20); 1281var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4); 1295var toggle = new PanelRect(RowContentRight - 36, top + 9, 32, 18); 1297commands.Add(new TextCommand(new(20, top + 8, textWidth, 20), title, PanelFontRole.Name, 1299commands.Add(new TextCommand(new(20, top + 28, textWidth, 30), description, PanelFontRole.Body, 1307var name = new PanelRect(20, top + 4, Width - 40, 20); 1317var bounds = new PanelRect(20, y, Width - 40, 16); 1339var bounds = new PanelRect(x, footer.Y + 8, ButtonSize, ButtonSize);
src\Aspire.Tray\Common\TrayPanelGeometry.cs (4)
24public PanelRect Inset(double dx, double dy) => new(X + dx, Y + dy, Width - 2 * dx, Height - 2 * dy); 26public PanelRect Offset(double dx, double dy) => new(X + dx, Y + dy, Width, Height); 34return right <= x || bottom <= y ? default : new(x, y, right - x, bottom - y); 205return minX > maxX ? default : new(minX, minY, maxX - minX, maxY - minY);
src\Aspire.Tray\Common\TrayPanelGlyphs.cs (5)
81Fill(PanelPath.RoundedRect(new(7, 7, 6, 6), 1.4), palette.Neutral); 112Fill(PanelPath.RoundedRect(new(4.25, 4.25, 7.5, 7.5), 1.5)); 156Stroke(PanelPath.RoundedRect(new(2.25, 3, 11.5, 10), 1.75), 1.4); 167Stroke(PanelPath.RoundedRect(new(5.75, 5.75, 7.5, 7.5), 1.5), 1.4); 208var track = new PanelRect(0, 0, ToggleDesignWidth, ToggleDesignHeight);
TrayPanelTests.cs (12)
72var bounds = new PanelRect(0, 0, scene.Width, scene.Height); 762var box = new PanelRect(10, 20, 32, 18); 871Assert.Contains(gutters, bounds => Near(bounds, new(0, 0, TrayPanel.Width, TrayPanel.HeaderHeight))); 872Assert.Contains(gutters, bounds => Near(bounds, new(0, scene.Height - TrayPanel.FooterHeight, TrayPanel.Width, TrayPanel.FooterHeight))); 875Assert.Contains(new PanelRect(0, TrayPanel.HeaderHeight - 1, TrayPanel.Width, 1), separators); 876Assert.Contains(new PanelRect(0, scene.Height - TrayPanel.FooterHeight, TrayPanel.Width, 1), separators); 883Assert.All(scene.Commands.OfType<LogoCommand>(), logo => Assert.Equal(new PanelRect(20, middle - 10, 20, 20), logo.Bounds)); 950var rect = new PanelRect(8, 10, 100, 40); 968var box = new PanelRect(40, 60, 20, 20); 997var box = new PanelRect(4, 8, 16, 16); 1054TrayPanelGlyphs.AddStatus(commands, PanelStatusGlyph.Unhealthy, new(0, 0, 20, 20), palette); 1099TrayPanelGlyphs.AddStatus(commands, glyph, new(0, 0, 20, 20), palette);
71 references to PanelRect
Aspire.Tray.Tests (71)
Helpers\TrayPanelSvgRenderer.cs (1)
203private static object[] Bounds(PanelRect rect)
src\Aspire.Tray\Common\TrayPanel.cs (37)
56private PanelRect _viewport; 112public PanelRect Viewport 813var panel = new PanelRect(0, 0, Width, height); 814var footer = new PanelRect(0, height - FooterHeight, Width, FooterHeight); 859var headerBounds = new PanelRect(20, top + 4, 200, 24); 910var clip = IsChrome(focused.Kind) ? panel : _viewport; 931var title = new PanelRect(TextLeft, middle - 10, HeaderTitleWidth, 20); 937var statusBounds = new PanelRect(statusLeft, middle - 8, Width - statusLeft - 16, 16); 944var banner = new PanelRect(12, HeaderHeight + 8, Width - 24, height); 952var text = new PanelRect(banner.X + 34, banner.Y + 8, NoticeTextWidth, height - 16); 966var art = new PanelRect(Width / 2 - 16, top + 20, 32, 32); 975var titleBounds = new PanelRect(20, top + 62, Width - 40, 20); 976var hintBounds = new PanelRect(44, top + 84, Width - 88, 34); 993var labelBounds = new PanelRect(20, top + 4, 200, 24); 1003var toggle = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, 24); 1014var clear = new PanelRect(RowContentRight - 30 - 52, top + 6, 52, 20); 1026var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4); 1052var bounds = new PanelRect(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1143var card = new PanelRect(RowInset, top, Width - 2 * RowInset, height - ActionListGap); 1149var item = new PanelRect(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight); 1215var card = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8); 1226var questionBounds = new PanelRect(card.X + 12, card.Y + 9, textWidth, 18); 1227var detailBounds = new PanelRect(card.X + 12, card.Y + 28, textWidth, 16); 1238var acceptBounds = new PanelRect(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1239var cancelBounds = new PanelRect(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1268var back = new PanelRect(12, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1273var title = new PanelRect(back.Right + 8, (HeaderHeight - 20) / 2, Width - back.Right - 24, 20); 1281var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4); 1295var toggle = new PanelRect(RowContentRight - 36, top + 9, 32, 18); 1307var name = new PanelRect(20, top + 4, Width - 40, 20); 1317var bounds = new PanelRect(20, y, Width - 40, 16); 1324private void AddFooter(List<PanelCommand> commands, List<PanelHitTarget> targets, PanelRect footer, TrayPanelPalette palette) 1339var bounds = new PanelRect(x, footer.Y + 8, ButtonSize, ButtonSize); 1352private void AddInteractionFill(List<PanelCommand> commands, PanelTargetKey key, PanelRect bounds, TrayPanelPalette palette, bool includeFocus) 1363private void AddTarget(List<PanelHitTarget> targets, PanelTargetKey key, PanelRect bounds, string name, bool enabled, AppHostMenuItem? host, 1366var hit = IsChrome(key.Kind) ? bounds : bounds.Intersect(_viewport); 1376private void AddLabel(string label, string text, PanelRect bounds, bool chrome)
src\Aspire.Tray\Common\TrayPanelGeometry.cs (10)
20public bool Contains(PanelRect other) => other.X >= X && other.Y >= Y && other.Right <= Right && other.Bottom <= Bottom; 22public bool IntersectsWith(PanelRect other) => other.X < Right && X < other.Right && other.Y < Bottom && Y < other.Bottom; 24public PanelRect Inset(double dx, double dy) => new(X + dx, Y + dy, Width - 2 * dx, Height - 2 * dy); 26public PanelRect Offset(double dx, double dy) => new(X + dx, Y + dy, Width, Height); 28public PanelRect Intersect(PanelRect other) 133public static PanelPath Rectangle(PanelRect rect) 137public static PanelPath RoundedRect(PanelRect rect, double radius) 141public static PanelPath RoundedRect(PanelRect rect, double topLeft, double topRight, double bottomRight, double bottomLeft) 188public PanelRect GetControlBounds()
src\Aspire.Tray\Common\TrayPanelGlyphs.cs (4)
52public static void AddStatus(List<PanelCommand> commands, PanelStatusGlyph glyph, PanelRect bounds, TrayPanelPalette palette) 97public static void AddIcon(List<PanelCommand> commands, PanelIcon icon, PanelRect bounds, PanelColor color) 204public static void AddToggle(List<PanelCommand> commands, bool on, bool enabled, PanelRect bounds, TrayPanelPalette palette) 208var track = new PanelRect(0, 0, ToggleDesignWidth, ToggleDesignHeight);
src\Aspire.Tray\Common\TrayPanelScene.cs (9)
64PanelRect Bounds, 73internal sealed record LogoCommand(PanelRect Bounds) : PanelCommand; 80internal sealed record AppIconCommand(PanelRect Bounds, string Application, IReadOnlyList<PanelCommand> Fallback) : PanelCommand; 83internal sealed record PushClipCommand(PanelRect Bounds) : PanelCommand; 173PanelRect Bounds, 174PanelRect HitBounds, 205PanelRect Bounds, 206PanelRect VisibleBounds, 271internal sealed record PanelAction(PanelActionKind Kind, AppHostMenuItem? Host = null, PanelRect Anchor = default)
TrayPanelTests.cs (10)
72var bounds = new PanelRect(0, 0, scene.Width, scene.Height); 468var footer = scene.Targets.Single(target => target.Kind == PanelTargetKind.Quit).Bounds; 762var box = new PanelRect(10, 20, 32, 18); 869static bool Near(PanelRect a, PanelRect b) 950var rect = new PanelRect(8, 10, 100, 40); 968var box = new PanelRect(40, 60, 20, 20); 997var box = new PanelRect(4, 8, 16, 16); 1353private static PanelResponse Click(TrayPanel panel, PanelRect bounds, double? offsetX = null) 1372private static PanelRect GetBounds(PanelCommand command)