Fix colorpicker styling on Windows (#4326)
This commit is contained in:
parent
694ccecf4a
commit
54721652b3
2 changed files with 21 additions and 10 deletions
|
@ -26,10 +26,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
{
|
{
|
||||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/base.js", this);
|
|
||||||
|
|
||||||
class ColorPicker extends XULElementBase {
|
class ColorPicker extends XULElementBase {
|
||||||
content = MozXULElement.parseXULToFragment(`
|
content = MozXULElement.parseXULToFragment(`
|
||||||
<vbox>
|
<vbox>
|
||||||
|
@ -57,9 +53,15 @@
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [
|
return [
|
||||||
'#FF6666', '#FF8C19', '#999999',
|
'#FF6666',
|
||||||
'#5FB236', '#009980', '#2EA8E5',
|
'#FF8C19',
|
||||||
'#576DD9', '#A28AE5', '#A6507B'
|
'#999999',
|
||||||
|
'#5FB236',
|
||||||
|
'#009980',
|
||||||
|
'#2EA8E5',
|
||||||
|
'#576DD9',
|
||||||
|
'#A28AE5',
|
||||||
|
'#A6507B'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,9 +91,15 @@
|
||||||
Zotero.debug('WARNING: <color-picker> CE: Set color-labels when setting colors');
|
Zotero.debug('WARNING: <color-picker> CE: Set color-labels when setting colors');
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
'general.red', 'general.orange', 'general.gray',
|
'general.red',
|
||||||
'general.green', 'general.teal', 'general.blue',
|
'general.orange',
|
||||||
'general.purple', 'general.violet', 'general.maroon'
|
'general.gray',
|
||||||
|
'general.green',
|
||||||
|
'general.teal',
|
||||||
|
'general.blue',
|
||||||
|
'general.purple',
|
||||||
|
'general.violet',
|
||||||
|
'general.maroon'
|
||||||
].map(label => Zotero.getString(label));
|
].map(label => Zotero.getString(label));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,6 +185,8 @@
|
||||||
let tile = document.createElement('button');
|
let tile = document.createElement('button');
|
||||||
tile.setAttribute('aria-label', colorLabels[i]);
|
tile.setAttribute('aria-label', colorLabels[i]);
|
||||||
tile.classList.add('grid-tile');
|
tile.classList.add('grid-tile');
|
||||||
|
// Disable our custom button styling on Windows
|
||||||
|
tile.classList.add('btn');
|
||||||
tile.style.background = color;
|
tile.style.background = color;
|
||||||
|
|
||||||
tile.addEventListener('click', () => {
|
tile.addEventListener('click', () => {
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
Services.scriptloader.loadSubScript("chrome://zotero/content/tagColorChooser.js", this);
|
Services.scriptloader.loadSubScript("chrome://zotero/content/tagColorChooser.js", this);
|
||||||
|
|
||||||
// Custom elements
|
// Custom elements
|
||||||
|
Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this);
|
||||||
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/colorPicker.js", this);
|
Services.scriptloader.loadSubScript("chrome://zotero/content/elements/colorPicker.js", this);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue