fishy
08/30/2026, 8:29 AMseb
08/30/2026, 10:01 AMfishy
08/31/2026, 6:30 AMseb
08/31/2026, 6:31 AMseb
08/31/2026, 6:32 AMfishy
08/31/2026, 6:32 AMseb
08/31/2026, 6:32 AMfishy
08/31/2026, 6:32 AMfishy
08/31/2026, 6:33 AMseb
08/31/2026, 6:33 AMseb
08/31/2026, 6:34 AMfishy
08/31/2026, 6:35 AM/** Provides formatted shortcut hint strings for [ContextMenuItemOptionAction] entries shown in menus. */
public interface MenuItemShortcutHintProvider {
/**
* Gets the formatted shortcut string for the given action identifier.
*
* @param actionType The action type. See [ContextMenuItemOptionAction].
* @return The human-readable shortcut string (e.g., "⌘C", "Ctrl+S"), or empty if no shortcut is defined or it
* shouldn't be displayed.
*/
public fun getShortcutHint(actionType: ContextMenuItemOptionAction): String
}
/** The predefined actions for [ContextMenuItemOption]s. */
@Suppress("AbstractClassCanBeInterface") // Binary compatibility: sealed class cannot be changed to interface
public sealed class ContextMenuItemOptionAction {
/** Represents a "Copy" action. */
public data object CopyMenuItemOptionAction : ContextMenuItemOptionAction()
/** Represents a "Paste" action. */
public data object PasteMenuItemOptionAction : ContextMenuItemOptionAction()
/** Represents a "Cut" action. */
public data object CutMenuItemOptionAction : ContextMenuItemOptionAction()
/** Represents a "Select All" action. */
public data object SelectAllMenuItemOptionAction : ContextMenuItemOptionAction()
}
So it seems like if you want more than 4 different actions, you can't, because it's sealedfishy
08/31/2026, 6:35 AMseb
08/31/2026, 8:03 AMDaniel Souza Bertoldi
08/31/2026, 11:44 AMMenuItemShortcutHintProvider was created, but I do agree it's very limitedseb
08/31/2026, 11:55 AM