Show keyboard shortcuts in status bar tooltips

This commit is contained in:
Jonatan Heyman 2023-12-21 19:26:02 +01:00
parent 49d3e5cd7d
commit f8db397e0c

View File

@ -38,6 +38,18 @@
const lang = LANGUAGE_MAP[this.language] const lang = LANGUAGE_MAP[this.language]
return !!lang ? lang.supportsFormat : false return !!lang ? lang.supportsFormat : false
}, },
cmdKey() {
return window.heynote.platform.isMac ? "⌘" : "Ctrl"
},
formatBlockTitle() {
return `Format Block Content (Alt + Shift + F)`
},
changeLanguageTitle() {
return `Change language for current block (${this.cmdKey} + L)`
},
}, },
} }
</script> </script>
@ -55,7 +67,7 @@
<div <div
@click="$emit('openLanguageSelector')" @click="$emit('openLanguageSelector')"
class="status-block lang clickable" class="status-block lang clickable"
title="Change language for current block" :title="changeLanguageTitle"
> >
{{ languageName }} {{ languageName }}
<span v-if="languageAuto" class="auto">(auto)</span> <span v-if="languageAuto" class="auto">(auto)</span>
@ -64,7 +76,7 @@
v-if="supportsFormat" v-if="supportsFormat"
@click="$emit('formatCurrentBlock')" @click="$emit('formatCurrentBlock')"
class="status-block format clickable" class="status-block format clickable"
title="Format Block Content" :title="formatBlockTitle"
> >
<span class="icon icon-format"></span> <span class="icon icon-format"></span>
</div> </div>