84 instantiations of PanelRect
aspire-tray (84)
src\Aspire.Tray\Common\TrayPanel.cs (67)
491thumb = new(Width - 7, thumbTop, 4, thumbHeight); 935_viewport = new(0, HeaderHeight + noticeHeight, Width, Math.Max(0, height - chrome)); 941var panel = new PanelRect(0, 0, Width, height); 942var footer = new PanelRect(0, height - FooterHeight, Width, FooterHeight); 945commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, footer.Y, Width, 1)), palette.Separator)); 948commands.Add(new FillPathCommand(PanelPath.RoundedRect(new(0, 0, Width, HeaderHeight), CornerRadius, CornerRadius, 0, 0), palette.Gutter)); 949commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, HeaderHeight - 1, Width, 1)), palette.Separator)); 968commands.Add(new FillPathCommand(PanelPath.Rectangle(new(0, _viewport.Y, Width, 1)), palette.Separator)); 988var headerBounds = new PanelRect(20, top + 4, 200, 24); 1054var all = new PanelRect(0, 0, Width, height); 1065Line(HeaderHeight / 2, "header", new(0, 0, Width, HeaderHeight)); 1069Line(HeaderHeight + 8 + 17, "notice", new(0, HeaderHeight, Width, _viewport.Y - HeaderHeight)); 1070Box(new(LeadingCenter - 8, HeaderHeight + 8 + 9, 16, 16), "notice icon"); 1072_guides.Add(new(PanelGuideKind.Baseline, HeaderBaseline, "header baseline", new(TextLeft, 0, Width - TextLeft, HeaderHeight))); 1075Box(new(EdgeMargin, HeaderHeight / 2 - 10, 20, 20), "logo"); 1079Box(new(LeadingCenter - 8, HeaderHeight / 2 - 8, 16, 16), "back"); 1082Line(footerTop + FooterHeight / 2, "footer", new(0, footerTop, Width, FooterHeight)); 1086Box(new(center - 8, footerTop + FooterHeight / 2 - 8, 16, 16), "footer icon"); 1096var span = new PanelRect(0, top, Width, item.Height); 1103Box(new(EdgeMargin, top + RowHeight / 2 - 10, 20, 20), "status"); 1108Box(new(center - 8, top + RowHeight / 2 - 8, 16, 16), "row button icon"); 1113Box(new(TrailingCenter - 8, top + 8, 16, 16), "recent chevron"); 1124Line(middle, "action", new(0, itemTop, Width, ActionItemHeight)); 1128? new(TextLeft, middle - 8, 16, 16) 1129: new(LeadingCenter - 8, middle - 8, 16, 16), 1151Box(new(Width / 2 - 16, top + 20, 32, 32), "empty art"); 1177commands.Add(new LogoCommand(new(EdgeMargin, middle - 10, 20, 20))); 1178var title = new PanelRect(TextLeft, middle - 10, HeaderTitleWidth, 20); 1187var statusBounds = new PanelRect(statusLeft, middle - 8, Width - EdgeMargin - statusLeft, 16); 1200var banner = new PanelRect(RowInset, compact ? HeaderHeight : HeaderHeight + 8, Width - 2 * RowInset, height); 1209TrayPanelGlyphs.AddIcon(commands, PanelIcon.Alert, new(LeadingCenter - 8, iconY, 16, 16), palette.BannerText); 1211? new PanelRect(TextLeft, banner.CenterY - 9, NoticeTextWidth, 18) 1212: new PanelRect(TextLeft, banner.Y + 8, NoticeTextWidth, height - 16); 1226var art = new PanelRect(Width / 2 - 16, top + 20, 32, 32); 1235var titleBounds = new PanelRect(20, top + 62, Width - 40, 20); 1236var hintBounds = new PanelRect(44, top + 84, Width - 88, 34); 1253var labelBounds = new PanelRect(20, top + 4, 200, 24); 1263var toggle = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, 24); 1268new(RowContentRight - 22, top + 8, 16, 16), palette.TextTertiary); 1274var clear = new PanelRect(RowContentRight - 30 - 52, top + 6, 52, 20); 1286var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4); 1297TrayPanelGlyphs.AddStatus(commands, GetStatusGlyph(host, live), new(20, top + 16, 20, 20), palette); 1306commands.Add(new TextCommand(new(TextLeft, top + 8, textRight - TextLeft, 18), host.DisplayName, PanelFontRole.Name, palette.TextPrimary)); 1307commands.Add(new TextCommand(new(TextLeft, top + 27, textRight - TextLeft, 16), detail, PanelFontRole.Body, 1314var bounds = new PanelRect(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1404var card = new PanelRect(RowInset, top, Width - 2 * RowInset, height - ActionListGap); 1410var item = new PanelRect(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight); 1419TrayPanelGlyphs.AddIcon(fallback, PanelIcon.AppWindow, new(TextLeft, item.Y + 7, 16, 16), iconColor); 1420commands.Add(new AppIconCommand(new(TextLeft, item.Y + 7, 16, 16), _openInApplications[index], fallback)); 1421commands.Add(new TextCommand(new(NestedTextLeft, item.Y, item.Right - 8 - NestedTextLeft, item.Height), label, 1427TrayPanelGlyphs.AddIcon(commands, icon, new(22, item.Y + 7, 16, 16), iconColor); 1434new(TrailingCenter - 8, item.Y + 7, 16, 16), palette.TextTertiary); 1436commands.Add(new TextCommand(new(TextLeft, item.Y, labelRight - TextLeft, item.Height), label, PanelFontRole.Body, palette.TextPrimary)); 1476var card = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8); 1487var questionBounds = new PanelRect(card.X + 12, card.Y + 9, textWidth, 18); 1488var detailBounds = new PanelRect(card.X + 12, card.Y + 28, textWidth, 16); 1499var acceptBounds = new PanelRect(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1500var cancelBounds = new PanelRect(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1530var back = new PanelRect(LeadingCenter - ButtonSize / 2, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1535var title = new PanelRect(TextLeft, (HeaderHeight - 20) / 2, Width - EdgeMargin - TextLeft, 20); 1543var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4); 1557var toggle = new PanelRect(RowContentRight - 36, top + 9, 32, 18); 1559commands.Add(new TextCommand(new(20, top + 8, textWidth, 20), title, PanelFontRole.Name, 1561commands.Add(new TextCommand(new(20, top + 28, textWidth, 30), description, PanelFontRole.Body, 1569var name = new PanelRect(20, top + 4, Width - 40, 20); 1579var bounds = new PanelRect(20, y, Width - 40, 16); 1598var 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);
src\Aspire.Tray\Common\WindowsTrayPanelPlacement.cs (5)
25return new(x, above, width, height); 31return new(x, below, width, height); 38return new(leftOfAnchor, y, width, height); 44return new(rightOfAnchor, y, width, height); 47return new(x, Math.Clamp(above, top, bottom), width, height);
TrayApplication.Panel.cs (3)
183var workarea = new PanelRect(work.Left, work.Top, work.Right - work.Left, work.Bottom - work.Top); 184var anchorRect = new PanelRect(anchor.Left, anchor.Top, anchor.Right - anchor.Left, anchor.Bottom - anchor.Top); 497FillPanelPath(graphics, PanelPath.Rectangle(new(0, 0, width / scale + 1, height / scale + 1)), palette.Background);
83 references to PanelRect
aspire-tray (83)
src\Aspire.Tray\Common\TrayPanel.cs (44)
84private PanelRect _viewport; 140public PanelRect Viewport 378if (TryGetScrollbarGeometry(out var thumb, out var trackTop, out _, out _, out var trackHeight) 472out PanelRect thumb, 941var panel = new PanelRect(0, 0, Width, height); 942var footer = new PanelRect(0, height - FooterHeight, Width, FooterHeight); 988var headerBounds = new PanelRect(20, top + 4, 200, 24); 1016if (TryGetScrollbarGeometry(out var thumb, out _, out _, out _, out _)) 1036var clip = IsChrome(focused.Kind) ? panel : _viewport; 1054var all = new PanelRect(0, 0, Width, height); 1096var span = new PanelRect(0, top, Width, item.Height); 1156void Line(double y, string label, PanelRect bounds) => _guides.Add(new(PanelGuideKind.Center, y, label, bounds)); 1157void Box(PanelRect bounds, string label) => _guides.Add(new(PanelGuideKind.Box, bounds.CenterY, label, bounds)); 1178var title = new PanelRect(TextLeft, middle - 10, HeaderTitleWidth, 20); 1187var statusBounds = new PanelRect(statusLeft, middle - 8, Width - EdgeMargin - statusLeft, 16); 1200var banner = new PanelRect(RowInset, compact ? HeaderHeight : HeaderHeight + 8, Width - 2 * RowInset, height); 1210var text = compact 1226var art = new PanelRect(Width / 2 - 16, top + 20, 32, 32); 1235var titleBounds = new PanelRect(20, top + 62, Width - 40, 20); 1236var hintBounds = new PanelRect(44, top + 84, Width - 88, 34); 1253var labelBounds = new PanelRect(20, top + 4, 200, 24); 1263var toggle = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, 24); 1274var clear = new PanelRect(RowContentRight - 30 - 52, top + 6, 52, 20); 1286var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4); 1314var bounds = new PanelRect(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1404var card = new PanelRect(RowInset, top, Width - 2 * RowInset, height - ActionListGap); 1410var item = new PanelRect(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight); 1476var card = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8); 1487var questionBounds = new PanelRect(card.X + 12, card.Y + 9, textWidth, 18); 1488var detailBounds = new PanelRect(card.X + 12, card.Y + 28, textWidth, 16); 1499var acceptBounds = new PanelRect(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1500var cancelBounds = new PanelRect(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize); 1530var back = new PanelRect(LeadingCenter - ButtonSize / 2, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize); 1535var title = new PanelRect(TextLeft, (HeaderHeight - 20) / 2, Width - EdgeMargin - TextLeft, 20); 1543var row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4); 1557var toggle = new PanelRect(RowContentRight - 36, top + 9, 32, 18); 1569var name = new PanelRect(20, top + 4, Width - 40, 20); 1579var bounds = new PanelRect(20, y, Width - 40, 16); 1586private void AddFooter(List<PanelCommand> commands, List<PanelHitTarget> targets, PanelRect footer, TrayPanelPalette palette) 1598var bounds = new PanelRect(x, footer.Y + 8, ButtonSize, ButtonSize); 1611private void AddInteractionFill(List<PanelCommand> commands, PanelTargetKey key, PanelRect bounds, TrayPanelPalette palette, bool includeFocus) 1622private void AddTarget(List<PanelHitTarget> targets, PanelTargetKey key, PanelRect bounds, string name, bool enabled, AppHostMenuItem? host, 1625var hit = IsChrome(key.Kind) ? bounds : bounds.Intersect(_viewport); 1635private 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 (10)
72PanelRect Bounds, 89internal sealed record LogoCommand(PanelRect Bounds) : PanelCommand; 96internal sealed record AppIconCommand(PanelRect Bounds, string Application, IReadOnlyList<PanelCommand> Fallback) : PanelCommand; 99internal sealed record PushClipCommand(PanelRect Bounds) : PanelCommand; 189PanelRect Bounds, 190PanelRect HitBounds, 221PanelRect Bounds, 222PanelRect VisibleBounds, 266internal sealed record PanelGuide(PanelGuideKind Kind, double Position, string Label, PanelRect Bounds); 313internal sealed record PanelAction(PanelActionKind Kind, AppHostMenuItem? Host = null, PanelRect Anchor = default)
src\Aspire.Tray\Common\TrayPanelSceneJson.cs (1)
107static void Rect(Utf8JsonWriter json, PanelRect rect)
src\Aspire.Tray\Common\WindowsTrayPanelPlacement.cs (5)
8internal static double GetMaximumVerticalSpace(PanelRect workarea, PanelRect anchor, double margin) 15internal static PanelRect PlaceAboveAnchor(PanelRect workarea, PanelRect anchor, double width, double height, double margin)
TrayApplication.NativeSmoke.cs (1)
217var viewport = panel.Viewport;
TrayApplication.Panel.cs (7)
183var workarea = new PanelRect(work.Left, work.Top, work.Right - work.Left, work.Bottom - work.Top); 184var anchorRect = new PanelRect(anchor.Left, anchor.Top, anchor.Right - anchor.Left, anchor.Bottom - anchor.Top); 193var placement = WindowsTrayPanelPlacement.PlaceAboveAnchor(workarea, anchorRect, width, height, margin); 498var clips = new Stack<(uint State, PanelRect Bounds)>(); 557private void WithGdiDc(nint graphics, Stack<(uint State, PanelRect Bounds)> clips, Action<nint> draw) 763private void DrawPanelLogo(nint dc, PanelRect bounds) 839private NativeMethods.Rect ToDevice(PanelRect rect)
TrayApplication.PanelAutomation.cs (1)
187private NativeMethods.UiaRect ToScreenRect(PanelRect bounds)