LavaUI docs

enum ImportedMenu

Swift

enum ImportedMenu

Turning a flattened DBusMenu import into a MenuModel.

Shared because there are two importers now and one shape: the focused window's menu (PanelMenu) and a tray item's (StatusNotifierTray). They differ in where the rows come from and in nothing else, so the conversion takes an accessor rather than an importer.

Sources/LavaUI/PanelMenu.swift:165

Methods

static func entries(under parent: Int32, children: [Int32 : [ImportedMenuItem]]) -> [MenuEntry]

The rows under one parent, as menu entries.

A tray item's menu is this list directly: its root is the menu, where a window's root is a bar of them.

Sources/LavaUI/PanelMenu.swift:203

static func model(count: Int, item: (Int) -> ImportedMenuItem) -> MenuModel

Top-level menus, each with its items. item is called once per index.

Sources/LavaUI/PanelMenu.swift:174

static func rootEntries(count: Int, item: (Int) -> ImportedMenuItem) -> [MenuEntry]

The flattened import as a flat list of entries — every row under the root, submenus nested.

Sources/LavaUI/PanelMenu.swift:231