diff --git a/chrome/content/zotero-platform/mac/itemPane.css b/chrome/content/zotero-platform/mac/itemPane.css index 034984e81b..ca05aa7bcb 100644 --- a/chrome/content/zotero-platform/mac/itemPane.css +++ b/chrome/content/zotero-platform/mac/itemPane.css @@ -1,13 +1,12 @@ +#zotero-feed-item-toggleRead-button { + margin: 5px 0 3px 6px; +} + #zotero-feed-item-addTo-button { margin: 5px 6px 3px; padding-left: 8px; } -#zotero-feed-item-addTo-button button { - margin: 0; - -moz-appearance: none; -} - /* Show duplicates date list item as selected even when not focused (default behavior on other platforms) */ #zotero-duplicates-merge-original-date:not(:focus) > richlistitem[selected="true"] { diff --git a/chrome/content/zotero-platform/unix/itemPane.css b/chrome/content/zotero-platform/unix/itemPane.css index 82e8f78040..b7d029f967 100644 --- a/chrome/content/zotero-platform/unix/itemPane.css +++ b/chrome/content/zotero-platform/unix/itemPane.css @@ -1,11 +1,3 @@ -/* Some distros have icons disabled by default at the OS level and - * mozilla is a respectful gent. - */ -#zotero-feed-item-addTo-button .button-icon { - display: block; - margin-right: 5px -} - /* Set to hidden in user-agent css for some reason. */ #zotero-feed-item-addTo-button .menu-iconic-left { visibility: visible; diff --git a/chrome/content/zotero/elements/splitMenuButton.js b/chrome/content/zotero/elements/splitMenuButton.js index da8e1e00cc..6a26c46967 100644 --- a/chrome/content/zotero/elements/splitMenuButton.js +++ b/chrome/content/zotero/elements/splitMenuButton.js @@ -27,17 +27,15 @@ { /** - * Extends MozButton to provide a split menubutton with a clickable left side and a dropmarker that opens a menu. + * A split menubutton with a clickable left side and a dropmarker that opens a menu. */ - class SplitMenuButton extends customElements.get('button') { + class SplitMenuButton extends HTMLButtonElement { + _image = null; + _label = null; + constructor() { super(); - - // Just in case, make sure this button does NOT appear as a standard + + + diff --git a/chrome/skin/default/zotero/itemPane.css b/chrome/skin/default/zotero/itemPane.css index ce760c657e..bc81f42c3a 100644 --- a/chrome/skin/default/zotero/itemPane.css +++ b/chrome/skin/default/zotero/itemPane.css @@ -85,28 +85,12 @@ } #zotero-feed-item-toggleRead-button { - /* - DEBUG: `overflow: hidden` breaks clicking in fx102, but without it longer localized strings - overflow the button at narrow pane widths - - https://github.com/zotero/zotero/issues/3110 - overflow: hidden; + white-space: nowrap; text-overflow: ellipsis; max-width: 150px; - */ } #zotero-feed-item-addTo-button { max-width: 250px; } - -#zotero-feed-item-addTo-button button { - overflow: hidden; - text-overflow: ellipsis; -} - -#zotero-feed-item-addTo-button .button-icon { - margin-inline-end: 5px; - height: 16px; -} diff --git a/chrome/skin/default/zotero/overlay.css b/chrome/skin/default/zotero/overlay.css index 41d9076b5f..07f8906e6c 100644 --- a/chrome/skin/default/zotero/overlay.css +++ b/chrome/skin/default/zotero/overlay.css @@ -716,15 +716,42 @@ color: HighlightText; } -.split-menu-button, .split-menu-button [anonid="dropmarker-box"] { - /* Hide the dropmarker if the button overflows */ +.split-menu-button { + display: flex; + align-items: center; + padding-right: 0; +} + +.split-menu-button [anonid="button-image-and-text-box"] { + flex: 1; + display: flex; + align-items: center; + justify-content: center; +} + +.split-menu-button [anonid="button-image"] { + width: 16px; + height: 16px; + flex-shrink: 0; + margin-inline-end: 8px; +} + +.split-menu-button [anonid="button-text"] { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.split-menu-button [anonid="dropmarker-box"] { + display: flex; + align-items: center; overflow: hidden; } .split-menu-button [anonid="dropmarker-separator"] { - -moz-box-flex: 1; + height: calc(100% - 5px); border-inline-start: 1px solid #aaa; - margin: 5px 2px 5px 4px; + margin: 0 2px 0 4px; } .split-menu-button .split-menu-button-dropmarker { diff --git a/test/tests/itemPaneTest.js b/test/tests/itemPaneTest.js index 7bb405cfb0..df115c3715 100644 --- a/test/tests/itemPaneTest.js +++ b/test/tests/itemPaneTest.js @@ -354,9 +354,9 @@ describe("Item pane", function () { let button = doc.getElementById('zotero-feed-item-toggleRead-button'); - assert.equal(button.getAttribute('label'), Zotero.getString('pane.item.markAsUnread')); + assert.equal(button.textContent, Zotero.getString('pane.item.markAsUnread')); yield item.toggleRead(false); - assert.equal(button.getAttribute('label'), Zotero.getString('pane.item.markAsRead')); + assert.equal(button.textContent, Zotero.getString('pane.item.markAsRead')); }); }); });