48 string applicationName,
50 string? description =
null,
51 string? copyright =
null,
53 Rectangle? bounds =
null,
54 string? nickname =
null,
56 Uri? hyperlinkUri =
null,
57 string? hyperlinkText =
null)
58 : base(renderSurfaceHost,
60 ResolveBounds(view, bounds),
61 $
"About {applicationName}",
62 showCloseButton: true,
63 nickname: nickname ??
"__gondwana_about__")
70 bool hasHyperlinkConfiguration = uriLauncher is not
null ||
71 hyperlinkUri is not
null ||
72 hyperlinkText is not
null;
74 if (hasHyperlinkConfiguration)
76 if (uriLauncher is
null)
78 throw new ArgumentNullException(nameof(uriLauncher),
"A URI launcher is required when configuring the hyperlink.");
81 if (hyperlinkUri is
null)
83 throw new ArgumentNullException(nameof(hyperlinkUri),
"A hyperlink URI is required when configuring the hyperlink.");
86 if (!hyperlinkUri.IsAbsoluteUri)
88 throw new ArgumentException(
"The hyperlink URI must be absolute.", nameof(hyperlinkUri));
92 Rectangle resolvedBounds = ResolveBounds(view, bounds);
94 int contentTop = resolvedBounds.Top + 52;
95 int contentLeft = resolvedBounds.Left + 24;
97 int contentRightPadding = 24;
101 var logoScreenBounds =
new Rectangle(contentLeft, contentTop, 112, 112);
108 Logo.ZOrder = 10_002;
114 var headerTextScreenBounds =
new Rectangle(contentLeft, contentTop, resolvedBounds.Right - contentRightPadding - contentLeft, 44);
117 headerTextScreenBounds,
118 $
"{Nickname}.header").
SetText(applicationName)
119 .
SetFont(SKTypeface.Default, 26f, minSize: 16f)
120 .
SetColors(SKColors.White, SKColors.Transparent)
124 HeaderText.ZOrder = 10_002;
127 var versionTextScreenBounds =
new Rectangle(contentLeft, contentTop + 44, resolvedBounds.Right - contentRightPadding - contentLeft, 30);
130 versionTextScreenBounds,
131 $
"{Nickname}.version").
SetText($
"Version {version}")
132 .
SetFont(SKTypeface.Default, 15f, minSize: 11f)
133 .
SetColors(
new SKColor(205, 205, 215), SKColors.Transparent)
137 VersionText.ZOrder = 10_002;
140 if (uriLauncher is not
null && hyperlinkUri is not
null)
142 Rectangle hyperlinkBounds =
new(contentLeft,
144 resolvedBounds.Right - contentRightPadding - contentLeft,
151 hyperlinkText ?? hyperlinkUri.ToString(),
153 $
"{Nickname}.hyperlink");
155 Hyperlink.Label.ZOrder = 10_002;
156 Add(
Hyperlink,
new Vector2(hyperlinkBounds.Left - resolvedBounds.Left,
157 hyperlinkBounds.Top - resolvedBounds.Top));
160 var detailsTextScreenBounds =
new Rectangle(resolvedBounds.Left + 24, contentTop + 126, resolvedBounds.Width - 48, resolvedBounds.Height - 222);
161 string detailText =
string.Join(Environment.NewLine + Environment.NewLine,
162 new[] { description, copyright }
163 .Where(
static value => !
string.IsNullOrWhiteSpace(value)));
167 detailsTextScreenBounds,
168 $
"{Nickname}.details").
SetText(detailText)
169 .
SetFont(SKTypeface.Default, 14f, minSize: 10f)
170 .
SetColors(
new SKColor(225, 225, 232), SKColors.Transparent)
174 DetailsText.ZOrder = 10_002;
177 Rectangle okBounds =
new(resolvedBounds.Right - 116, resolvedBounds.Bottom - 54, 92, 34);
180 Add(
OkButton,
new Vector2(resolvedBounds.Width - 116, resolvedBounds.Height - 54));
183 OkButton.Clicked += OnOkClicked;