From a579e35fcc51d76f55eca16c7524d95c59b66c26 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 24 Jun 2019 16:48:10 -0400 Subject: [PATCH] Use keyboard styling for shortcuts in tooltips (close #6574) Make tooltips less transparent --- css/80_app.css | 34 ++++++++++++++++++---------------- modules/ui/tooltipHtml.js | 12 ++++++++---- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 6f769c87aa..690fb74ef4 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -140,6 +140,21 @@ a:visited, a { a:hover { color: #597be7; } +kbd { + display: inline-block; + text-align: center; + padding: 3px 5px; + font-size: 11px; + line-height: 12px; + min-width: 12px; + vertical-align: baseline; + background-color: #fcfcfc; + border: solid 1px #ccc; + margin: 0 2px; + border-bottom-color: #bbb; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #bbb; +} /* Forms ------------------------------------------------------- */ @@ -5113,20 +5128,7 @@ img.tile-debug { } .modal-shortcuts .shortcut-keys kbd { - display: inline-block; - text-align: center; - padding: 3px 5px; - font-size: 11px; - line-height: 12px; - min-width: 12px; color: #555; - vertical-align: baseline; - background-color: #fcfcfc; - border: solid 1px #ccc; - margin: 0 2px; - border-bottom-color: #bbb; - border-radius: 3px; - box-shadow: inset 0 -1px 0 #bbb; } svg.mouseclick use.left { @@ -5355,7 +5357,7 @@ svg.mouseclick use.right { pointer-events: none; } .tooltip.in { - opacity: 0.9; + opacity: 0.95; z-index: 5000; height: auto; display: block; @@ -5490,12 +5492,12 @@ svg.mouseclick use.right { .tooltip-inner .tooltip-text { margin-bottom: 20px; } -.tooltip-inner .keyhint { +.tooltip-inner .shortcut { font-weight: bold; margin-left: 5px; } -[dir='rtl'] .tooltip-inner .keyhint { +[dir='rtl'] .tooltip-inner .shortcut { margin-left: 0; margin-right: 5px; } diff --git a/modules/ui/tooltipHtml.js b/modules/ui/tooltipHtml.js index d867f49843..597d1a0d9c 100644 --- a/modules/ui/tooltipHtml.js +++ b/modules/ui/tooltipHtml.js @@ -1,7 +1,7 @@ import { t } from '../util/locale'; -export function uiTooltipHtml(text, key, heading) { +export function uiTooltipHtml(text, keys, heading) { var s = ''; if (heading) { @@ -10,9 +10,13 @@ export function uiTooltipHtml(text, key, heading) { if (text) { s += '
' + text + '
'; } - if (key) { - s += '
' + t('tooltip_keyhint') + '' + - '' + key + '
'; + if (keys) { + if (!Array.isArray(keys)) keys = [keys]; + s += '
' + t('tooltip_keyhint') + ''; + keys.forEach(function(key) { + s += '' + key + ''; + }); + s += '
'; } return s;