Show the icon on the checked item in a collection menu on macOS

On macOS, the current target in the New Collection dialog and the Add To
menus showed a checkmark in place of its folder icon -- type="checkbox"
makes nsMenuItemX::SetupIcon() skip the item. The `checked` attribute
alone marks it without suppressing the icon. Windows and Linux draw the
check in place of the icon either way.
This commit is contained in:
Dan Stillman 2026-08-21 14:15:45 -04:00
parent 1d1d32a211
commit c098f5e84d

View file

@ -1790,8 +1790,7 @@ Zotero.Utilities.Internal = {
let menuitem = doc.createXULElement('menuitem');
menuitem.setAttribute("label", label);
if (value == currentTarget) {
// type="checkbox" hides icon, so only set if checked
menuitem.setAttribute("type", "checkbox");
// Not type="checkbox", which suppresses the icon
menuitem.setAttribute("checked", "true");
}
menuitem.setAttribute("value", value);