diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ea284..6559d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ a flexibility update. - improved: use keyup listeners instead of a globalShortcut for the enhancements menu toggle. - improved: overwrite `app.asar.bak` if already exists (e.g. for app updates). - improved: additional menu option descriptions on hover. +- improved: listen to prefers-color-scheme to better change theme in night shift. - bugfix: removed messenger emoji set as the provider no longer supports it. - bugfix: remove shadow around light mode board headers \+ minor text colour fixes for night shift theming. @@ -47,6 +48,9 @@ a flexibility update. - bugfix: right-to-left extension applies to text in columns. - bugfix: block text colour applies to text with backgrounds. - bugfix: font applied to wrong mode with littlepig dark. +- bugfix: keep "empty" top bar visible in the menu. +- bugfix: set NSRequiresAquaSystemAppearance to false in /Applications/Notion.app/Contents/Info.plist + so system dark/light mode can be properly detected. - tweak: sticky table/list rows. - theme: "material ocean" = an oceanic colour palette. - theme: "dracula" = a theme based on the popular dracula color palette @@ -62,6 +66,11 @@ a fork of notion-deb-builder that does generate an app.asar has been created and - bugfix: windows are properly hidden/shown on macOS. - extension: "tweaks" = common style/layout changes. +MACOS SPECIFIC FIXES + +- close to tray: perma-true +- frameless mode: perma-false + ### v0.9.1 (2020-09-26) - bugfix: font chooser will continue iterating through fonts after encountering a blank option. diff --git a/mods/core/css/menu.css b/mods/core/css/menu.css index 0e1b502..7bf8437 100644 --- a/mods/core/css/menu.css +++ b/mods/core/css/menu.css @@ -117,6 +117,9 @@ s { #titlebar .window-buttons-area:empty { display: none; } +[data-platform='darwin'] #titlebar { + height: 2.65em; +} /* alerts */ diff --git a/mods/core/css/tabs.css b/mods/core/css/tabs.css index 1e38668..4e98540 100644 --- a/mods/core/css/tabs.css +++ b/mods/core/css/tabs.css @@ -75,6 +75,9 @@ body, flex-direction: column; } +[data-platform='darwin'] #titlebar { + padding-left: 4em; +} #titlebar::before { content: ''; position: absolute; diff --git a/mods/core/enhancerMenu.js b/mods/core/enhancerMenu.js index 28750ce..dbaa2c6 100644 --- a/mods/core/enhancerMenu.js +++ b/mods/core/enhancerMenu.js @@ -14,6 +14,8 @@ const store = require('../../pkg/store.js'), { toKeyEvent } = require('keyboardevent-from-electron-accelerator'); window['__start'] = async () => { + document.body.setAttribute('data-platform', process.platform); + // mod loader const modules = helpers.getEnhancements(); if (modules.loaded.length) diff --git a/mods/core/render.js b/mods/core/render.js index 30bdc25..ba57639 100644 --- a/mods/core/render.js +++ b/mods/core/render.js @@ -972,6 +972,8 @@ module.exports = (store, __exports) => { window['__start'] = () => { document.head.innerHTML += ``; + document.body.setAttribute('data-platform', process.platform); + const modules = getEnhancements(); for (let mod of modules.loaded) { for (let font of mod.fonts || []) { diff --git a/mods/night-shift/mod.js b/mods/night-shift/mod.js index 0c29d7c..6449f85 100644 --- a/mods/night-shift/mod.js +++ b/mods/night-shift/mod.js @@ -12,7 +12,7 @@ module.exports = { name: 'night shift', desc: 'sync dark/light theme with the system (overrides normal theme setting).', - version: '0.1.1', + version: '0.1.2', author: 'dragonwocky', hacks: { 'renderer/preload.js'(store, __exports) { @@ -23,19 +23,22 @@ module.exports = { const notion_elem = document.querySelector('.notion-app-inner'); if (!notion_elem) return; clearInterval(attempt_interval); - process([{ target: notion_elem }]); - const observer = new MutationObserver(process); + handle([{ target: notion_elem }]); + const observer = new MutationObserver(handle); observer.observe(notion_elem, { attributes: true, subtree: true, }); - function process(list, observer) { + function handle(list, observer) { const mode = `notion-app-inner notion-${ window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' }-theme`; if (notion_elem.className !== mode) notion_elem.className = mode; + window + .matchMedia('(prefers-color-scheme: dark)') + .addEventListener('change', handle); } } }); diff --git a/pkg/Info.plist b/pkg/Info.plist new file mode 100644 index 0000000..5f0c788 --- /dev/null +++ b/pkg/Info.plist @@ -0,0 +1,107 @@ + + + + + AsarIntegrity + {"checksums":{"app.asar":"ZpfV8GYpkh6txWRLY2kyhxy+u/IqxXQicxy6MJr5nNo+FpB7+OvoU+S+6vpgTFAriFyk1Vzdm3LL3r2YdtqkKQ==","electron.asar":"GSTmZZ4QxBFCHgDFXN5eV94sbMRBgM04kw+f9bM+XZB00NCsFz1+8yIOYHycj0X6OoxeOOi08sk4Epi5a2kCDQ=="}} + BuildMachineOSBuild + 17D102 + CFBundleDisplayName + Notion + CFBundleExecutable + Notion + CFBundleIconFile + Notion.icns + CFBundleIdentifier + notion.id + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Notion + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.0.8 + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + notion + CFBundleURLSchemes + + notion + + + + CFBundleVersion + 2.0.8 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTSDKBuild + 10.13 + DTSDKName + macosx10.13 + DTXcode + 0941 + DTXcodeBuild + 9F2000 + LSApplicationCategoryType + public.app-category.productivity + LSMinimumSystemVersion + 10.10.0 + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + NSExceptionDomains + + 127.0.0.1 + + NSIncludesSubdomains + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + NSTemporaryExceptionAllowsInsecureHTTPSLoads + + NSTemporaryExceptionMinimumTLSVersion + 1.0 + NSTemporaryExceptionRequiresForwardSecrecy + + + localhost + + NSIncludesSubdomains + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + NSTemporaryExceptionAllowsInsecureHTTPSLoads + + NSTemporaryExceptionMinimumTLSVersion + 1.0 + NSTemporaryExceptionRequiresForwardSecrecy + + + + + NSCameraUsageDescription + This app needs access to the camera + NSHighResolutionCapable + + NSHumanReadableCopyright + Copyright © 2020 Notion Labs, Incorporated + NSMainNibFile + MainMenu + NSMicrophoneUsageDescription + This app needs access to the microphone + NSPrincipalClass + AtomApplication + NSSupportsAutomaticGraphicsSwitching + + NSRequiresAquaSystemAppearance + + + diff --git a/pkg/apply.js b/pkg/apply.js index 1e2b2e3..a91a6f6 100644 --- a/pkg/apply.js +++ b/pkg/apply.js @@ -92,6 +92,18 @@ module.exports = async function ({ overwrite_version, friendly_errors } = {}) { } } + // patching app properties so dark/light mode can be detected + if ( + process.platform === 'darwin' && + (await fs.pathExists(path.resolve(`${helpers.__notion}/../Info.plist`))) + ) { + fs.copy( + path.resolve(`${__dirname}/Info.plist`), + path.resolve(`${helpers.__notion}/../Info.plist`), + { overwrite: true } + ); + } + for await (let insertion_target of readdirIterator( path.resolve(`${helpers.__notion}/app`), {