diff --git a/css/80_app.css b/css/80_app.css index 71aaef946..a3e62bc7c 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -783,7 +783,7 @@ button.add-note svg.icon { [dir='rtl'] .search-add button.add-preset.first-recent { margin-right: 5px; } -.search-add button.add-preset:not(.add-generic-preset) { +.search-add button.add-preset { padding: 0; } .search-add button.add-preset.disabled .preset-icon-container { @@ -1288,6 +1288,9 @@ a.hide-toggle { .preset-icon-iD.framed.line-geom .icon { transform: translateY(-30%) scale(0.74); } +.preset-icon-container.fallback .preset-icon .icon { + transform: scale(0.5) !important; +} .preset-list-button .label { display: flex; diff --git a/modules/ui/modes.js b/modules/ui/modes.js index 4087769c9..2eaef7981 100644 --- a/modules/ui/modes.js +++ b/modules/ui/modes.js @@ -12,7 +12,6 @@ import { modeBrowse } from '../modes'; -import { svgIcon } from '../svg'; import { t, textDirection } from '../util/locale'; import { tooltip } from '../util/tooltip'; import { uiPresetIcon } from './preset_icon'; @@ -203,17 +202,12 @@ export function uiModes(context) { buttonsEnter .each(function(d) { - if (d.preset.isFallback()) { - d3_select(this) - .call(svgIcon('#iD-icon-' + d.preset.id)); - } else { - d3_select(this) - .call(uiPresetIcon() - .geometry((d.geometry === 'point' && !d.preset.matchGeometry(d.geometry)) ? 'vertex' : d.geometry) - .preset(d.preset) - .sizeClass('small') - ); - } + d3_select(this) + .call(uiPresetIcon() + .geometry((d.geometry === 'point' && !d.preset.matchGeometry(d.geometry)) ? 'vertex' : d.geometry) + .preset(d.preset) + .sizeClass('small') + ); }); var dragOrigin, dragMoved, targetIndex, targetData; diff --git a/modules/ui/preset_icon.js b/modules/ui/preset_icon.js index bad8214fe..69b1ef509 100644 --- a/modules/ui/preset_icon.js +++ b/modules/ui/preset_icon.js @@ -17,7 +17,9 @@ export function uiPresetIcon() { function getIcon(p, geom) { - if (p.icon) + if (isSmall() && p.isFallback && p.isFallback()) + return 'iD-icon-' + p.id; + else if (p.icon) return p.icon; else if (geom === 'line') return 'iD-other-line'; @@ -148,6 +150,7 @@ export function uiPresetIcon() { .merge(container); var p = preset.apply(this, arguments); + var isFallback = isSmall() && p.isFallback && p.isFallback(); var geom = geometry ? geometry.apply(this, arguments) : null; var picon = getIcon(p, geom); var isMaki = /^maki-/.test(picon); @@ -155,9 +158,13 @@ export function uiPresetIcon() { var isFa = /^fa[srb]-/.test(picon); var isiDIcon = !(isMaki || isTemaki || isFa); var isCategory = !p.setTags; - var drawLine = geom === 'line' && !isCategory; - var drawFill = geom === 'area' || geom === 'vertex'; - var isFramed = (drawFill || drawLine); + var drawPoint = geom === 'point' && isSmall() && !isFallback; + var drawVertex = geom === 'vertex' && !isFallback; + var drawLine = geom === 'line' && !isFallback && !isCategory; + var drawArea = geom === 'area' && !isFallback; + var isFramed = (drawVertex || drawArea || drawLine); + + container.classed('fallback', isFallback); var tags = !isCategory ? p.setTags({}, geom) : {}; for (var k in tags) { @@ -168,7 +175,7 @@ export function uiPresetIcon() { var tagClasses = svgTagClasses().getClassesString(tags, ''); var pointBorder = container.selectAll('.preset-icon-point-border') - .data(geom === 'point' && isSmall() ? [0] : []); + .data(drawPoint ? [0] : []); pointBorder.exit() .remove(); @@ -179,7 +186,7 @@ export function uiPresetIcon() { var vertexFill = container.selectAll('.preset-icon-fill-vertex') - .data(geom === 'vertex' ? [0] : []); + .data(drawVertex ? [0] : []); vertexFill.exit() .remove(); @@ -190,7 +197,7 @@ export function uiPresetIcon() { var fill = container.selectAll('.preset-icon-fill-area') - .data(geom === 'area' ? [0] : []); + .data(drawArea ? [0] : []); fill.exit() .remove();