Update tag selector styling for macOS

This commit is contained in:
Adomas Venčkauskas 2018-12-18 13:47:11 +02:00
parent f5c4fb06e1
commit fc41326319
10 changed files with 49 additions and 5 deletions

View file

@ -57,7 +57,7 @@ class Button extends PureComponent {
}
get menuMarker() {
if (!Zotero.isNode) {
if (!Zotero.isNode && !Zotero.isMac) {
return this.props.isMenu && <span className="menu-marker"/>
}
return this.props.isMenu && <IconDownChevron className="menu-marker"/>

View file

@ -20,13 +20,13 @@ Icon.propTypes = {
module.exports = { Icon }
function i(name, svgOrSrc) {
function i(name, svgOrSrc, hasDPI=true) {
const icon = class extends PureComponent {
render() {
const { className } = this.props
if (typeof svgOrSrc == 'string') {
if (window.devicePixelRatio >= 1.25) {
if (hasDPI && window.devicePixelRatio >= 1.25) {
let parts = svgOrSrc.split('.');
parts[parts.length-2] = parts[parts.length-2] + '@2x';
svgOrSrc = parts.join('.')

View file

@ -22,7 +22,13 @@ async function getSass(source, options, signatures={}) {
let newFileSignature = await getFileSignature(f);
let destFile = getPathRelativeTo(f, 'scss');
destFile = path.join(path.dirname(destFile), path.basename(destFile, '.scss') + '.css');
const dest = path.join.apply(this, ['build', 'chrome', 'skin', 'default', 'zotero', destFile]);
let dest = path.join.apply(this, ['build', 'chrome', 'skin', 'default', 'zotero', destFile]);
if (['win', 'mac', 'unix'].some(platform => f.endsWith(`-${platform}.scss`))) {
let platform = f.slice(f.lastIndexOf('-')+1, f.lastIndexOf('.'));
destFile = destFile.slice(0, destFile.lastIndexOf('-'))
+ destFile.slice(destFile.lastIndexOf('-')+1+platform.length);
dest = path.join.apply(this, ['build', 'chrome', 'content', 'zotero-platform', platform, destFile]);
}
if (f in signatures) {
if (compareSignatures(newFileSignature, signatures[f])) {

View file

@ -22,3 +22,4 @@
@import "components/tag-selector";
@import "components/button";
@import "components/icons";

View file

@ -30,7 +30,6 @@
}
svg, img {
vertical-align: middle;
width: 16px;
}
}
span.menu-marker {

View file

@ -0,0 +1,7 @@
.icon > svg, .icon > img {
width: 16px;
}
.icon.icon-downchevron > img {
width: 7px;
}

11
scss/mac/_button.scss Normal file
View file

@ -0,0 +1,11 @@
//
// Button
// --------------------------------------------------
.btn {
-moz-appearance: none;
span.menu-marker {
-moz-appearance: none;
}
}

View file

@ -0,0 +1,6 @@
@import "zotero-react-client";
//
// Linux specific
// --------------------------------------------------

View file

@ -0,0 +1,8 @@
@import "zotero-react-client";
//
// MacOS specific
// --------------------------------------------------
@import "mac/button";
@import "mac/tag-selector";

View file

@ -0,0 +1,6 @@
@import "zotero-react-client";
//
// Windows specific
// --------------------------------------------------