fx-compat: Fix toolbar
This commit is contained in:
parent
dd3385ec67
commit
a60e46dd5c
3 changed files with 56 additions and 15 deletions
48
chrome/content/zotero/elements/toolbarbuttonDropmarker.js
Normal file
48
chrome/content/zotero/elements/toolbarbuttonDropmarker.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright © 2022 Corporation for Digital Scholarship
|
||||
Vienna, Virginia, USA
|
||||
https://www.zotero.org
|
||||
|
||||
This file is part of Zotero.
|
||||
|
||||
Zotero is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Zotero is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
{
|
||||
/**
|
||||
* Extends MozToolbarbutton to use our own dropmarker image.
|
||||
*/
|
||||
class ToolbarbuttonDropmarker extends customElements.get('toolbarbutton') {
|
||||
static get dropmarkerFragment() {
|
||||
let frag = document.importNode(
|
||||
MozXULElement.parseXULToFragment(`
|
||||
<image src="chrome://zotero/skin/searchbar-dropmarker${Zotero.hiDPISuffix}.png" width="7" height="4"/>
|
||||
`),
|
||||
true
|
||||
);
|
||||
Object.defineProperty(this, "dropmarkerFragment", { value: frag });
|
||||
return frag;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("toolbarbutton-dropmarker", ToolbarbuttonDropmarker, {
|
||||
extends: "toolbarbutton",
|
||||
});
|
||||
}
|
|
@ -83,6 +83,7 @@
|
|||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/tagsBox.js", this);
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/relatedBox.js", this);
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/attachmentBox.js", this);
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/toolbarbuttonDropmarker.js", this);
|
||||
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/tabs.js", this);
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/zoteroPane.js", this);
|
||||
|
@ -758,6 +759,7 @@
|
|||
<hbox id="zotero-collections-toolbar" align="center">
|
||||
<toolbarbutton id="zotero-tb-collection-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
|
||||
<toolbarbutton
|
||||
is="toolbarbutton-dropmarker"
|
||||
id="zotero-tb-library-add-menu"
|
||||
class="zotero-tb-button"
|
||||
tooltiptext="&zotero.toolbar.newLibrary.label;"
|
||||
|
@ -779,6 +781,7 @@
|
|||
|
||||
<hbox id="zotero-items-toolbar" align="center">
|
||||
<toolbarbutton
|
||||
is="toolbarbutton-dropmarker"
|
||||
id="zotero-tb-add"
|
||||
class="zotero-tb-button"
|
||||
tooltiptext="&zotero.toolbar.newItem.label;"
|
||||
|
@ -827,7 +830,9 @@
|
|||
</panel>
|
||||
|
||||
<!--<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.note.standalone;" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>-->
|
||||
<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newNote;"
|
||||
<toolbarbutton
|
||||
is="toolbarbutton-dropmarker"
|
||||
id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newNote;"
|
||||
type="menu"
|
||||
wantdropmarker="true"
|
||||
onmousedown="if (this.disabled) { event.preventDefault(); return; }">
|
||||
|
@ -837,6 +842,7 @@
|
|||
</menupopup>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton
|
||||
is="toolbarbutton-dropmarker"
|
||||
id="zotero-tb-attachment-add"
|
||||
class="zotero-tb-button"
|
||||
tooltiptext="&zotero.items.menu.attach;"
|
||||
|
@ -862,6 +868,7 @@
|
|||
<hbox id="zotero-item-toolbar" flex="1" align="center" tooltip="html-tooltip">
|
||||
<hbox align="center" pack="start" flex="1">
|
||||
<toolbarbutton
|
||||
is="toolbarbutton-dropmarker"
|
||||
id="zotero-tb-locate"
|
||||
class="zotero-tb-button"
|
||||
tooltiptext="&zotero.toolbar.openURL.label;"
|
||||
|
|
|
@ -241,19 +241,6 @@
|
|||
mix-blend-mode: multiply;
|
||||
}
|
||||
|
||||
.toolbarbutton-menu-dropmarker {
|
||||
padding-inline-start: 0;
|
||||
list-style-image: url('chrome://zotero/skin/searchbar-dropmarker.png');
|
||||
}
|
||||
|
||||
.toolbarbutton-menu-dropmarker .dropmarker-icon {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
.zotero-tb-button[type="panel"] > dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.zotero-button-clear-image {
|
||||
list-style-image: none
|
||||
}
|
||||
|
@ -731,7 +718,6 @@
|
|||
@media (min-resolution: 1.25dppx) {
|
||||
#zotero-items-column-hasAttachment { list-style-image: url(chrome://zotero/skin/attach-small@2x.png); }
|
||||
#zotero-items-column-numNotes { list-style-image: url(chrome://zotero/skin/treeitem-note-small@2x.png); }
|
||||
.toolbarbutton-menu-dropmarker { list-style-image: url('chrome://zotero/skin/searchbar-dropmarker@2x.png'); }
|
||||
#zotero-tb-collection-add { list-style-image: url('chrome://zotero/skin/toolbar-collection-add@2x.png'); }
|
||||
.zotero-menuitem-new-feed { list-style-image: url('chrome://zotero/skin/toolbar-feed-add@2x.png'); }
|
||||
#zotero-tb-library-add-menu { list-style-image: url('chrome://zotero/skin/library_add@2x.png'); }
|
||||
|
|
Loading…
Reference in a new issue