fix: Fixed issue where popover/modal headers would get cut off by desktop titlebar
This commit is contained in:
@@ -202,7 +202,7 @@ async function createWindowServices(window: Electron.BrowserWindow, appState: Ap
|
|||||||
initializeZoomManager(window, appState.store)
|
initializeZoomManager(window, appState.store)
|
||||||
|
|
||||||
const backupsManager = createBackupsManager(window.webContents, appState)
|
const backupsManager = createBackupsManager(window.webContents, appState)
|
||||||
const updateManager = setupUpdates(window, appState, backupsManager)
|
// const updateManager = setupUpdates(window, appState, backupsManager)
|
||||||
const trayManager = createTrayManager(window, appState.store)
|
const trayManager = createTrayManager(window, appState.store)
|
||||||
const spellcheckerManager = createSpellcheckerManager(appState.store, window.webContents, appLocale)
|
const spellcheckerManager = createSpellcheckerManager(appState.store, window.webContents, appLocale)
|
||||||
const mediaManager = new MediaManager()
|
const mediaManager = new MediaManager()
|
||||||
@@ -224,7 +224,7 @@ async function createWindowServices(window: Electron.BrowserWindow, appState: Ap
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
backupsManager,
|
backupsManager,
|
||||||
updateManager,
|
// updateManager,
|
||||||
trayManager,
|
trayManager,
|
||||||
spellcheckerManager,
|
spellcheckerManager,
|
||||||
menuManager,
|
menuManager,
|
||||||
|
|||||||
@@ -117,9 +117,8 @@ async function configureWindow(remoteBridge: CrossProcessBridge) {
|
|||||||
} else {
|
} else {
|
||||||
/* Use custom title bar. Take the sn-titlebar-height off of
|
/* Use custom title bar. Take the sn-titlebar-height off of
|
||||||
the app content height so its not overflowing */
|
the app content height so its not overflowing */
|
||||||
sheet.insertRule('body { padding-top: var(--sn-desktop-titlebar-height); }', sheet.cssRules.length)
|
|
||||||
sheet.insertRule(
|
sheet.insertRule(
|
||||||
'@media screen and (max-width: 768px) { [data-popover] { padding-top: calc(var(--sn-desktop-titlebar-height) + 0.5rem); } }',
|
'body, [data-reach-dialog-overlay], [data-mobile-popover] { padding-top: var(--sn-desktop-titlebar-height) !important; }',
|
||||||
sheet.cssRules.length,
|
sheet.cssRules.length,
|
||||||
)
|
)
|
||||||
sheet.insertRule(
|
sheet.insertRule(
|
||||||
|
|||||||
@@ -17,11 +17,13 @@ const MobilePopoverContent = ({
|
|||||||
children,
|
children,
|
||||||
title,
|
title,
|
||||||
className,
|
className,
|
||||||
|
id,
|
||||||
}: {
|
}: {
|
||||||
open: boolean
|
open: boolean
|
||||||
requestClose: () => void
|
requestClose: () => void
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
title: string
|
title: string
|
||||||
|
id: string
|
||||||
className?: string
|
className?: string
|
||||||
}) => {
|
}) => {
|
||||||
const [isMounted, setPopoverElement] = useModalAnimation(open)
|
const [isMounted, setPopoverElement] = useModalAnimation(open)
|
||||||
@@ -36,6 +38,8 @@ const MobilePopoverContent = ({
|
|||||||
<div
|
<div
|
||||||
ref={setPopoverElement}
|
ref={setPopoverElement}
|
||||||
className="fixed top-0 left-0 z-modal flex h-full w-full flex-col bg-default pt-safe-top pb-safe-bottom"
|
className="fixed top-0 left-0 z-modal flex h-full w-full flex-col bg-default pt-safe-top pb-safe-bottom"
|
||||||
|
data-popover={id}
|
||||||
|
data-mobile-popover
|
||||||
>
|
>
|
||||||
<div className="grid w-full grid-cols-[0.35fr_1fr_0.35fr] gap-2 border-b border-border py-1.5 px-2 text-base">
|
<div className="grid w-full grid-cols-[0.35fr_1fr_0.35fr] gap-2 border-b border-border py-1.5 px-2 text-base">
|
||||||
<div />
|
<div />
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ const Popover = ({
|
|||||||
}}
|
}}
|
||||||
title={title}
|
title={title}
|
||||||
className={className}
|
className={className}
|
||||||
|
id={popoverId.current}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</MobilePopoverContent>
|
</MobilePopoverContent>
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ const Modal = ({ title, close, actions = [], className = {}, customHeader, custo
|
|||||||
togglePopover={() => setShowAdvanced((show) => !show)}
|
togglePopover={() => setShowAdvanced((show) => !show)}
|
||||||
align="start"
|
align="start"
|
||||||
portal={false}
|
portal={false}
|
||||||
className="w-1/2 !min-w-0 divide-y divide-border border border-border"
|
className="!fixed w-1/2 !min-w-0 divide-y divide-border border border-border"
|
||||||
>
|
>
|
||||||
{extraActions
|
{extraActions
|
||||||
.filter((action) => action.type !== 'cancel')
|
.filter((action) => action.type !== 'cancel')
|
||||||
|
|||||||
Reference in New Issue
Block a user