Gondwana Game Engine Development (master) - 2.7.0
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
MenuBarWidget.cs
1using System.Drawing;
2using System.Numerics;
7
9
13public sealed class MenuBarWidget : ContainerWidget, IWidgetKeyboardFallback
14{
15 private readonly View _view;
16 private readonly Rectangle _bounds;
17 private readonly MenuBarTheme _theme;
18 private readonly DismissLayerWidget _dismissLayer;
19 private readonly List<MenuBarMenu> _menus = new();
20
21 private readonly Dictionary<string, MenuItemWidget> _itemsByKey = new(StringComparer.Ordinal);
22 private readonly Dictionary<KeyGesture, MenuItemWidget> _shortcuts = new();
23 internal bool IsAvailable => !_disposed && Visible && IsInputEnabled && IsKeyboardInputEnabled;
24
28 public MenuItemWidget GetItem(string key) => _itemsByKey[key];
29
32 public MenuItemWidget this[string key] => GetItem(key);
33
38 public bool TryGetItem(string key, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out MenuItemWidget? item) =>
39 _itemsByKey.TryGetValue(key, out item);
40
41 internal void ValidateRegistration(string? key, KeyGesture? shortcut)
42 {
43 ObjectDisposedException.ThrowIf(_disposed, this);
44
45 if (key is not null)
46 {
47 ArgumentException.ThrowIfNullOrWhiteSpace(key);
48
49 if (_itemsByKey.ContainsKey(key))
50 throw new ArgumentException($"Duplicate menu item key '{key}'.", nameof(key));
51 }
52
53 if (shortcut is { } gesture)
54 {
55 if (gesture.Key <= 0)
56 throw new ArgumentException("A shortcut requires a nonzero key.", nameof(shortcut));
57
58 if (_shortcuts.ContainsKey(gesture))
59 throw new ArgumentException($"Duplicate menu shortcut '{gesture}'.", nameof(shortcut));
60 }
61 }
62
63 internal void RegisterItem(MenuItemWidget item)
64 {
65 if (item.Key is not null)
66 _itemsByKey.Add(item.Key, item);
67
68 if (item.Shortcut is { } gesture)
69 _shortcuts.Add(gesture, item);
70 }
71
72 internal void UnregisterItem(MenuItemWidget item)
73 {
74 if (item.Key is not null && _itemsByKey.GetValueOrDefault(item.Key) == item)
75 _itemsByKey.Remove(item.Key);
76
77 if (item.Shortcut is { } gesture && _shortcuts.GetValueOrDefault(gesture) == item)
78 _shortcuts.Remove(gesture);
79 }
80
81 private WidgetBase? _previousFocus;
82 private int _openMenuIndex = -1;
83 private int _nextHeaderX;
84 private int _menuZOrder = 20_000;
85 private bool _disposed;
86
88 public event Action<MenuBarMenu>? MenuOpened;
89
91 public event Action<MenuBarMenu>? MenuClosed;
92
94 public event Action<MenuItemWidget>? ItemInvoked;
95
106 View view,
107 Rectangle bounds,
108 MenuBarTheme? theme = null,
109 string? nickname = null)
110 : base(
111 host,
113 bounds.Location,
114 nickname)
115 {
116 ArgumentNullException.ThrowIfNull(view);
117
118 if (bounds.Width <= 0 || bounds.Height <= 0)
119 {
120 throw new ArgumentOutOfRangeException(
121 nameof(bounds),
122 bounds,
123 "Menu bar bounds must have positive width and height.");
124 }
125
126 _view = view;
127 _bounds = bounds;
128 _theme = theme ?? MenuBarTheme.Default;
129 _nextHeaderX = bounds.X;
130
132 _theme.BarBackgroundColor,
133 host,
134 view,
135 bounds,
136 $"{Nickname}.background")
137 .SetFilled(true)
138 .SetBorderColor(_theme.BarBorderColor)
139 .SetStrokeWidth(_theme.BorderWidth);
140
141 Rectangle dismissBounds = view.Viewport.TargetRectPx;
142
143 _dismissLayer = new DismissLayerWidget(
144 host,
145 view,
146 dismissBounds,
147 $"{Nickname}.dismiss");
148
149 _dismissLayer.DismissRequested += OnDismissRequested;
150 _dismissLayer.SetDismissEnabled(false);
151
152 Add(
153 _dismissLayer,
154 new Vector2(
155 dismissBounds.X - bounds.X,
156 dismissBounds.Y - bounds.Y));
157
159
160 CanReceiveFocus = false;
163
164 SetMenuZOrder(_menuZOrder);
165 }
166
169
171 public IReadOnlyList<MenuBarMenu> Menus => _menus.AsReadOnly();
172
174 public int OpenMenuIndex => _openMenuIndex;
175
178 _openMenuIndex >= 0 && _openMenuIndex < _menus.Count
179 ? _menus[_openMenuIndex]
180 : null;
181
184 MenuDropDownAnimation.FadeAndReveal;
185
187 public float DropDownAnimationDurationSec { get; set; } = 0.13f;
188
198 string text,
199 Action<MenuDropDownWidget>? configure = null,
200 int? headerWidth = null,
201 char? mnemonic = null)
202 {
203 ObjectDisposedException.ThrowIf(_disposed, this);
204 ArgumentNullException.ThrowIfNull(text);
205
206 if (mnemonic is char character && _menus.Any(menu => menu.Header.Mnemonic is char existing &&
207 char.ToUpperInvariant(existing) ==
208 char.ToUpperInvariant(character)))
209 throw new ArgumentException($"Duplicate top-level mnemonic '{character}'.", nameof(mnemonic));
210
211 int resolvedHeaderWidth = headerWidth ?? EstimateHeaderWidth(text);
212
213 if (resolvedHeaderWidth <= 0)
214 {
215 throw new ArgumentOutOfRangeException(
216 nameof(headerWidth),
217 resolvedHeaderWidth,
218 "Menu header width must be positive.");
219 }
220
221 var headerBounds = new Rectangle(
222 _nextHeaderX,
223 _bounds.Y,
224 resolvedHeaderWidth,
225 _bounds.Height);
226
227 int menuIndex = _menus.Count;
228
229 var header = new MenuHeaderWidget(
231 _view,
232 headerBounds,
233 text,
234 _theme,
235 $"{Nickname}.header.{menuIndex}",
236 mnemonic);
237
238 var dropDown = new MenuDropDownWidget(
240 _view,
241 new Point(headerBounds.X, _bounds.Bottom),
242 _theme,
243 $"{Nickname}.dropdown.{menuIndex}",
244 this);
245
246 try
247 {
248 configure?.Invoke(dropDown);
249 }
250 catch
251 {
252 dropDown.Dispose();
253 header.Dispose();
254 throw;
255 }
256
257 PositionDropDown(headerBounds, dropDown);
258
259 var menu = new MenuBarMenu(header, dropDown);
260 _menus.Add(menu);
261
262 header.Invoked += OnHeaderInvoked;
263 header.Hovered += OnHeaderHovered;
264
265 Add(
266 header,
267 new Vector2(
268 headerBounds.X - _bounds.X,
269 headerBounds.Y - _bounds.Y));
270
271 Add(
272 dropDown,
273 new Vector2(
274 dropDown.GetPosition().X - _bounds.X,
275 dropDown.GetPosition().Y - _bounds.Y));
276
277 // Dropdown drawings are visible immediately after construction; menus start closed.
278 dropDown.CloseAnimated(MenuDropDownAnimation.None, 0f, immediate: true);
279
280 _nextHeaderX += resolvedHeaderWidth;
281 ApplyMenuZOrder(_menuZOrder);
282
283 return this;
284 }
285
288 public void OpenMenuAt(int index)
289 {
290 if (index < 0 || index >= _menus.Count)
291 throw new ArgumentOutOfRangeException(nameof(index));
292
293 if (!IsAvailable || _openMenuIndex == index)
294 return;
295
296 CloseMenuInternal(immediate: true);
297
298 _previousFocus = WidgetInputRouterRegistry.GetFocusedWidget(this);
299 _openMenuIndex = index;
300 MenuBarMenu menu = _menus[index];
301
302 menu.Header.SetOpen(true);
303
304 foreach (MenuBarMenu candidate in _menus)
305 candidate.Header.SetMenuBarActive(true);
306
307 _dismissLayer.SetDismissEnabled(true);
308
309 // Input routing is registration ordered rather than drawing-Z ordered.
310 // Promote the accelerator participant without recursively activating its children.
311 WidgetInputRouterRegistry.TryBringToFront(this);
312 _dismissLayer.Activate();
313
314 foreach (MenuBarMenu candidate in _menus)
315 candidate.Header.Activate();
316
317 PositionDropDown(menu.Header.Background.ScreenBounds, menu.DropDown);
318 WidgetInputRouterRegistry.TryFocus(menu.Header);
319
320 menu.DropDown.OpenAnimated(
322 Math.Max(0f, DropDownAnimationDurationSec));
323
324 menu.DropDown.Activate();
325 menu.DropDown.SelectFirstEnabled();
326
327 MenuOpened?.Invoke(menu);
328 }
329
331 public void CloseMenu()
332 {
333 CloseMenuInternal(immediate: false);
334 }
335
338 public void ToggleMenu(int index)
339 {
340 if (_openMenuIndex == index)
341 CloseMenu();
342 else
343 OpenMenuAt(index);
344 }
345
349 public MenuBarWidget SetMenuZOrder(int zOrder)
350 {
351 _menuZOrder = zOrder;
352 ApplyMenuZOrder(_menuZOrder);
353 return this;
354 }
355
357 protected override void ProcessShown()
358 {
359 base.ProcessShown();
360
361 _dismissLayer.SetDismissEnabled(false);
362 _openMenuIndex = -1;
363
364 foreach (MenuBarMenu menu in _menus)
365 {
366 menu.Header.SetOpen(false);
367 menu.Header.SetMenuBarActive(false);
368 menu.DropDown.CloseAnimated(MenuDropDownAnimation.None, 0f, immediate: true);
369 }
370 }
371
373 protected override void ProcessHidden()
374 {
375 CloseMenuInternal(immediate: true);
376 _dismissLayer.SetDismissEnabled(false);
377 base.ProcessHidden();
378 }
379
381 protected override void OnKeyboardInput(WidgetKeyboardEventArgs args)
382 {
383 base.OnKeyboardInput(args);
384 HandleKeyboard(args);
385 }
386
387 void IWidgetKeyboardFallback.HandleUnhandledKeyboardInput(WidgetKeyboardEventArgs args) => HandleKeyboard(args);
388
389 private void HandleKeyboard(WidgetKeyboardEventArgs args)
390 {
391 if (args.Handled || args.KeyAction != KeyAction.Pressed || !IsAvailable)
392 return;
393
394 if (args.Key > 0 && _shortcuts.TryGetValue(new KeyGesture(args.Key, args.Modifiers), out var command) &&
395 command.CanInvoke)
396 {
397 args.Handled = true;
398 command.PerformClick();
399 return;
400 }
401
402 if (args.Modifiers == KeyboardModifierState.Alt)
403 {
404 int index = _menus.FindIndex(menu => MatchesMnemonic(menu.Header.Mnemonic, args.Key));
405
406 if (index >= 0)
407 {
408 args.Handled = true;
409 OpenMenuAt(index);
410 _menus[index].DropDown.SelectFirstEnabled();
411 return;
412 }
413 }
414
415 if (_openMenuIndex < 0 || args.Modifiers != KeyboardModifierState.None)
416 return;
417
418 var dropDown = _menus[_openMenuIndex].DropDown.ActiveMenu;
419
420 switch (args.Key)
421 {
422 case 27:
423 if (dropDown.ParentMenu is { } parent)
424 parent.CloseChild();
425 else
426 CloseMenu();
427
428 break;
429 case 37:
430 if (dropDown.ParentMenu is { } previous)
431 previous.CloseChild();
432 else
433 OpenMenuAt((_openMenuIndex - 1 + _menus.Count) % _menus.Count);
434
435 break;
436 case 39:
437 if (dropDown.SelectedItem is { SubMenu: not null } owner)
438 dropDown.OpenSubMenu(owner, selectFirst: true);
439 else if (dropDown.ParentMenu is null)
440 OpenMenuAt((_openMenuIndex + 1) % _menus.Count);
441
442 break;
443 case 38:
444 dropDown.SelectPreviousEnabled();
445 break;
446 case 40:
447 dropDown.SelectNextEnabled();
448 break;
449 case 13:
450 case 32:
451 dropDown.InvokeSelectedItem();
452 break;
453 default:
454 var item = dropDown.Items.FirstOrDefault(item =>
455 item.CanInvoke && MatchesMnemonic(item.Mnemonic, args.Key));
456
457 if (item is null)
458 return;
459
460 item.PerformClick();
461 break;
462 }
463
464 args.Handled = true;
465 }
466
467 private static bool MatchesMnemonic(char? mnemonic, int key) => mnemonic is char character &&
468 key <= char.MaxValue && key >= 0 &&
469 char.ToUpperInvariant(character) ==
470 char.ToUpperInvariant((char)key);
471
473 public override void Dispose()
474 {
475 if (_disposed)
476 return;
477
478 _disposed = true;
479 CloseMenuInternal(immediate: true);
480
481 _dismissLayer.DismissRequested -= OnDismissRequested;
482
483 foreach (MenuBarMenu menu in _menus)
484 {
485 menu.Header.Invoked -= OnHeaderInvoked;
486 menu.Header.Hovered -= OnHeaderHovered;
487 }
488
489 base.Dispose();
490 MenuOpened = null;
491 MenuClosed = null;
492 ItemInvoked = null;
493 }
494
495 private void OnHeaderInvoked(MenuHeaderWidget header)
496 {
497 int index = _menus.FindIndex(menu => ReferenceEquals(menu.Header, header));
498
499 if (index >= 0)
500 ToggleMenu(index);
501 }
502
503 private void OnHeaderHovered(MenuHeaderWidget header)
504 {
505 if (_openMenuIndex < 0)
506 return;
507
508 int index = _menus.FindIndex(menu => ReferenceEquals(menu.Header, header));
509
510 if (index >= 0 && index != _openMenuIndex)
511 OpenMenuAt(index);
512 }
513
514 internal void OnItemInvoked(MenuItemWidget item)
515 {
516 CloseMenuInternal(immediate: true);
517 ItemInvoked?.Invoke(item);
518 }
519
520 private void OnDismissRequested()
521 {
522 CloseMenu();
523 }
524
525 private void CloseMenuInternal(bool immediate)
526 {
527 if (_openMenuIndex < 0 || _openMenuIndex >= _menus.Count)
528 {
529 _dismissLayer.SetDismissEnabled(false);
530 _openMenuIndex = -1;
531 return;
532 }
533
534 MenuBarMenu menu = _menus[_openMenuIndex];
535 _openMenuIndex = -1;
536
537 menu.Header.SetOpen(false);
538
539 foreach (MenuBarMenu candidate in _menus)
540 candidate.Header.SetMenuBarActive(false);
541
542 _dismissLayer.SetDismissEnabled(false);
543
544 menu.DropDown.CloseAnimated(
546 Math.Max(0f, DropDownAnimationDurationSec),
547 immediate);
548
549 var focused = WidgetInputRouterRegistry.GetFocusedWidget(this);
550
551 if (focused is null || ContainsWidget(this, focused))
552 WidgetInputRouterRegistry.RestoreFocus(this, _previousFocus);
553
554 _previousFocus = null;
555 MenuClosed?.Invoke(menu);
556 }
557
558 private static bool ContainsWidget(ContainerWidget container, WidgetBase widget) =>
559 container.ChildWidgets.Any(child => ReferenceEquals(child, widget) ||
560 child is ContainerWidget nested && ContainsWidget(nested, widget));
561
562 private void PositionDropDown(
563 Rectangle headerBounds,
564 MenuDropDownWidget dropDown)
565 {
566 Rectangle viewport = _view.Viewport.TargetRectPx;
567
568 int x = Math.Clamp(
569 headerBounds.X,
570 viewport.Left,
571 Math.Max(viewport.Left, viewport.Right - dropDown.Width));
572
573 int y = Math.Clamp(_bounds.Bottom, viewport.Top, Math.Max(viewport.Top, viewport.Bottom - dropDown.Height));
574
575 if (Children.Contains(dropDown))
576 SetLocalOffset(dropDown, new Vector2(x - GetPosition().X, y - GetPosition().Y));
577 else
578 dropDown.SetPosition(x, y);
579 }
580
581 private int EstimateHeaderWidth(string text)
582 {
583 int estimatedTextWidth = (int)Math.Ceiling(
584 text.Length * _theme.EstimatedGlyphWidth);
585
586 return Math.Max(
587 _theme.MinimumHeaderWidth,
588 estimatedTextWidth + (_theme.HeaderHorizontalPadding * 2));
589 }
590
591 private void ApplyMenuZOrder(int zOrder)
592 {
593 _dismissLayer.SetLayerZOrder(zOrder);
594 BarBackground.ZOrder = zOrder + 1;
595
596 foreach (MenuBarMenu menu in _menus)
597 {
598 menu.Header.SetHeaderZOrder(zOrder + 2);
599 menu.DropDown.SetDropDownZOrder(zOrder + 10);
600 }
601 }
602
603 private sealed class DismissLayerWidget : WidgetBase
604 {
605 internal event Action? DismissRequested;
606
607 internal DismissLayerWidget(
608 RenderSurfaceHostBase host,
609 View view,
610 Rectangle bounds,
611 string? nickname)
612 : base(
613 host,
615 bounds.Location,
616 nickname)
617 {
618 HitArea = new DirectRectangle(
619 Color.Transparent,
620 host,
621 view,
622 bounds,
623 $"{Nickname}.hit-area")
624 .SetFilled(true)
625 .SetStrokeWidth(0f);
626
627 Add(HitArea);
628
629 CanReceiveFocus = false;
631 }
632
633 internal DirectRectangle HitArea { get; }
634
635 internal void SetDismissEnabled(bool enabled)
636 {
637 IsInputEnabled = enabled;
638 IsPointerInputEnabled = enabled;
639
640 if (enabled && !Visible)
641 Show();
642 else if (!enabled && Visible)
643 Hide();
644 }
645
646 internal void SetLayerZOrder(int zOrder)
647 {
648 HitArea.ZOrder = zOrder;
649 }
650
652 protected override void OnPointerClick(WidgetPointerEventArgs args)
653 {
654 base.OnPointerClick(args);
655
656 if (!args.IsPrimaryButton)
657 return;
658
659 args.Handled = true;
660 DismissRequested?.Invoke();
661 }
662 }
663}
bool Visible
Gets or sets the visibility of all descendants.
ReadOnlyCollection< IDirectCompositeChild > Children
Gets the children owned by the composite.
RenderSurfaceHostBase RenderSurfaceHost
Gets the render surface host shared by the composite and its children.
DirectComposite SetLocalOffset(IDirectCompositeChild child, Vector2 newLocalOffsetPx)
Changes one child's local offset and reapplies its position.
View? View
Gets the view shared by all children in view mode.
Vector2 GetPosition()
Gets the current composite anchor.
virtual DirectComposite Add(IDirectCompositeChild child, bool keepCurrentOffset=true, Vector2? explicitLocalOffsetPx=null)
Adds a composite-compatible direct drawable as a child.
Renders a configurable rectangle with support for fill, border, rounded corners, dash patterns,...
DirectRectangle SetFilled(bool isFilled)
Sets whether the rectangle interior is filled with the base color (or pattern).
DirectRectangle SetBorderColor(Color color)
Sets a distinct border (stroke) color, independent of the fill color.
DirectRectangle SetStrokeWidth(float width)
Sets the width (thickness) of the rectangle's stroke (outline) in pixels.
Represents a base class for hosting a render surface, providing functionality for managing rendering ...
Viewport Viewport
Gets the viewport that defines the screen-space rectangle, zoom level, and other rendering parameters...
Definition View.cs:44
Rectangle TargetRectPx
Screen-space rectangle (in SCREEN / RenderSurface pixels) where this view is drawn....
Definition Viewport.cs:40
override DirectComposite Add(IDirectCompositeChild child, bool keepCurrentOffset=true, Vector2? explicitLocalOffsetPx=null)
Adds a composite-compatible direct drawable as a child.The current composite.
ContainerWidget(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, PointF anchor=default, string? nickname=null)
Initializes a new instance of the ContainerWidget class.
Associates one top-level menu header with its dropdown.
Definition MenuBarMenu.cs:7
MenuDropDownWidget DropDown
Gets the dropdown owned by the header.
MenuHeaderWidget Header
Gets the top-level menu header.
void ToggleMenu(int index)
Toggles the specified top-level menu.
MenuDropDownAnimation DropDownAnimation
Gets or sets the dropdown animation.
MenuBarWidget SetMenuZOrder(int zOrder)
Applies a drawing Z-order to the menu-bar family.
Action< MenuBarMenu >? MenuOpened
Occurs after a top-level menu opens.
Action< MenuBarMenu >? MenuClosed
Occurs after a top-level menu begins closing.
MenuBarWidget(RenderSurfaceHostBase host, View view, Rectangle bounds, MenuBarTheme? theme=null, string? nickname=null)
Creates a menu bar attached to a view.
MenuBarMenu? OpenMenu
Gets the currently open menu, or null.
MenuItemWidget GetItem(string key)
Gets an item by its stable, case-sensitive key, including nested descendants.
MenuBarWidget AddMenu(string text, Action< MenuDropDownWidget >? configure=null, int? headerWidth=null, char? mnemonic=null)
Adds a top-level menu and optionally configures its dropdown.
void OpenMenuAt(int index)
Opens the specified top-level menu.
DirectRectangle BarBackground
Gets the menu bar background drawing.
IReadOnlyList< MenuBarMenu > Menus
Gets the configured top-level menus.
override void ProcessShown()
Performs processing when the widget is shown before notification callbacks are invoked.
float DropDownAnimationDurationSec
Gets or sets the dropdown animation duration, in seconds.
Action< MenuItemWidget >? ItemInvoked
Occurs when a command item is invoked.
void CloseMenu()
Closes the open menu, if any.
override void Dispose()
Disposes the composite and every child it owns.
int OpenMenuIndex
Gets the zero-based open-menu index, or -1.
override void ProcessHidden()
Performs processing when the widget is hidden before notification callbacks are invoked.
override void OnKeyboardInput(WidgetKeyboardEventArgs args)
Called when keyboard input is routed to the widget.
bool TryGetItem(string key, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out MenuItemWidget? item)
Looks up a stable key; returns false and null when absent.
Represents a popup command list owned by a header or submenu item.
Represents a top-level menu header such as File, Edit, or Help.
char? Mnemonic
Gets the explicit, case-insensitive Alt access character.
A command, check/radio item, or submenu owner in a menu dropdown.
KeyGesture? Shortcut
Gets the executable gesture, if any.
string? Key
Gets the immutable optional key, unique within the menu bar.
WidgetBase Show()
Shows the widget and registers it for input routing.
bool CanReceiveFocus
Gets or sets a value indicating whether the widget can receive keyboard focus.
bool IsPointerInputEnabled
Gets or sets a value indicating whether the widget can receive pointer input.
WidgetBase(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, PointF anchor=default, string? nickname=null)
Initializes a new instance of the WidgetBase class.
Definition WidgetBase.cs:95
WidgetBase Activate()
Activates the widget and brings it to the front of the input order.
WidgetBase Hide()
Hides the widget and releases any routed input state.
bool IsKeyboardInputEnabled
Gets or sets a value indicating whether the widget can receive keyboard input.
bool IsInputEnabled
Gets or sets a value indicating whether the widget can participate in input routing.
bool Handled
Gets or sets whether this widget interaction was handled.
Provides data for widget keyboard input events routed by WidgetInputRouter.
KeyboardModifierState Modifiers
Gets the keyboard modifier state at the time of the event.
int Key
Gets the integer key identifier.
KeyAction KeyAction
Gets the action associated with this key event.
@ Rectangle
Particles are spawned uniformly within a rectangular area. This is the default distribution.
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.
KeyboardModifierState
Represents the state of keyboard modifier keys (Shift, Ctrl, Alt) that can be pressed simultaneously ...
KeyAction
Represents the type of action performed on a keyboard key, indicating whether the key was pressed,...
Definition KeyAction.cs:10
MenuDropDownAnimation
Specifies how a menu dropdown is animated when opened or closed.
record MenuBarTheme
Defines the dimensions and colors used by menu bar widgets.
A host key code and an exact combination of keyboard modifiers.
Definition KeyGesture.cs:9