fix(desktop): Fixed issue where preferences header & tooltips are overlapped by custom titlebar

This commit is contained in:
Aman Harwara
2023-04-27 15:57:56 +05:30
parent 76bd995c9a
commit ef27a21fb1
6 changed files with 79 additions and 28 deletions

View File

@@ -156,7 +156,7 @@ export function createSpellcheckerManager(
const firstOutlier = session.availableSpellCheckerLanguages.find(
(language, index) => availableSpellCheckerLanguages[index] !== language,
)
throw new Error(`Found unsupported language code: ${firstOutlier}`)
console.error(`Found unsupported language code: ${firstOutlier}`)
}
setSpellcheckerLanguages()

View File

@@ -114,6 +114,17 @@ async function configureWindow(remoteBridge: CrossProcessBridge) {
if (isMacOS || useSystemMenuBar) {
// !important is important here because #desktop-title-bar has display: flex.
sheet.insertRule('#desktop-title-bar { display: none !important; }', sheet.cssRules.length)
} else {
/* Use custom title bar. Take the sn-titlebar-height off of
the app content height so its not overflowing */
sheet.insertRule(
'[data-dialog] { position: relative; height: calc(100vh - var(--sn-desktop-titlebar-height)) !important; margin-top: var(--sn-desktop-titlebar-height) !important; }',
sheet.cssRules.length,
)
sheet.insertRule(
'[data-mobile-popover] { padding-top: var(--sn-desktop-titlebar-height) !important; }',
sheet.cssRules.length,
)
}
}