diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c38911..6963c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ a flexibility update. - improved: additional menu option descriptions on hover. - improved: listen to prefers-color-scheme to better change theme in night shift. - improved: platform-specific option overrides for features not required on macOS. +- improved: made extra padding at the bottom with the "focus mode" extension toggleable. - bugfix: removed messenger emoji set as the provider no longer supports it. - bugfix: remove shadow around light mode board headers. - bugfix: properly detect/respond to `EACCES`/`EBUSY` errors. @@ -69,11 +70,7 @@ a fork of notion-deb-builder that does generate an app.asar has been created and // todo -MACOS SPECIFIC FIXES - -- close to tray: perma-true -- frameless mode: perma-false -- open ext. menu hotkey not working? +- open ext. menu hotkey not working on macOS? ### v0.9.1 (2020-09-26) diff --git a/mods/focus-mode/mod.js b/mods/focus-mode/mod.js index 10994ac..5546cbd 100644 --- a/mods/focus-mode/mod.js +++ b/mods/focus-mode/mod.js @@ -13,6 +13,24 @@ module.exports = { name: 'focus mode', desc: 'hide the titlebar/menubar if the sidebar is closed (will be shown on hover).', - version: '0.1.1', + version: '0.2.0', author: 'arecsu', + options: [ + { + key: 'padded', + label: 'add padding to bottom of the page', + description: `will only take effect when the sidebar is hidden. aims to make the canvas\ + as symmetrical/consistent as possible: if there is empty space on 3 sides, the 4th should follow.z`, + type: 'toggle', + value: true, + }, + ], + hacks: { + 'renderer/preload.js': (store, __exports) => { + document.addEventListener('readystatechange', (event) => { + if (document.readyState !== 'complete') return false; + if (store().padded) document.body.dataset.focusmode = 'padded'; + }); + }, + }, }; diff --git a/mods/focus-mode/styles.css b/mods/focus-mode/styles.css index c71829f..032761f 100644 --- a/mods/focus-mode/styles.css +++ b/mods/focus-mode/styles.css @@ -5,16 +5,6 @@ * under the MIT license */ -/* add space at the bottom of the main frame when sidebar is hidden - * -- matches space at top for titlebar */ -.notion-dark-theme .notion-frame { - transition: height 100ms ease 0s; -} -.notion-sidebar-container[style*='width: 0px;'] + .notion-frame { - height: calc( - 100% - (var(--configured--dragarea_height, 10px) + 45px) - ) !important; -} .notion-sidebar-container[style*='width: 0px;'] + .notion-frame .notion-topbar { opacity: 0 !important; transition: opacity 200ms ease-in-out !important; @@ -24,3 +14,15 @@ .notion-topbar:hover { opacity: 1 !important; } +/* add space at the bottom of the main frame when sidebar is hidden +* -- matches space at top for titlebar */ +[data-focusmode='padded'] .notion-dark-theme .notion-frame { + transition: height 100ms ease 0s; +} +[data-focusmode='padded'] + .notion-sidebar-container[style*='width: 0px;'] + + .notion-frame { + height: calc( + 100% - (var(--configured--dragarea_height, 10px) + 45px) + ) !important; +}