153 instantiations of PanelRect
Aspire.Tray.Tests (153)
LinuxPlasmaAnchorTests.cs (31)
57
new LinuxPlasmaAnchor.Output("eDP-1",
new
(0, 0, 1920, 1280), 1.5),
58
new LinuxPlasmaAnchor.Output("DP-5",
new
(-3072, -100, 3072, 1728), 1.25)
79
new("eDP-1",
new
(0, 0, 1920, 1280), 1.5),
80
new("DP-5",
new
(1920, 0, 3072, 1728), 1.25)
83
new("eDP-1",
new
(0, 0, 2880, 1920), false),
84
new("DP-5",
new
(2880, 0, 4608, 2592), true)
87
var anchor = LinuxPlasmaAnchor.Map(
new
(5735, 20, 0, 0), outputs, monitors, true, pointer: null);
89
Assert.Equal(new
PanelRect
(7458, 24, 0, 0), anchor);
98
new("eDP-1",
new
(0, 0, 1920, 1280), 1.5),
99
new("DP-5",
new
(1920, 0, 3072, 1728), 1.25)
101
LinuxPlasmaAnchor.Monitor[] monitors = [new("GTK model name",
new
(1920, 0, 3072, 1728), true)];
103
var anchor = LinuxPlasmaAnchor.Map(
new
(5735, 20, 0, 0), outputs, monitors, true, pointer: null);
105
Assert.Equal(new
PanelRect
(4972, 16, 0, 0), anchor);
117
new("eDP-1",
new
(0, 0, 1920, 1280), 1.5),
118
new("DP-5",
new
(1920, 0, 3072, 1728), 1.25)
121
new("eDP-1",
new
(0, 0, 2880, 1920), !externalPrimary),
122
new("DP-5",
new
(2880, 0, 4608, 2592), externalPrimary)
124
var anchor = LinuxPlasmaAnchor.Map(
new
(2000, 20, 0, 0), outputs, monitors, true, (pointerX, pointerY));
132
LinuxPlasmaAnchor.Output[] outputs = [new("DP-5",
new
(-1920, -100, 1920, 1080), 1.25)];
133
LinuxPlasmaAnchor.Monitor[] monitors = [new("DP-5",
new
(-2880, -150, 2880, 1620), true)];
135
var anchor = LinuxPlasmaAnchor.Map(
new
(-2380, -105, 0, 0), outputs, monitors, true, pointer: null);
137
Assert.Equal(new
PanelRect
(-2856, -126, 0, 0), anchor);
144
new("eDP-1",
new
(0, 0, 1920, 1280), 1.5),
145
new("DP-5",
new
(1920, 0, 3072, 1728), 1.25)
147
LinuxPlasmaAnchor.Monitor[] monitors = [new("DP-5",
new
(2880, 0, 4608, 2592), true)];
149
var anchor = LinuxPlasmaAnchor.Map(
new
(5735, 20, 0, 0), outputs, monitors, true, pointer: (100, 100));
151
Assert.Equal(new
PanelRect
(7458, 24, 0, 0), anchor);
178
LinuxPlasmaAnchor.Output[] outputs = [new("DP-5",
new
(1920, 0, 3072, 1728), 1.25)];
180
new("DP-5",
new
(1920 * gtkScale, 0, 3072 * gtkScale, 1728 * gtkScale), true)
183
var anchor = LinuxPlasmaAnchor.Map(
new
(4972, 16, 0, 0), outputs, monitors, false, pointer: null);
185
Assert.Equal(new
PanelRect
(expectedX, expectedY, 0, 0), anchor);
LinuxTrayTests.cs (7)
100
var bounds = LinuxTrayPanel.Place(
new
(0, 30, 1000, 770), anchorX, anchorY, 180, 1);
102
Assert.Equal(new
PanelRect
(x, y, TrayPanel.Width, 180), bounds);
108
var bounds = LinuxTrayPanel.Place(
new
(-1920, 30, 1920, 1050), -900, 15, 300, 1);
110
Assert.Equal(new
PanelRect
(-1080, 34, TrayPanel.Width, 300), bounds);
143
var workarea = new
PanelRect
(-1920, 30, 1920, 1050);
160
var geometry = new
PanelRect
(-1920, 30, 1920, 1050);
162
var target = new
PanelRect
(20, 100, 64, 30);
src\Aspire.Tray\Common\TrayPanel.cs (67)
491
thumb =
new
(Width - 7, thumbTop, 4, thumbHeight);
935
_viewport =
new
(0, HeaderHeight + noticeHeight, Width, Math.Max(0, height - chrome));
941
var panel = new
PanelRect
(0, 0, Width, height);
942
var footer = new
PanelRect
(0, height - FooterHeight, Width, FooterHeight);
945
commands.Add(new FillPathCommand(PanelPath.Rectangle(
new
(0, footer.Y, Width, 1)), palette.Separator));
948
commands.Add(new FillPathCommand(PanelPath.RoundedRect(
new
(0, 0, Width, HeaderHeight), CornerRadius, CornerRadius, 0, 0), palette.Gutter));
949
commands.Add(new FillPathCommand(PanelPath.Rectangle(
new
(0, HeaderHeight - 1, Width, 1)), palette.Separator));
968
commands.Add(new FillPathCommand(PanelPath.Rectangle(
new
(0, _viewport.Y, Width, 1)), palette.Separator));
988
var headerBounds = new
PanelRect
(20, top + 4, 200, 24);
1054
var all = new
PanelRect
(0, 0, Width, height);
1065
Line(HeaderHeight / 2, "header",
new
(0, 0, Width, HeaderHeight));
1069
Line(HeaderHeight + 8 + 17, "notice",
new
(0, HeaderHeight, Width, _viewport.Y - HeaderHeight));
1070
Box(
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)));
1075
Box(
new
(EdgeMargin, HeaderHeight / 2 - 10, 20, 20), "logo");
1079
Box(
new
(LeadingCenter - 8, HeaderHeight / 2 - 8, 16, 16), "back");
1082
Line(footerTop + FooterHeight / 2, "footer",
new
(0, footerTop, Width, FooterHeight));
1086
Box(
new
(center - 8, footerTop + FooterHeight / 2 - 8, 16, 16), "footer icon");
1096
var span = new
PanelRect
(0, top, Width, item.Height);
1103
Box(
new
(EdgeMargin, top + RowHeight / 2 - 10, 20, 20), "status");
1108
Box(
new
(center - 8, top + RowHeight / 2 - 8, 16, 16), "row button icon");
1113
Box(
new
(TrailingCenter - 8, top + 8, 16, 16), "recent chevron");
1124
Line(middle, "action",
new
(0, itemTop, Width, ActionItemHeight));
1128
?
new
(TextLeft, middle - 8, 16, 16)
1129
:
new
(LeadingCenter - 8, middle - 8, 16, 16),
1151
Box(
new
(Width / 2 - 16, top + 20, 32, 32), "empty art");
1177
commands.Add(new LogoCommand(
new
(EdgeMargin, middle - 10, 20, 20)));
1178
var title = new
PanelRect
(TextLeft, middle - 10, HeaderTitleWidth, 20);
1187
var statusBounds = new
PanelRect
(statusLeft, middle - 8, Width - EdgeMargin - statusLeft, 16);
1200
var banner = new
PanelRect
(RowInset, compact ? HeaderHeight : HeaderHeight + 8, Width - 2 * RowInset, height);
1209
TrayPanelGlyphs.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);
1226
var art = new
PanelRect
(Width / 2 - 16, top + 20, 32, 32);
1235
var titleBounds = new
PanelRect
(20, top + 62, Width - 40, 20);
1236
var hintBounds = new
PanelRect
(44, top + 84, Width - 88, 34);
1253
var labelBounds = new
PanelRect
(20, top + 4, 200, 24);
1263
var toggle = new
PanelRect
(RowInset, top + 4, Width - 2 * RowInset, 24);
1268
new
(RowContentRight - 22, top + 8, 16, 16), palette.TextTertiary);
1274
var clear = new
PanelRect
(RowContentRight - 30 - 52, top + 6, 52, 20);
1286
var row = new
PanelRect
(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4);
1297
TrayPanelGlyphs.AddStatus(commands, GetStatusGlyph(host, live),
new
(20, top + 16, 20, 20), palette);
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,
1314
var bounds = new
PanelRect
(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize);
1404
var card = new
PanelRect
(RowInset, top, Width - 2 * RowInset, height - ActionListGap);
1410
var item = new
PanelRect
(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight);
1419
TrayPanelGlyphs.AddIcon(fallback, PanelIcon.AppWindow,
new
(TextLeft, item.Y + 7, 16, 16), iconColor);
1420
commands.Add(new AppIconCommand(
new
(TextLeft, item.Y + 7, 16, 16), _openInApplications[index], fallback));
1421
commands.Add(new TextCommand(
new
(NestedTextLeft, item.Y, item.Right - 8 - NestedTextLeft, item.Height), label,
1427
TrayPanelGlyphs.AddIcon(commands, icon,
new
(22, item.Y + 7, 16, 16), iconColor);
1434
new
(TrailingCenter - 8, item.Y + 7, 16, 16), palette.TextTertiary);
1436
commands.Add(new TextCommand(
new
(TextLeft, item.Y, labelRight - TextLeft, item.Height), label, PanelFontRole.Body, palette.TextPrimary));
1476
var card = new
PanelRect
(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8);
1487
var questionBounds = new
PanelRect
(card.X + 12, card.Y + 9, textWidth, 18);
1488
var detailBounds = new
PanelRect
(card.X + 12, card.Y + 28, textWidth, 16);
1499
var acceptBounds = new
PanelRect
(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize);
1500
var cancelBounds = new
PanelRect
(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize);
1530
var back = new
PanelRect
(LeadingCenter - ButtonSize / 2, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize);
1535
var title = new
PanelRect
(TextLeft, (HeaderHeight - 20) / 2, Width - EdgeMargin - TextLeft, 20);
1543
var row = new
PanelRect
(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4);
1557
var toggle = new
PanelRect
(RowContentRight - 36, top + 9, 32, 18);
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,
1569
var name = new
PanelRect
(20, top + 4, Width - 40, 20);
1579
var bounds = new
PanelRect
(20, y, Width - 40, 16);
1598
var bounds = new
PanelRect
(x, footer.Y + 8, ButtonSize, ButtonSize);
src\Aspire.Tray\Common\TrayPanelGeometry.cs (4)
24
public PanelRect Inset(double dx, double dy) =>
new
(X + dx, Y + dy, Width - 2 * dx, Height - 2 * dy);
26
public PanelRect Offset(double dx, double dy) =>
new
(X + dx, Y + dy, Width, Height);
34
return right <= x || bottom <= y ? default :
new
(x, y, right - x, bottom - y);
205
return minX > maxX ? default :
new
(minX, minY, maxX - minX, maxY - minY);
src\Aspire.Tray\Common\TrayPanelGlyphs.cs (5)
81
Fill(PanelPath.RoundedRect(
new
(7, 7, 6, 6), 1.4), palette.Neutral);
112
Fill(PanelPath.RoundedRect(
new
(4.25, 4.25, 7.5, 7.5), 1.5));
156
Stroke(PanelPath.RoundedRect(
new
(2.25, 3, 11.5, 10), 1.75), 1.4);
167
Stroke(PanelPath.RoundedRect(
new
(5.75, 5.75, 7.5, 7.5), 1.5), 1.4);
208
var track = new
PanelRect
(0, 0, ToggleDesignWidth, ToggleDesignHeight);
src\Aspire.Tray\Common\WindowsTrayPanelPlacement.cs (5)
25
return
new
(x, above, width, height);
31
return
new
(x, below, width, height);
38
return
new
(leftOfAnchor, y, width, height);
44
return
new
(rightOfAnchor, y, width, height);
47
return
new
(x, Math.Clamp(above, top, bottom), width, height);
src\Aspire.Tray\Linux\LinuxPanelAccessibility.cs (1)
114
return
new
(x + bounds.X * scale, y + bounds.Y * scale, bounds.Width * scale, bounds.Height * scale);
src\Aspire.Tray\Linux\LinuxPlasmaAnchor.cs (4)
28
new
(geometry.X, geometry.Y, geometry.Width, geometry.Height), monitor == primary);
58
var native = new
PanelRect
(output.Logical.X * originScale, output.Logical.Y * originScale,
73
candidates.Add((
new
(monitor.Geometry.X + (anchor.X - native.X) * scaleX,
229
geometry =
new
(values[0], values[1], values[2], values[3]);
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (8)
100
return surface.Geometry != new
PanelRect
(geometry.X, geometry.Y, geometry.Width, geometry.Height)
133
_anchorRequest ??= LinuxPlasmaAnchor.TranslateAsync(
new
(x, y, 0, 0));
138
SetAnchor(
new
(x, y, 0, 0));
273
return (Monitor: monitor, Geometry: new
PanelRect
(geometry.X, geometry.Y, geometry.Width, geometry.Height),
429
_workarea =
new
(workarea.X, workarea.Y, workarea.Width, workarea.Height);
475
return
new
(x, y, width, height);
552
&& (!surface.Main || !new
PanelRect
(0, 0, _panel.Scene.Width, _panel.Scene.Height).Contains(x, y)))
565
if (!surface.Main || !new
PanelRect
(0, 0, _panel.Scene.Width, _panel.Scene.Height).Contains(x, y))
TrayPanelTests.cs (13)
72
var bounds = new
PanelRect
(0, 0, scene.Width, scene.Height);
95
var bounds = new
PanelRect
(0, 0, scene.Width, scene.Height);
866
var box = new
PanelRect
(10, 20, 32, 18);
1080
Assert.Contains(gutters, bounds => Near(bounds,
new
(0, 0, TrayPanel.Width, TrayPanel.HeaderHeight)));
1081
Assert.Contains(gutters, bounds => Near(bounds,
new
(0, scene.Height - TrayPanel.FooterHeight, TrayPanel.Width, TrayPanel.FooterHeight)));
1084
Assert.Contains(new
PanelRect
(0, TrayPanel.HeaderHeight - 1, TrayPanel.Width, 1), separators);
1085
Assert.Contains(new
PanelRect
(0, scene.Height - TrayPanel.FooterHeight, TrayPanel.Width, 1), separators);
1092
Assert.All(scene.Commands.OfType<LogoCommand>(), logo => Assert.Equal(new
PanelRect
(20, middle - 10, 20, 20), logo.Bounds));
1186
var rect = new
PanelRect
(8, 10, 100, 40);
1204
var box = new
PanelRect
(40, 60, 20, 20);
1233
var box = new
PanelRect
(4, 8, 16, 16);
1290
TrayPanelGlyphs.AddStatus(commands, PanelStatusGlyph.Unhealthy,
new
(0, 0, 20, 20), palette);
1335
TrayPanelGlyphs.AddStatus(commands, glyph,
new
(0, 0, 20, 20), palette);
WindowsTrayPanelPlacementTests.cs (8)
11
var workarea = new
PanelRect
(0, 0, 1920, 1080);
12
var icon = new
PanelRect
(1820, 930, 20, 20);
23
var workarea = new
PanelRect
(0, 0, 1200, 900);
24
var icon = new
PanelRect
(500, 18, 24, 24);
35
var workarea = new
PanelRect
(0, 0, 1200, 900);
36
var icon = new
PanelRect
(600, 400, 24, 24);
47
var workarea = new
PanelRect
(0, 0, 1024, 720);
48
var icon = new
PanelRect
(650, 600, 40, 40);
138 references to PanelRect
Aspire.Tray.Tests (138)
Helpers\TrayPanelSvgRenderer.cs (2)
128
var
b = guide.Bounds;
255
private static object[] Bounds(
PanelRect
rect)
LinuxPlasmaAnchorTests.cs (7)
87
var
anchor = LinuxPlasmaAnchor.Map(new(5735, 20, 0, 0), outputs, monitors, true, pointer: null);
90
var
panel = LinuxTrayPanel.Place(monitors[1].Geometry, anchor.CenterX, anchor.Bottom, 200, 1.5);
103
var
anchor = LinuxPlasmaAnchor.Map(new(5735, 20, 0, 0), outputs, monitors, true, pointer: null);
124
var
anchor = LinuxPlasmaAnchor.Map(new(2000, 20, 0, 0), outputs, monitors, true, (pointerX, pointerY));
135
var
anchor = LinuxPlasmaAnchor.Map(new(-2380, -105, 0, 0), outputs, monitors, true, pointer: null);
149
var
anchor = LinuxPlasmaAnchor.Map(new(5735, 20, 0, 0), outputs, monitors, true, pointer: (100, 100));
183
var
anchor = LinuxPlasmaAnchor.Map(new(4972, 16, 0, 0), outputs, monitors, false, pointer: null);
LinuxTrayTests.cs (8)
100
var
bounds = LinuxTrayPanel.Place(new(0, 30, 1000, 770), anchorX, anchorY, 180, 1);
108
var
bounds = LinuxTrayPanel.Place(new(-1920, 30, 1920, 1050), -900, 15, 300, 1);
143
var
workarea = new PanelRect(-1920, 30, 1920, 1050);
144
var
bounds = LinuxTrayPanel.Place(workarea, -20, workarea.Bottom, 300, scale);
160
var
geometry = new PanelRect(-1920, 30, 1920, 1050);
161
var
panel = LinuxTrayPanel.Place(geometry, -900, 15, 300, scale);
162
var
target = new PanelRect(20, 100, 64, 30);
163
var
control = LinuxPanelAccessibility.PlaceControl(target, panel.X - geometry.X, panel.Y - geometry.Y, scale);
src\Aspire.Tray\Common\TrayPanel.cs (44)
84
private
PanelRect
_viewport;
140
public
PanelRect
Viewport
378
if (TryGetScrollbarGeometry(out
var
thumb, out var trackTop, out _, out _, out var trackHeight)
472
out
PanelRect
thumb,
941
var
panel = new PanelRect(0, 0, Width, height);
942
var
footer = new PanelRect(0, height - FooterHeight, Width, FooterHeight);
988
var
headerBounds = new PanelRect(20, top + 4, 200, 24);
1016
if (TryGetScrollbarGeometry(out
var
thumb, out _, out _, out _, out _))
1036
var
clip = IsChrome(focused.Kind) ? panel : _viewport;
1054
var
all = new PanelRect(0, 0, Width, height);
1096
var
span = new PanelRect(0, top, Width, item.Height);
1156
void Line(double y, string label,
PanelRect
bounds) => _guides.Add(new(PanelGuideKind.Center, y, label, bounds));
1157
void Box(
PanelRect
bounds, string label) => _guides.Add(new(PanelGuideKind.Box, bounds.CenterY, label, bounds));
1178
var
title = new PanelRect(TextLeft, middle - 10, HeaderTitleWidth, 20);
1187
var
statusBounds = new PanelRect(statusLeft, middle - 8, Width - EdgeMargin - statusLeft, 16);
1200
var
banner = new PanelRect(RowInset, compact ? HeaderHeight : HeaderHeight + 8, Width - 2 * RowInset, height);
1210
var
text = compact
1226
var
art = new PanelRect(Width / 2 - 16, top + 20, 32, 32);
1235
var
titleBounds = new PanelRect(20, top + 62, Width - 40, 20);
1236
var
hintBounds = new PanelRect(44, top + 84, Width - 88, 34);
1253
var
labelBounds = new PanelRect(20, top + 4, 200, 24);
1263
var
toggle = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, 24);
1274
var
clear = new PanelRect(RowContentRight - 30 - 52, top + 6, 52, 20);
1286
var
row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, RowHeight - 4);
1314
var
bounds = new PanelRect(x, top + (RowHeight - ButtonSize) / 2, ButtonSize, ButtonSize);
1404
var
card = new PanelRect(RowInset, top, Width - 2 * RowInset, height - ActionListGap);
1410
var
item = new PanelRect(card.X + ActionListPadding, y, card.Width - 2 * ActionListPadding, ActionItemHeight);
1476
var
card = new PanelRect(RowInset, top + 4, Width - 2 * RowInset, ConfirmHeight - 8);
1487
var
questionBounds = new PanelRect(card.X + 12, card.Y + 9, textWidth, 18);
1488
var
detailBounds = new PanelRect(card.X + 12, card.Y + 28, textWidth, 16);
1499
var
acceptBounds = new PanelRect(card.Right - 10 - ButtonWidth, controlsY, ButtonWidth, ButtonSize);
1500
var
cancelBounds = new PanelRect(acceptBounds.X - 8 - ButtonWidth, controlsY, ButtonWidth, ButtonSize);
1530
var
back = new PanelRect(LeadingCenter - ButtonSize / 2, (HeaderHeight - ButtonSize) / 2, ButtonSize, ButtonSize);
1535
var
title = new PanelRect(TextLeft, (HeaderHeight - 20) / 2, Width - EdgeMargin - TextLeft, 20);
1543
var
row = new PanelRect(RowInset, top + 2, Width - 2 * RowInset, SettingsRowHeight - 4);
1557
var
toggle = new PanelRect(RowContentRight - 36, top + 9, 32, 18);
1569
var
name = new PanelRect(20, top + 4, Width - 40, 20);
1579
var
bounds = new PanelRect(20, y, Width - 40, 16);
1586
private void AddFooter(List<PanelCommand> commands, List<PanelHitTarget> targets,
PanelRect
footer, TrayPanelPalette palette)
1598
var
bounds = new PanelRect(x, footer.Y + 8, ButtonSize, ButtonSize);
1611
private void AddInteractionFill(List<PanelCommand> commands, PanelTargetKey key,
PanelRect
bounds, TrayPanelPalette palette, bool includeFocus)
1622
private void AddTarget(List<PanelHitTarget> targets, PanelTargetKey key,
PanelRect
bounds, string name, bool enabled, AppHostMenuItem? host,
1625
var
hit = IsChrome(key.Kind) ? bounds : bounds.Intersect(_viewport);
1635
private void AddLabel(string label, string text,
PanelRect
bounds, bool chrome)
src\Aspire.Tray\Common\TrayPanelGeometry.cs (10)
20
public bool Contains(
PanelRect
other) => other.X >= X && other.Y >= Y && other.Right <= Right && other.Bottom <= Bottom;
22
public bool IntersectsWith(
PanelRect
other) => other.X < Right && X < other.Right && other.Y < Bottom && Y < other.Bottom;
24
public
PanelRect
Inset(double dx, double dy) => new(X + dx, Y + dy, Width - 2 * dx, Height - 2 * dy);
26
public
PanelRect
Offset(double dx, double dy) => new(X + dx, Y + dy, Width, Height);
28
public
PanelRect
Intersect(
PanelRect
other)
133
public static PanelPath Rectangle(
PanelRect
rect)
137
public static PanelPath RoundedRect(
PanelRect
rect, double radius)
141
public static PanelPath RoundedRect(
PanelRect
rect, double topLeft, double topRight, double bottomRight, double bottomLeft)
188
public
PanelRect
GetControlBounds()
src\Aspire.Tray\Common\TrayPanelGlyphs.cs (4)
52
public static void AddStatus(List<PanelCommand> commands, PanelStatusGlyph glyph,
PanelRect
bounds, TrayPanelPalette palette)
97
public static void AddIcon(List<PanelCommand> commands, PanelIcon icon,
PanelRect
bounds, PanelColor color)
204
public static void AddToggle(List<PanelCommand> commands, bool on, bool enabled,
PanelRect
bounds, TrayPanelPalette palette)
208
var
track = new PanelRect(0, 0, ToggleDesignWidth, ToggleDesignHeight);
src\Aspire.Tray\Common\TrayPanelScene.cs (10)
72
PanelRect
Bounds,
89
internal sealed record LogoCommand(
PanelRect
Bounds) : PanelCommand;
96
internal sealed record AppIconCommand(
PanelRect
Bounds, string Application, IReadOnlyList<PanelCommand> Fallback) : PanelCommand;
99
internal sealed record PushClipCommand(
PanelRect
Bounds) : PanelCommand;
189
PanelRect
Bounds,
190
PanelRect
HitBounds,
221
PanelRect
Bounds,
222
PanelRect
VisibleBounds,
266
internal sealed record PanelGuide(PanelGuideKind Kind, double Position, string Label,
PanelRect
Bounds);
313
internal sealed record PanelAction(PanelActionKind Kind, AppHostMenuItem? Host = null,
PanelRect
Anchor = default)
src\Aspire.Tray\Common\TrayPanelSceneJson.cs (1)
107
static void Rect(Utf8JsonWriter json,
PanelRect
rect)
src\Aspire.Tray\Common\WindowsTrayPanelPlacement.cs (5)
8
internal static double GetMaximumVerticalSpace(
PanelRect
workarea,
PanelRect
anchor, double margin)
15
internal static
PanelRect
PlaceAboveAnchor(
PanelRect
workarea,
PanelRect
anchor, double width, double height, double margin)
src\Aspire.Tray\Linux\LinuxPanelAccessibility.cs (4)
81
var
bounds = PlaceControl(element.VisibleBounds, x, y, scale);
103
var
bounds = PlaceControl(scene.Accessibility.Single(element => element.Key == key).VisibleBounds, x, y, scale);
112
internal static
PanelRect
PlaceControl(
PanelRect
bounds, double x, double y, double scale)
src\Aspire.Tray\Linux\LinuxPlasmaAnchor.cs (9)
17
internal static Task<
PanelRect
> TranslateAsync(
PanelRect
anchor)
44
internal static
PanelRect
Map(
PanelRect
anchor, IReadOnlyList<Output> outputs, IReadOnlyList<Monitor> monitors,
53
var candidates = new List<(
PanelRect
Bounds, Monitor Monitor)>();
58
var
native = new PanelRect(output.Logical.X * originScale, output.Logical.Y * originScale,
179
PanelRect
? geometry = null;
330
internal sealed record Output(string Name,
PanelRect
Logical, double Scale);
331
internal sealed record Monitor(string Name,
PanelRect
Geometry, bool Primary);
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (11)
24
private
PanelRect
_workarea;
25
private
PanelRect
_bounds;
35
private Task<
PanelRect
>? _anchorRequest;
56
PanelRect
? anchor = null;
114
internal void SetAnchor(
PanelRect
anchor)
312
private unsafe Surface CreateSurface(nint monitor,
PanelRect
geometry, int deviceScale, bool main)
465
internal static
PanelRect
Place(
PanelRect
workarea, double anchorX, double anchorY, double height, double scale)
478
internal static (double X, double Y) ToPanelPoint(
PanelRect
bounds,
PanelRect
geometry, double x, double y, double scale)
830
private sealed record Surface(nint Window, nint Area, nint Fixed, nint Monitor,
PanelRect
Geometry, int DeviceScale, bool Main)
TrayPanelTests.cs (11)
72
var
bounds = new PanelRect(0, 0, scene.Width, scene.Height);
95
var
bounds = new PanelRect(0, 0, scene.Width, scene.Height);
508
var
footer = scene.Targets.Single(target => target.Kind == PanelTargetKind.Quit).Bounds;
866
var
box = new PanelRect(10, 20, 32, 18);
1078
static bool Near(
PanelRect
a,
PanelRect
b)
1186
var
rect = new PanelRect(8, 10, 100, 40);
1204
var
box = new PanelRect(40, 60, 20, 20);
1233
var
box = new PanelRect(4, 8, 16, 16);
1591
private static PanelResponse Click(TrayPanel panel,
PanelRect
bounds, double? offsetX = null)
1610
private static
PanelRect
GetBounds(PanelCommand command)
WindowsTrayPanelPlacementTests.cs (12)
11
var
workarea = new PanelRect(0, 0, 1920, 1080);
12
var
icon = new PanelRect(1820, 930, 20, 20);
14
var
panel = WindowsTrayPanelPlacement.PlaceAboveAnchor(workarea, icon, 360, 500, 12);
23
var
workarea = new PanelRect(0, 0, 1200, 900);
24
var
icon = new PanelRect(500, 18, 24, 24);
26
var
panel = WindowsTrayPanelPlacement.PlaceAboveAnchor(workarea, icon, 360, 500, 12);
35
var
workarea = new PanelRect(0, 0, 1200, 900);
36
var
icon = new PanelRect(600, 400, 24, 24);
38
var
panel = WindowsTrayPanelPlacement.PlaceAboveAnchor(workarea, icon, 360, 500, 12);
47
var
workarea = new PanelRect(0, 0, 1024, 720);
48
var
icon = new PanelRect(650, 600, 40, 40);
52
var
panel = WindowsTrayPanelPlacement.PlaceAboveAnchor(workarea, icon, 720, maximumHeight, margin);