mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-02 03:29:07 +02:00
localize window titles, fix size for windows (and other platforms?)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { ReactNode, forwardRef } from "react";
|
||||
import {cn} from "@/lib/cn.ts";
|
||||
import {isMacOS} from "@/lib/platform.ts";
|
||||
|
||||
// ConfirmDialog is the shared layout wrapper used by dialog-style window
|
||||
// surfaces (SessionExpired, SessionAboutToExpire, …). Purely a layout
|
||||
@@ -23,7 +25,7 @@ export const ConfirmDialog = forwardRef<HTMLDivElement, ConfirmDialogProps>(
|
||||
>
|
||||
<div
|
||||
ref={ref}
|
||||
className={"flex flex-col items-center gap-5 p-8 text-center"}
|
||||
className={cn("flex flex-col items-center gap-5 p-8 text-center", !isMacOS() && "pt-4")}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useLayoutEffect, useRef } from "react";
|
||||
import { Window } from "@wailsio/runtime";
|
||||
import {isMacOS} from "@/lib/platform.ts";
|
||||
|
||||
// useAutoSizeWindow resizes the current Wails window so its height matches
|
||||
// the measured height of the content element the returned ref is attached
|
||||
@@ -21,7 +22,8 @@ export function useAutoSizeWindow<T extends HTMLElement>(width: number) {
|
||||
if (!el) return;
|
||||
let shown = false;
|
||||
const apply = () => {
|
||||
const h = Math.ceil(el.getBoundingClientRect().height);
|
||||
let h = Math.ceil(el.getBoundingClientRect().height);
|
||||
h = isMacOS() ? h : h - el.getBoundingClientRect().height;
|
||||
if (h <= 0) return;
|
||||
void Window.SetSize(width, h)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user