From 6b161eb40309b3eb41fcd7c62830e6937f71560e Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Sun, 1 Nov 2020 14:39:06 +1100 Subject: [PATCH] better selectors for detecting favicons in databases --- mods/core/client.js | 8 +++++++- mods/core/css/tabs.css | 12 ++++++------ mods/core/render.js | 1 - 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mods/core/client.js b/mods/core/client.js index f31ab8c..9a6b386 100644 --- a/mods/core/client.js +++ b/mods/core/client.js @@ -227,10 +227,16 @@ module.exports = (store, __exports) => { ); __electronApi.setWindowTitle = (title) => { const $container = + document.querySelector( + '.notion-peek-renderer [style="padding-left: calc(126px + env(safe-area-inset-left)); padding-right: calc(126px + env(safe-area-inset-right)); max-width: 100%; width: 100%;"]' + ) || + document.querySelector( + '.notion-frame [style="padding-left: calc(96px + env(safe-area-inset-left)); padding-right: calc(96px + env(safe-area-inset-right)); max-width: 100%; margin-bottom: 8px; width: 100%;"]' + ) || document.querySelector('.notion-peak-renderer') || document.querySelector('.notion-frame'), icon = $container.querySelector( - '[style*="env(safe-area-inset-left)"] > .notion-record-icon img:not([src^="data:"])' + '.notion-record-icon img:not([src^="data:"])' ), img = icon && icon.getAttribute('src') diff --git a/mods/core/css/tabs.css b/mods/core/css/tabs.css index be0633e..8711940 100644 --- a/mods/core/css/tabs.css +++ b/mods/core/css/tabs.css @@ -127,7 +127,7 @@ body, font-size: 1.15em; padding: 0.2em 0.4em; text-align: left; - border-bottom: 4px solid var(--theme--table-border); + border-bottom: 0.22em solid var(--theme--table-border); opacity: 0.8; } #tabs .tab img { @@ -135,14 +135,14 @@ body, height: 1em; width: 1em; border-radius: 3px; - margin: 0 0.5em -3px 0.1em; + margin: 0 0.5em -0.16em 0.1em; } #tabs .tab:first-child { margin-top: 0.5em; } #tabs .tab:not(.new) span:not(.close) { width: 8.5em; - margin-right: 4px; + margin-right: 0.22em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -162,7 +162,7 @@ body, #tabs .tab.current { opacity: 1; background: var(--theme--selected); - border-bottom: 4px solid var(--theme--option_active-background); + border-bottom: 0.22em solid var(--theme--option_active-background); } #tabs .tab.new { background: none; @@ -179,7 +179,7 @@ body, #tabs .tab .close:hover, #tabs .tab.new span:hover, #titlebar .window-button:hover { - border-radius: 4px; + border-radius: 0.22em; background: var(--theme--table-border); box-shadow: 0 0 0 0.5px var(--theme--interactive_hover-border); } @@ -188,7 +188,7 @@ body, color: var(--theme--button_close-fill); } #tabs .tab.dragged-over { - box-shadow: inset 4px 0 0 0 var(--theme--selected); + box-shadow: inset 0.22em 0 0 0 var(--theme--selected); } .notion { diff --git a/mods/core/render.js b/mods/core/render.js index 222f1b3..8377f77 100644 --- a/mods/core/render.js +++ b/mods/core/render.js @@ -427,7 +427,6 @@ module.exports = (store, __exports) => { document.body.style.setProperty(style[0], style[1]); break; case 'enhancer:set-tab-title': - console.log(event.args[0]); if (this.state.tabs.get(+event.target.id)) { this.setState({ tabs: new Map(