=> 4ab8242aa1801ddd0e720ddbea41aa43190bdc87
[1mdiff --git a/res/about/version.gmi b/res/about/version.gmi[m [1mindex b7d3104e..e6c94c94 100644[m [1m--- a/res/about/version.gmi[m [1m+++ b/res/about/version.gmi[m [36m@@ -6,6 +6,10 @@[m ```[m # Release notes[m [m [32m+[m[32m## 1.17.3[m [32m+[m[32m* Fixed issues with dropdown menus when the menu appears as a popup window.[m [32m+[m[32m* Fixed clearing the pinned identity of a bookmark.[m [32m+[m ## 1.17.2[m * Tabs opened in background are immediately added to the URL history.[m * Mouse wheel direction switches back to vertical when a wide block has been scrolled all the way.[m [1mdiff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c[m [1mindex 261c6798..00237f6f 100644[m [1m--- a/src/ui/labelwidget.c[m [1m+++ b/src/ui/labelwidget.c[m [36m@@ -101,7 +101,7 @@[m [mstatic iBool checkModifiers_(int have, int req) {[m [m static void trigger_LabelWidget_(const iLabelWidget *d) {[m const iWidget *w = constAs_Widget(d);[m [31m- postCommand_Widget(&d->widget, "%s", cstr_String(&d->command));[m [32m+[m[32m postCommand_Widget(w, "%s", cstr_String(&d->command));[m if (flags_Widget(w) & radio_WidgetFlag) {[m iForEach(ObjectList, i, children_Widget(w->parent)) {[m setFlags_Widget(i.object, selected_WidgetFlag, d == i.object);[m [36m@@ -109,7 +109,7 @@[m [mstatic void trigger_LabelWidget_(const iLabelWidget *d) {[m }[m /* Triggering a menu item will always close all popup menus. */[m if (d->flags.menuCanceling) {[m [31m- postCommand_Widget(&d->widget, "menu.cancel");[m [32m+[m[32m postCommand_Root(NULL, "menu.cancel");[m }[m }[m [m [1mdiff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c[m [1mindex 2cb9c6c6..31ddb78c 100644[m [1m--- a/src/ui/sidebarwidget.c[m [1m+++ b/src/ui/sidebarwidget.c[m [36m@@ -1202,7 +1202,7 @@[m [miBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *c[m if (bm) {[m set_String(&bm->identity, string_Command(cmd, "fp"));[m updateDropdownSelection_LabelWidget(findChild_Widget(editor, "bmed.setident"),[m [31m- cstr_String(&bm->identity));[m [32m+[m[32m format_CStr(" fp:%s", cstr_String(&bm->identity)));[m }[m return iTrue;[m }[m [36m@@ -1740,7 +1740,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m setToggle_Widget(remoteSourceTag, bm->flags & remoteSource_BookmarkFlag);[m setToggle_Widget(linkSplitTag, bm->flags & linkSplit_BookmarkFlag);[m updateDropdownSelection_LabelWidget(findChild_Widget(dlg, "bmed.setident"),[m [31m- format_CStr("bmed.setident fp:%s",[m [32m+[m[32m format_CStr(" fp:%s",[m cstr_String(&bm->identity)));[m }[m setBookmarkEditorParentFolder_Widget(dlg, bm ? bm->parentId : 0);[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex 29ef6093..b4b1c009 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -1190,7 +1190,7 @@[m [mvoid setNativeMenuItems_Widget(iWidget *menu, const iMenuItem *items, size_t n)[m #endif[m }[m [m [31m-iWidget *parentMenu_Widget(iWidget *menuItem) {[m [32m+[m[32miWidget *parentMenu_Widget(const iWidget *menuItem) {[m if (parent_Widget(menuItem)) {[m if (!cmp_String(id_Widget(parent_Widget(menuItem)), "menu")) {[m return parent_Widget(menuItem);[m [36m@@ -1829,11 +1829,34 @@[m [mstatic const iString *replaceNewlinesWithDash_(const iString *str) {[m return collect_String(mod);[m }[m [m [32m+[m[32miWidget *dropdownMenu_Widget(iWidget *dropButton) {[m [32m+[m[32m if (!dropButton) {[m [32m+[m[32m return NULL;[m [32m+[m[32m }[m [32m+[m[32m iWidget *menu = findChild_Widget(dropButton, "menu");[m [32m+[m[32m if (!menu) {[m [32m+[m[32m if (dropButton->flags2 & childMenuOpenedAsPopup_WidgetFlag2) {[m [32m+[m[32m /* The menu has been migrated temporarily into a popup window. We need to locate[m [32m+[m[32m the right popup. */[m [32m+[m[32m iConstForEach(PtrArray, p, popupWindows_App()) {[m [32m+[m[32m const iWindow *win = p.ptr;[m [32m+[m[32m iWidget *winRoot = win->roots[0]->widget;[m [32m+[m[32m if (userData_Object(winRoot) == dropButton) {[m [32m+[m[32m iAssert(!cmp_String(id_Widget(winRoot), "menu"));[m [32m+[m[32m return winRoot;[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m iAssert(menu);[m [32m+[m[32m return menu;[m [32m+[m[32m}[m [32m+[m void updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *selectedCommand) {[m if (!dropButton) {[m return;[m }[m [31m- iWidget *menu = findChild_Widget(as_Widget(dropButton), "menu");[m [32m+[m[32m iWidget *menu = dropdownMenu_Widget(as_Widget(dropButton));[m if (flags_Widget(menu) & nativeMenu_WidgetFlag) {[m unselectAllNativeMenuItems_Widget(menu);[m iMenuItem *item = findNativeMenuItem_Widget(menu, selectedCommand);[m [36m@@ -1850,6 +1873,7 @@[m [mvoid updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *s[m iForEach(ObjectList, i, children_Widget(menu)) {[m if (isInstance_Object(i.object, &Class_LabelWidget)) {[m iLabelWidget *item = i.object;[m [32m+[m[32m printf("update: [%s] sel=%s?\n", cstr_String(command_LabelWidget(item)), selectedCommand); fflush(stdout);[m const iBool isSelected = endsWith_String(command_LabelWidget(item), selectedCommand);[m setFlags_Widget(as_Widget(item), selected_WidgetFlag, isSelected);[m if (isSelected) {[m [36m@@ -4056,7 +4080,7 @@[m [miWidget *makeBookmarkEditor_Widget(uint32_t folderId, iBool withDup) {[m iClob(makeHeading_Widget(isFolder ? "${dlg.bookmark.parentfolder}"[m : "${dlg.bookmark.folder}")));[m const iArray *folderItems =[m [31m- makeBookmarkFolderActions_MenuItem("dlg.bookmark.setfolder", iFalse, folderId);[m [32m+[m[32m makeBookmarkFolderActions_MenuItem("!dlg.bookmark.setfolder", iFalse, folderId);[m iLabelWidget *folderButton;[m setId_Widget(addChildFlags_Widget(values,[m iClob(folderButton = makeMenuButton_LabelWidget([m [36m@@ -4138,7 +4162,7 @@[m [mstatic iBool handleBookmarkCreationCommands_SidebarWidget_(iWidget *editor, cons[m const iString *fp = string_Command(cmd, "fp");[m iLabelWidget *setident = findChild_Widget(editor, "bmed.setident");[m set_String(&as_Widget(setident)->data, fp);[m [31m- updateDropdownSelection_LabelWidget(setident, cstr_String(fp));[m [32m+[m[32m updateDropdownSelection_LabelWidget(setident, format_CStr(" fp:%s", cstr_String(fp)));[m return iTrue;[m }[m if (equal_Command(cmd, "bmed.accept") || equal_Command(cmd, "bmed.cancel")) {[m [1mdiff --git a/src/ui/util.h b/src/ui/util.h[m [1mindex c81e6a46..5ddc6dbb 100644[m [1m--- a/src/ui/util.h[m [1m+++ b/src/ui/util.h[m [36m@@ -322,7 +322,7 @@[m [mvoid setMenuItemLabel_Widget (iWidget *menu, const char *comm[m void setMenuItemLabelByIndex_Widget (iWidget *menu, size_t index, const char *newLabel);[m void setNativeMenuItems_Widget (iWidget *menu, const iMenuItem *items, size_t n);[m iWidget * findUserData_Widget (iWidget *, void *userData);[m [31m-iWidget * parentMenu_Widget (iWidget *menuItem);[m [32m+[m[32miWidget * parentMenu_Widget (const iWidget *menuItem);[m [m int checkContextMenu_Widget (iWidget *, const SDL_Event *ev); /* see macro below */[m void animateToRootVisibleTop_Widget (iWidget *, uint32_t span);[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex 2b40a4d5..695878ca 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -2585,6 +2585,15 @@[m [mvoid postCommand_Widget(const iAnyObject *d, const char *cmd, ...) {[m }[m if (!isGlobal) {[m iAssert(isInstance_Object(d, &Class_Widget));[m [32m+[m[32m if (type_Window(window_Widget(d)) == popup_WindowType) {[m [32m+[m[32m /* Use the original parent root for the command, so it will be handled by[m [32m+[m[32m whoever owns the popup menu. */[m [32m+[m[32m const iWidget *originalParent =[m [32m+[m[32m constAs_Widget(userData_Object(parentMenu_Widget(constAs_Widget(d))));[m [32m+[m[32m if (originalParent) {[m [32m+[m[32m d = originalParent;[m [32m+[m[32m }[m [32m+[m[32m }[m iString ptrStr;[m init_String(&ptrStr);[m /* Insert the widget pointer as the first argument so possible suffixes are unaffected. */[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).