mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-04 04:39:03 +00:00
fix menu hotkey + tab title emojis on macOS
This commit is contained in:
parent
9e1417ac3e
commit
667c727ac9
@ -69,10 +69,6 @@ a flexibility update.
|
||||
|
||||
a fork of notion-deb-builder that does generate an app.asar has been created and is once again supported.
|
||||
|
||||
// todo
|
||||
|
||||
- open ext. menu hotkey not working on macOS?
|
||||
|
||||
### v0.9.1 (2020-09-26)
|
||||
|
||||
- bugfix: font chooser will continue iterating through fonts after encountering a blank option.
|
||||
|
@ -25,7 +25,11 @@ module.exports = (store, __exports) => {
|
||||
const hotkey = toKeyEvent(store().menu_toggle);
|
||||
let triggered = true;
|
||||
for (let prop in hotkey)
|
||||
if (hotkey[prop] !== event[prop]) triggered = false;
|
||||
if (
|
||||
hotkey[prop] !== event[prop] &&
|
||||
!(prop === 'key' && event[prop] === 'Dead')
|
||||
)
|
||||
triggered = false;
|
||||
if (triggered) electron.ipcRenderer.send('enhancer:open-menu');
|
||||
if (tabsEnabled) {
|
||||
// switch between tabs via key modifier
|
||||
@ -214,6 +218,10 @@ module.exports = (store, __exports) => {
|
||||
|
||||
if (tabsEnabled) {
|
||||
let tab_title = '';
|
||||
if (process.platform === 'darwin')
|
||||
document
|
||||
.querySelector('.notion-sidebar [style*="37px"]:empty')
|
||||
.remove();
|
||||
const TITLE_OBSERVER = new MutationObserver(() =>
|
||||
__electronApi.setWindowTitle('notion.so')
|
||||
);
|
||||
@ -232,7 +240,11 @@ module.exports = (store, __exports) => {
|
||||
),
|
||||
text = $container.querySelector('[placeholder="Untitled"]');
|
||||
title =
|
||||
(icon ? `<img src="${icon.getAttribute('src')}">` : '') +
|
||||
(icon
|
||||
? icon.getAttribute('src')
|
||||
? `<img src="${icon.getAttribute('src')}">`
|
||||
: `${icon.getAttribute('aria-label')} `
|
||||
: '') +
|
||||
(text
|
||||
? text.innerText
|
||||
: [
|
||||
|
@ -131,7 +131,11 @@ window['__start'] = async () => {
|
||||
const hotkey = toKeyEvent(coreStore().menu_toggle);
|
||||
let triggered = true;
|
||||
for (let prop in hotkey)
|
||||
if (hotkey[prop] !== event[prop]) triggered = false;
|
||||
if (
|
||||
hotkey[prop] !== event[prop] &&
|
||||
!(prop === 'key' && event[prop] === 'Dead')
|
||||
)
|
||||
triggered = false;
|
||||
if (triggered || ((event.ctrlKey || event.metaKey) && event.key === 'w'))
|
||||
electron.remote.getCurrentWindow().close();
|
||||
// focus search
|
||||
|
@ -994,7 +994,11 @@ module.exports = (store, __exports) => {
|
||||
const hotkey = toKeyEvent(store().menu_toggle);
|
||||
let triggered = true;
|
||||
for (let prop in hotkey)
|
||||
if (hotkey[prop] !== event[prop]) triggered = false;
|
||||
if (
|
||||
hotkey[prop] !== event[prop] &&
|
||||
!(prop === 'key' && event[prop] === 'Dead')
|
||||
)
|
||||
triggered = false;
|
||||
if (triggered) electron.ipcRenderer.send('enhancer:open-menu');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user