localize window titles, fix size for windows (and other platforms?)

This commit is contained in:
Eduard Gert
2026-05-29 16:58:08 +02:00
parent fb6138a3ba
commit 558769e671
7 changed files with 118 additions and 11 deletions
@@ -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(() => {