mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-12 00:09:03 +00:00
fix #28: overlap b/w tabs and macos window buttons
This commit is contained in:
parent
b93f730170
commit
7993f0f257
@ -10,7 +10,7 @@ module.exports = async function (api, db, __exports, __eval) {
|
|||||||
const url = require('url'),
|
const url = require('url'),
|
||||||
electron = require('electron'),
|
electron = require('electron'),
|
||||||
electronWindow = electron.remote.getCurrentWindow(),
|
electronWindow = electron.remote.getCurrentWindow(),
|
||||||
{ components, web } = api;
|
{ components, web, env } = api;
|
||||||
|
|
||||||
window['__start'] = async () => {
|
window['__start'] = async () => {
|
||||||
// display:none; to prevent content flash while css loads
|
// display:none; to prevent content flash while css loads
|
||||||
@ -28,6 +28,9 @@ module.exports = async function (api, db, __exports, __eval) {
|
|||||||
$windowActions = web.html`<div id="window-actions"></div>`;
|
$windowActions = web.html`<div id="window-actions"></div>`;
|
||||||
document.body.prepend(web.render($header, $tabs, $newTab, $windowActions));
|
document.body.prepend(web.render($header, $tabs, $newTab, $windowActions));
|
||||||
|
|
||||||
|
// make space for native window buttons on mac
|
||||||
|
if (env.name === 'darwin') $tabs.style.paddingLeft = '72px';
|
||||||
|
|
||||||
$newTab.addEventListener('click', () => new Tab($tabs, $root));
|
$newTab.addEventListener('click', () => new Tab($tabs, $root));
|
||||||
electron.ipcRenderer.on('notion-enhancer:close-tab', (event, id) => {
|
electron.ipcRenderer.on('notion-enhancer:close-tab', (event, id) => {
|
||||||
const tab = tabCache.get(id);
|
const tab = tabCache.get(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user