mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(ui): keep context menus clear of the native titlebar (#2371)
This commit is contained in:
1 parent
8ebc9400ce
commit
453abfa145
36 files changed
+76
-72
No files matched your search
@@ -239,7 +239,7 @@ function observeFloatingResize(floating: HTMLElement, updatePosition: () => void
|
||||
};
|
||||
}
|
||||
|
||||
function getNativeTitlebarInset(ownerDocument: Document): number {
|
||||
export function getNativeTitlebarInset(ownerDocument: Document): number {
|
||||
const titlebar = ownerDocument.querySelector<HTMLElement>(TITLEBAR_SELECTOR);
|
||||
if (titlebar == null) return 0;
|
||||
const rect = titlebar.getBoundingClientRect();
|
||||
@@ -250,7 +250,7 @@ function getNativeTitlebarInset(ownerDocument: Document): number {
|
||||
return Math.max(0, rect.bottom - viewportTop);
|
||||
}
|
||||
|
||||
function getBoundaryPadding(ownerDocument: Document, basePadding: number): Padding {
|
||||
export function getBoundaryPadding(ownerDocument: Document, basePadding: number): Padding {
|
||||
const titlebarInset = getNativeTitlebarInset(ownerDocument);
|
||||
if (titlebarInset <= 0) {
|
||||
return basePadding;
|
||||
|
||||
Reference in new issue
Block a user