=> 2ed9d1bbd3b92b8d39a368963c3fd5d0fbcdc974
[1mdiff --git a/src/macos.m b/src/macos.m[m [1mindex d9ee71e7..24c83aec 100644[m [1m--- a/src/macos.m[m [1m+++ b/src/macos.m[m [36m@@ -553,10 +553,15 @@[m [mstatic void makeMenuItems_(NSMenu *menu, MenuCommands *commands, const iMenuItem[m else {[m const iBool hasCommand = (items[i].command && items[i].command[0]);[m iBool isChecked = iFalse;[m [32m+[m[32m iBool isDisabled = iFalse;[m if (startsWith_CStr(label, "###")) {[m isChecked = iTrue;[m label += 3;[m }[m [32m+[m[32m else if (startsWith_CStr(label, "///")) {[m [32m+[m[32m isDisabled = iTrue;[m [32m+[m[32m label += 3;[m [32m+[m[32m }[m iString itemTitle;[m initCStr_String(&itemTitle, label);[m removeIconPrefix_String(&itemTitle);[m [36m@@ -571,6 +576,7 @@[m [mstatic void makeMenuItems_(NSMenu *menu, MenuCommands *commands, const iMenuItem[m if (isChecked) {[m [item setState:NSControlStateValueOn];[m }[m [32m+[m[32m [item setEnabled:!isDisabled];[m int key = items[i].key;[m int kmods = items[i].kmods;[m if (hasCommand) {[m [36m@@ -653,11 +659,22 @@[m [mvoid showPopupMenu_MacOS(iWidget *source, iInt2 windowCoord, const iMenuItem *it[m iWindow * window = as_Window(mainWindow_App());[m NSWindow * nsWindow = nsWindow_(window->win);[m /* View coordinates are flipped. */[m [32m+[m[32m iBool isCentered = iFalse;[m [32m+[m[32m if (isEqual_I2(windowCoord, zero_I2())) {[m [32m+[m[32m windowCoord = divi_I2(window->size, 2);[m [32m+[m[32m isCentered = iTrue;[m [32m+[m[32m }[m windowCoord.y = window->size.y - windowCoord.y;[m windowCoord = divf_I2(windowCoord, window->pixelRatio);[m NSPoint screenPoint = [nsWindow convertPointToScreen:(CGPoint){ windowCoord.x, windowCoord.y }];[m makeMenuItems_(menu, menuCommands, items, n);[m [menuCommands setSource:source];[m [32m+[m[32m if (isCentered) {[m [32m+[m[32m NSSize menuSize = [menu size];[m [32m+[m[32m screenPoint.x -= menuSize.width / 2;[m [32m+[m[32m screenPoint.y += menuSize.height / 2;[m [32m+[m[32m }[m [32m+[m[32m [menu setAutoenablesItems:NO];[m [menu popUpMenuPositioningItem:nil atLocation:screenPoint inView:nil];[m [menu release];[m [menuCommands release];[m [1mdiff --git a/src/ui/root.c b/src/ui/root.c[m [1mindex 595184cc..6a98b261 100644[m [1m--- a/src/ui/root.c[m [1m+++ b/src/ui/root.c[m [36m@@ -430,20 +430,18 @@[m [mstatic void updateNavBarIdentity_(iWidget *navBar) {[m const iGmIdentity *ident =[m identityForUrl_GmCerts(certs_App(), url_DocumentWidget(document_App()));[m iWidget *button = findChild_Widget(navBar, "navbar.ident");[m [31m- iLabelWidget *toolButton = findWidget_App("toolbar.ident");[m [32m+[m[32m iWidget *menu = findChild_Widget(button, "menu");[m setFlags_Widget(button, selected_WidgetFlag, ident != NULL);[m [31m- setOutline_LabelWidget(toolButton, ident == NULL);[m /* Update menu. */[m [31m- iLabelWidget *idItem = child_Widget(findChild_Widget(button, "menu"), 0);[m [31m- if (!idItem) return;[m const iString *subjectName = ident ? name_GmIdentity(ident) : NULL;[m [31m- setTextCStr_LabelWidget([m [31m- idItem,[m [31m- subjectName ? format_CStr(uiTextAction_ColorEscape "%s", cstr_String(subjectName))[m [31m- : "${menu.identity.notactive}");[m [31m- setFlags_Widget(as_Widget(idItem), disabled_WidgetFlag, !ident);[m [32m+[m[32m const char * idLabel = subjectName[m [32m+[m[32m ? format_CStr(uiTextAction_ColorEscape "%s", cstr_String(subjectName))[m [32m+[m[32m : "///${menu.identity.notactive}";[m [32m+[m[32m setMenuItemLabelByIndex_Widget(menu, 0, idLabel);[m [32m+[m[32m iLabelWidget *toolButton = findWidget_App("toolbar.ident");[m iLabelWidget *toolName = findWidget_App("toolbar.name");[m if (toolName) {[m [32m+[m[32m setOutline_LabelWidget(toolButton, ident == NULL);[m updateTextCStr_LabelWidget(toolName, subjectName ? cstr_String(subjectName) : "");[m setFont_LabelWidget(toolButton, subjectName ? defaultMedium_FontId : uiLabelLarge_FontId);[m arrange_Widget(parent_Widget(toolButton));[m [1mdiff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c[m [1mindex fdfb5300..ffedfeeb 100644[m [1m--- a/src/ui/sidebarwidget.c[m [1m+++ b/src/ui/sidebarwidget.c[m [36m@@ -1457,25 +1457,29 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m if (d->mode == bookmarks_SidebarMode && d->contextItem) {[m const iBookmark *bm = get_Bookmarks(bookmarks_App(), d->contextItem->id);[m if (bm) {[m [31m- updateMenuItemLabel_Widget(d->menu, "bookmark.tag tag:homepage",[m [31m- hasTag_Bookmark(bm, homepage_BookmarkTag)[m [31m- ? home_Icon " ${bookmark.untag.home}"[m [31m- : home_Icon " ${bookmark.tag.home}");[m [31m- updateMenuItemLabel_Widget(d->menu, "bookmark.tag tag:subscribed",[m [31m- hasTag_Bookmark(bm, subscribed_BookmarkTag)[m [31m- ? star_Icon " ${bookmark.untag.sub}"[m [31m- : star_Icon " ${bookmark.tag.sub}");[m [31m- updateMenuItemLabel_Widget(d->menu, "bookmark.tag tag:remotesource",[m [31m- hasTag_Bookmark(bm, remoteSource_BookmarkTag)[m [31m- ? downArrowBar_Icon " ${bookmark.untag.remote}"[m [31m- : downArrowBar_Icon " ${bookmark.tag.remote}");[m [32m+[m[32m setMenuItemLabel_Widget(d->menu,[m [32m+[m[32m "bookmark.tag tag:homepage",[m [32m+[m[32m hasTag_Bookmark(bm, homepage_BookmarkTag)[m [32m+[m[32m ? home_Icon " ${bookmark.untag.home}"[m [32m+[m[32m : home_Icon " ${bookmark.tag.home}");[m [32m+[m[32m setMenuItemLabel_Widget(d->menu,[m [32m+[m[32m "bookmark.tag tag:subscribed",[m [32m+[m[32m hasTag_Bookmark(bm, subscribed_BookmarkTag)[m [32m+[m[32m ? star_Icon " ${bookmark.untag.sub}"[m [32m+[m[32m : star_Icon " ${bookmark.tag.sub}");[m [32m+[m[32m setMenuItemLabel_Widget(d->menu,[m [32m+[m[32m "bookmark.tag tag:remotesource",[m [32m+[m[32m hasTag_Bookmark(bm, remoteSource_BookmarkTag)[m [32m+[m[32m ? downArrowBar_Icon " ${bookmark.untag.remote}"[m [32m+[m[32m : downArrowBar_Icon " ${bookmark.tag.remote}");[m }[m }[m else if (d->mode == feeds_SidebarMode && d->contextItem) {[m const iBool isRead = d->contextItem->indent == 0;[m [31m- updateMenuItemLabel_Widget(d->menu, "feed.entry.toggleread",[m [31m- isRead ? circle_Icon " ${feeds.entry.markunread}"[m [31m- : circleWhite_Icon " ${feeds.entry.markread}");[m [32m+[m[32m setMenuItemLabel_Widget(d->menu,[m [32m+[m[32m "feed.entry.toggleread",[m [32m+[m[32m isRead ? circle_Icon " ${feeds.entry.markunread}"[m [32m+[m[32m : circleWhite_Icon " ${feeds.entry.markread}");[m }[m else if (d->mode == identities_SidebarMode) {[m const iGmIdentity *ident = constHoverIdentity_SidebarWidget_(d);[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex a5b1cfb3..6d518282 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -709,6 +709,7 @@[m [mvoid makeMenuItems_Widget(iWidget *menu, const iMenuItem *items, size_t n) {[m }[m else {[m iBool isInfo = iFalse;[m [32m+[m[32m iBool isDisabled = iFalse;[m if (startsWith_CStr(labelText, ">>>")) {[m labelText += 3;[m if (!horizGroup) {[m [36m@@ -722,6 +723,10 @@[m [mvoid makeMenuItems_Widget(iWidget *menu, const iMenuItem *items, size_t n) {[m labelText += 3;[m isInfo = iTrue;[m }[m [32m+[m[32m if (startsWith_CStr(labelText, "///")) {[m [32m+[m[32m labelText += 3;[m [32m+[m[32m isDisabled = iTrue;[m [32m+[m[32m }[m iLabelWidget *label = addChildFlags_Widget([m horizGroup ? horizGroup : menu,[m iClob(newKeyMods_LabelWidget(labelText, item->key, item->kmods, item->command)),[m [36m@@ -730,6 +735,7 @@[m [mvoid makeMenuItems_Widget(iWidget *menu, const iMenuItem *items, size_t n) {[m setWrap_LabelWidget(label, isInfo);[m haveIcons |= checkIcon_LabelWidget(label);[m updateSize_LabelWidget(label); /* drawKey was set */[m [32m+[m[32m setFlags_Widget(as_Widget(label), disabled_WidgetFlag, isDisabled);[m if (isInfo) {[m setFlags_Widget(as_Widget(label), fixedHeight_WidgetFlag, iTrue); /* wrap changes height */[m setTextColor_LabelWidget(label, uiTextAction_ColorId);[m [36m@@ -784,10 +790,10 @@[m [mstatic iArray *deepCopyMenuItems_(iWidget *menu, const iMenuItem *items, size_t[m }[m #endif[m pushBack_Array(array, &(iMenuItem){[m [31m- item->label ? strdup(item->label) : NULL,[m [32m+[m[32m item->label ? iDupStr(item->label) : NULL,[m item->key,[m item->kmods,[m [31m- itemCommand ? strdup(itemCommand) : NULL /* NOTE: Only works with string commands. */[m [32m+[m[32m itemCommand ? iDupStr(itemCommand) : NULL /* NOTE: Only works with string commands. */[m });[m }[m deinit_String(&cmd);[m [36m@@ -883,45 +889,78 @@[m [miMenuItem *findNativeMenuItem_Widget(iWidget *menu, const char *commandSuffix) {[m return NULL;[m }[m [m [31m-void setSelected_NativeMenuItem(iMenuItem *item, iBool isSelected) {[m [32m+[m[32mvoid setPrefix_NativeMenuItem(iMenuItem *item, const char *prefix, iBool set) {[m if (!item->label) {[m return;[m }[m [31m- const iBool hasPrefix = startsWith_CStr(item->label, "###");[m [31m- if (hasPrefix && !isSelected) {[m [31m- char *label = strdup(item->label + 3);[m [32m+[m[32m const iBool hasPrefix = startsWith_CStr(item->label, prefix);[m [32m+[m[32m if (hasPrefix && !set) {[m [32m+[m[32m char *label = iDupStr(item->label + 3);[m free((char *) item->label);[m item->label = label;[m }[m [31m- else if (!hasPrefix && isSelected) {[m [32m+[m[32m else if (!hasPrefix && set) {[m char *label = malloc(strlen(item->label) + 4);[m [31m- memcpy(label, "###", 3);[m [32m+[m[32m memcpy(label, prefix, 3);[m strcpy(label + 3, item->label);[m free((char *) item->label);[m item->label = label;[m }[m }[m [m [31m-void updateMenuItemLabel_Widget(iWidget *menu, const char *command, const char *newLabel) {[m [31m- if (~flags_Widget(menu) & nativeMenu_WidgetFlag) {[m [31m- iLabelWidget *menuItem = findMenuItem_Widget(menu, command);[m [31m- if (menuItem) {[m [31m- setTextCStr_LabelWidget(menuItem, newLabel);[m [31m- checkIcon_LabelWidget(menuItem);[m [31m- }[m [32m+[m[32mvoid setSelected_NativeMenuItem(iMenuItem *item, iBool isSelected) {[m [32m+[m[32m if (item) {[m [32m+[m[32m setPrefix_NativeMenuItem(item, "///", iFalse);[m [32m+[m[32m setPrefix_NativeMenuItem(item, "###", isSelected);[m }[m [31m- else {[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setDisabled_NativeMenuItem(iMenuItem *item, iBool isDisabled) {[m [32m+[m[32m if (item) {[m [32m+[m[32m setPrefix_NativeMenuItem(item, "###", iFalse);[m [32m+[m[32m setPrefix_NativeMenuItem(item, "///", isDisabled);[m [32m+[m[32m }[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setLabel_NativeMenuItem(iMenuItem *item, const char *label) {[m [32m+[m[32m free((char *) item->label);[m [32m+[m[32m item->label = iDupStr(label);[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setMenuItemLabel_Widget(iWidget *menu, const char *command, const char *newLabel) {[m [32m+[m[32m if (flags_Widget(menu) & nativeMenu_WidgetFlag) {[m iArray *items = userData_Object(menu);[m iAssert(items);[m iForEach(Array, i, items) {[m iMenuItem *item = i.value;[m if (item->command && !iCmpStr(item->command, command)) {[m [31m- free((void *) item->label);[m [31m- item->label = strdup(newLabel);[m [32m+[m[32m setLabel_NativeMenuItem(item, newLabel);[m break;[m }[m }[m }[m [32m+[m[32m else {[m [32m+[m[32m iLabelWidget *menuItem = findMenuItem_Widget(menu, command);[m [32m+[m[32m if (menuItem) {[m [32m+[m[32m setTextCStr_LabelWidget(menuItem, newLabel);[m [32m+[m[32m checkIcon_LabelWidget(menuItem);[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setMenuItemLabelByIndex_Widget(iWidget *menu, size_t index, const char *newLabel) {[m [32m+[m[32m if (flags_Widget(menu) & nativeMenu_WidgetFlag) {[m [32m+[m[32m iArray *items = userData_Object(menu);[m [32m+[m[32m iAssert(items);[m [32m+[m[32m iAssert(index < size_Array(items));[m [32m+[m[32m setLabel_NativeMenuItem(at_Array(items, index), newLabel);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m iLabelWidget *menuItem = child_Widget(menu, index);[m [32m+[m[32m iAssert(isInstance_Object(menuItem, &Class_LabelWidget));[m [32m+[m[32m setTextCStr_LabelWidget(menuItem, newLabel);[m [32m+[m[32m checkIcon_LabelWidget(menuItem);[m [32m+[m[32m }[m }[m [m void unselectAllNativeMenuItems_Widget(iWidget *menu) {[m [36m@@ -953,8 +992,7 @@[m [mvoid openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, iBool postCommands) {[m const iArray *items = userData_Object(d);[m iAssert(flags_Widget(d) & nativeMenu_WidgetFlag);[m iAssert(items);[m [31m- showPopupMenu_MacOS(d, windowCoord, //mouseCoord_Window(get_Window(), 0),[m [31m- constData_Array(items), size_Array(items));[m [32m+[m[32m showPopupMenu_MacOS(d, windowCoord, constData_Array(items), size_Array(items));[m #else[m const iRect rootRect = rect_Root(d->root);[m const iInt2 rootSize = rootRect.size;[m [36m@@ -1085,9 +1123,14 @@[m [miLabelWidget *findMenuItem_Widget(iWidget *menu, const char *command) {[m }[m [m void setMenuItemDisabled_Widget(iWidget *menu, const char *command, iBool disable) {[m [31m- iLabelWidget *item = findMenuItem_Widget(menu, command);[m [31m- if (item) {[m [31m- setFlags_Widget(as_Widget(item), disabled_WidgetFlag, disable);[m [32m+[m[32m if (flags_Widget(menu) & nativeMenu_WidgetFlag) {[m [32m+[m[32m setDisabled_NativeMenuItem(findNativeMenuItem_Widget(menu, command), disable);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m iLabelWidget *item = findMenuItem_Widget(menu, command);[m [32m+[m[32m if (item) {[m [32m+[m[32m setFlags_Widget(as_Widget(item), disabled_WidgetFlag, disable);[m [32m+[m[32m }[m }[m }[m [m [36m@@ -1120,6 +1163,10 @@[m [mconst iString *removeMenuItemLabelPrefixes_String(const iString *d) {[m remove_Block(&str->chars, 0, 3);[m continue;[m }[m [32m+[m[32m if (startsWith_String(str, "///")) {[m [32m+[m[32m remove_Block(&str->chars, 0, 3);[m [32m+[m[32m continue;[m [32m+[m[32m }[m if (startsWith_String(str, "```")) {[m remove_Block(&str->chars, 0, 3);[m continue;[m [36m@@ -2823,10 +2870,17 @@[m [mstatic const iMenuItem languages[] = {[m static iBool translationHandler_(iWidget *dlg, const char *cmd) {[m iUnused(dlg);[m if (equal_Command(cmd, "xlt.lang")) {[m [31m- iLabelWidget *menuItem = pointer_Command(cmd);[m [31m- iWidget *button = parent_Widget(parent_Widget(menuItem));[m [31m- iAssert(isInstance_Object(button, &Class_LabelWidget));[m [31m- updateText_LabelWidget((iLabelWidget *) button, text_LabelWidget(menuItem));[m [32m+[m[32m const iMenuItem *langItem = &languages[languageIndex_CStr(cstr_Rangecc(range_Command(cmd, "id")))];[m [32m+[m[32m iWidget *widget = pointer_Command(cmd);[m [32m+[m[32m iLabelWidget *drop;[m [32m+[m[32m if (flags_Widget(widget) & nativeMenu_WidgetFlag) {[m [32m+[m[32m drop = (iLabelWidget *) parent_Widget(widget);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m drop = (iLabelWidget *) parent_Widget(parent_Widget(widget));[m [32m+[m[32m }[m [32m+[m[32m iAssert(isInstance_Object(drop, &Class_LabelWidget));[m [32m+[m[32m updateDropdownSelection_LabelWidget(drop, langItem->command);[m return iTrue;[m }[m return iFalse;[m [36m@@ -2880,25 +2934,25 @@[m [miWidget *makeTranslation_Widget(iWidget *parent) {[m addChild_Widget(dlg, iClob(page = makeTwoColumns_Widget(&headings, &values)));[m setId_Widget(page, "xlt.langs");[m iLabelWidget *fromLang, *toLang;[m [32m+[m[32m const size_t numLangs = iElemCount(languages) - 1;[m [32m+[m[32m const char *widestLabel = languages[findWidestLabel_MenuItem(languages, numLangs)].label;[m /* Source language. */ {[m addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.translate.from}")));[m [31m- setId_Widget([m [31m- addChildFlags_Widget(values,[m [31m- iClob(fromLang = makeMenuButton_LabelWidget([m [31m- "${lang.pt}", languages, iElemCount(languages) - 1)),[m [31m- alignLeft_WidgetFlag),[m [31m- "xlt.from");[m [32m+[m[32m setId_Widget(addChildFlags_Widget(values,[m [32m+[m[32m iClob(fromLang = makeMenuButton_LabelWidget([m [32m+[m[32m widestLabel, languages, numLangs)),[m [32m+[m[32m alignLeft_WidgetFlag),[m [32m+[m[32m "xlt.from");[m setBackgroundColor_Widget(findChild_Widget(as_Widget(fromLang), "menu"),[m uiBackgroundMenu_ColorId);[m }[m /* Target language. */ {[m addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.translate.to}")));[m [31m- setId_Widget([m [31m- addChildFlags_Widget(values,[m [31m- iClob(toLang = makeMenuButton_LabelWidget([m [31m- "${lang.pt}", languages, iElemCount(languages) - 1)),[m [31m- alignLeft_WidgetFlag),[m [31m- "xlt.to");[m [32m+[m[32m setId_Widget(addChildFlags_Widget(values,[m [32m+[m[32m iClob(toLang = makeMenuButton_LabelWidget([m [32m+[m[32m widestLabel, languages, numLangs)),[m [32m+[m[32m alignLeft_WidgetFlag),[m [32m+[m[32m "xlt.to");[m setBackgroundColor_Widget(findChild_Widget(as_Widget(toLang), "menu"),[m uiBackgroundMenu_ColorId);[m }[m [36m@@ -2908,14 +2962,18 @@[m [miWidget *makeTranslation_Widget(iWidget *parent) {[m arrange_Widget(dlg);[m }[m /* Update choices. */[m [31m- updateText_LabelWidget([m [31m- findChild_Widget(dlg, "xlt.from"),[m [31m- text_LabelWidget(child_Widget(findChild_Widget(findChild_Widget(dlg, "xlt.from"), "menu"),[m [31m- prefs_App()->langFrom)));[m [31m- updateText_LabelWidget([m [31m- findChild_Widget(dlg, "xlt.to"),[m [31m- text_LabelWidget(child_Widget(findChild_Widget(findChild_Widget(dlg, "xlt.to"), "menu"),[m [31m- prefs_App()->langTo)));[m [32m+[m[32m updateDropdownSelection_LabelWidget(findChild_Widget(dlg, "xlt.from"),[m [32m+[m[32m languages[prefs_App()->langFrom].command);[m [32m+[m[32m updateDropdownSelection_LabelWidget(findChild_Widget(dlg, "xlt.to"),[m [32m+[m[32m languages[prefs_App()->langTo].command);[m [32m+[m[32m// updateText_LabelWidget([m [32m+[m[32m// findChild_Widget(dlg, "xlt.from"),[m [32m+[m[32m// text_LabelWidget(child_Widget(findChild_Widget(findChild_Widget(dlg, "xlt.from"), "menu"),[m [32m+[m[32m// prefs_App()->langFrom)));[m [32m+[m[32m// updateText_LabelWidget([m [32m+[m[32m// findChild_Widget(dlg, "xlt.to"),[m [32m+[m[32m// text_LabelWidget(child_Widget(findChild_Widget(findChild_Widget(dlg, "xlt.to"), "menu"),[m [32m+[m[32m// prefs_App()->langTo)));[m setCommandHandler_Widget(dlg, translationHandler_);[m setupSheetTransition_Mobile(dlg, iTrue);[m return dlg;[m [1mdiff --git a/src/ui/util.h b/src/ui/util.h[m [1mindex a1914e2a..574a255f 100644[m [1m--- a/src/ui/util.h[m [1m+++ b/src/ui/util.h[m [36m@@ -226,24 +226,25 @@[m [mstruct Impl_MenuItem {[m };[m };[m [m [31m-iWidget * makeMenu_Widget (iWidget *parent, const iMenuItem *items, size_t n); /* returns no ref */[m [31m-void makeMenuItems_Widget (iWidget *menu, const iMenuItem *items, size_t n);[m [31m-void openMenu_Widget (iWidget *, iInt2 windowCoord);[m [31m-void openMenuFlags_Widget (iWidget *, iInt2 windowCoord, iBool postCommands);[m [31m-void closeMenu_Widget (iWidget *);[m [31m-void releaseNativeMenu_Widget(iWidget *);[m [32m+[m[32miWidget * makeMenu_Widget (iWidget *parent, const iMenuItem *items, size_t n); /* returns no ref */[m [32m+[m[32mvoid makeMenuItems_Widget (iWidget *menu, const iMenuItem *items, size_t n);[m [32m+[m[32mvoid openMenu_Widget (iWidget *, iInt2 windowCoord);[m [32m+[m[32mvoid openMenuFlags_Widget (iWidget *, iInt2 windowCoord, iBool postCommands);[m [32m+[m[32mvoid closeMenu_Widget (iWidget *);[m [32m+[m[32mvoid releaseNativeMenu_Widget (iWidget *);[m [m [31m-size_t findWidestLabel_MenuItem (const iMenuItem *items, size_t num);[m [31m-void setSelected_NativeMenuItem (iMenuItem *item, iBool isSelected);[m [32m+[m[32msize_t findWidestLabel_MenuItem (const iMenuItem *items, size_t num);[m [32m+[m[32mvoid setSelected_NativeMenuItem (iMenuItem *item, iBool isSelected);[m [m [31m-iChar removeIconPrefix_String (iString *);[m [32m+[m[32miChar removeIconPrefix_String (iString *);[m [m [31m-iLabelWidget * findMenuItem_Widget (iWidget *menu, const char *command);[m [31m-iMenuItem * findNativeMenuItem_Widget (iWidget *menu, const char *commandSuffix);[m [31m-void setMenuItemDisabled_Widget (iWidget *menu, const char *command, iBool disable);[m [31m-void updateMenuItemLabel_Widget (iWidget *menu, const char *command, const char *newLabel);[m [32m+[m[32miLabelWidget * findMenuItem_Widget (iWidget *menu, const char *command);[m [32m+[m[32miMenuItem * findNativeMenuItem_Widget (iWidget *menu, const char *commandSuffix);[m [32m+[m[32mvoid setMenuItemDisabled_Widget (iWidget *menu, const char *command, iBool disable);[m [32m+[m[32mvoid setMenuItemLabel_Widget (iWidget *menu, const char *command, const char *newLabel);[m [32m+[m[32mvoid setMenuItemLabelByIndex_Widget (iWidget *menu, size_t index, const char *newLabel);[m [m [31m-int checkContextMenu_Widget (iWidget *, const SDL_Event *ev); /* see macro below */[m [32m+[m[32mint checkContextMenu_Widget (iWidget *, const SDL_Event *ev); /* see macro below */[m [m #define processContextMenuEvent_Widget(menu, sdlEvent, stmtEaten) \[m for (const int result = checkContextMenu_Widget((menu), (sdlEvent));;) { \[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).