DesktopMenu record

Namespace Runic.Platform in Runic.Platform 0.23.0

public sealed record DesktopMenu : DesktopMenuEntry, IEquatable<DesktopMenu>

Inherits or implements DesktopMenuEntry, IEquatable.

A menu of the menu bar, or a submenu of any menu.

Parameters

Title

The visible title, literal text in the user's language: not blank, at most 128 characters. Mnemonic markers such as & or _ are shown as written.

Items

The items, separators and submenus, in order.

Constructors

DesktopMenu

public DesktopMenu(string Title, ImmutableArray<DesktopMenuEntry> Items)

A menu of the menu bar, or a submenu of any menu.

Parameters

Title

The visible title, literal text in the user's language: not blank, at most 128 characters. Mnemonic markers such as & or _ are shown as written.

Items

The items, separators and submenus, in order.

Properties

AccessKey

public char? AccessKey { get; init; }

Gets the menu's access key, a letter or digit of the title's language, or null for none.

Remarks

Windows and Linux underline it in the title and open the menu with Alt and the key; Runic places the marker, so the title stays literal text. When the title does not contain the key, it is shown after the title, as in Fichier (F). macOS and status icon menus ignore it.

IsEnabled

public bool IsEnabled { get; init; }

Gets whether the menu can be opened; a disabled menu also disables its entries.

Items

public ImmutableArray<DesktopMenuEntry> Items { get; init; }

The items, separators and submenus, in order.

Role

public DesktopMenuRole Role { get; init; }

Gets where the menu goes in the menu bar; ignored for a submenu and in a status icon menu.

Title

public string Title { get; init; }

The visible title, literal text in the user's language: not blank, at most 128 characters. Mnemonic markers such as & or _ are shown as written.